Announcement Announcement Module
Collapse
No announcement yet.
MTOM - Spring WS Error Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • MTOM - Spring WS Error

    Hi, I made an example with MTOM - Spring WS, this example tries to upload a file, I tried to test it but i've get the following error:

    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
    <SOAP-ENV:Header/>
    <SOAP-ENV:Body>
    <SOAP-ENV:Fault>
    <faultcode>SOAP-ENV:Server</faultcode>
    <faultstring xml:lang="en">No adapter for endpoint [public void com.prueba.ws.LoadInvoiceEndpoint.loadInvoice(java x.xml.bind.JAXBElement&lt;com.prueba.entity.FilePr operties>)]: Does your endpoint implement a supported interface like MessageHandler or PayloadEndpoint?</faultstring>
    </SOAP-ENV:Fault>
    </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>

    Do you know why i've get this error?



    the request:

    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
    <soapenv:Header/>
    <soapenv:Body>
    <LoadInvoiceRequest xmlns="http://www.prueba.com/prueba/ws/schemas">
    <dataFile>cid:laimagen</dataFile>
    <fileNameWithExtension>oopsla2004.pdf</fileNameWithExtension>
    </LoadInvoiceRequest>
    </soapenv:Body>
    </soapenv:Envelope>
    XSD:

    <?xml version="1.0" encoding="utf-8"?>
    <schema elementFormDefault="qualified" targetNamespace="http://www.prueba.com/prueba/ws/schemas" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://www.prueba.com/prueba/ws/schemas" xmlns:xmime="http://www.w3.org/2005/05/xmlmime">

    <element name="LoadInvoiceRequest" type="tns:FileProperties"/>
    <complexType name="FileProperties">
    <sequence>
    <element name="dataFile" type="base64Binary"/>
    <element name="fileNameWithExtension" type="string"/>
    </sequence>
    </complexType>
    </schema>

    The EndPoint:

    @Endpointpublic
    class LoadInvoiceEndpoint {
    private Logger logger = Logger.getLogger(getClass().getSimpleName());
    private ObjectFactory objectFactory;
    @PayloadRoot(localPart = "LoadInvoiceRequest", namespace = http://www.prueba.com/prueba/ws/schemas)
    public void loadInvoice(JAXBElement<FileProperties> requestElement) {
    logger.info("Inside the method");
    objectFactory.createLoadInvoiceRequest(requestElem ent.getValue());
    }}

    the app-servlet.xml

    <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">

    <bean class="com.prueba.ws.LoadInvoiceEndpoint"></bean>

    <bean class="org.springframework.ws.server.endpoint.mapp ing.PayloadRootAnnotationMethodEndpointMapping"/>

    <bean class="org.springframework.ws.server.endpoint.adap ter.GenericMarshallingMethodEndpointAdapter"><cons tructor-arg ref="marshaller"/></bean>

    <bean id="marshaller" class="org.springframework.oxm.jaxb.Jaxb2Marshalle r">
    <property name="contextPath" value="com.prueba.schema"/>
    <property name="mtomEnabled" value="true"/>
    </bean>

    <bean id="prueba" class="org.springframework.ws.wsdl.wsdl11.DefaultW sdl11Definition">
    <property name="schema" ref="schema"/>
    <property name="portTypeName" value="InvoiceRepository"/>
    <property name="locationUri" value="http://localhost:8080/pruebaws/services/"/>
    </bean>

    <bean id="schema" class="org.springframework.xml.xsd.SimpleXsdSchema ">
    <property name="xsd" value="classpath:loadInvoice.xsd"/>
    </bean>

    </beans>

    Anyone have an idea?
Working...
X