Announcement Announcement Module
Collapse
No announcement yet.
Endpoint Request Data Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Endpoint Request Data

    We have a SOAP request to a Spring web service that is arriving at the endpoint but the data is not populated. Spring WS is in version 1.5.5 and we've also experienced this in 1.5.7. We're including JaxB 2.0.5

    The Request XML is

    Code:
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" >
       <soapenv:Header/>
       <soapenv:Body>
          <CanReceiptBeEditedRequest xmlns="http://aaacorp.com/rms/schemas/wms/receipt/messages/v1_0">
             <receiptNumber>100068</receiptNumber>
             <orderNumber>605029</orderNumber>
          </CanReceiptBeEditedRequest>
       </soapenv:Body>
    </soapenv:Envelope>
    Spring allows the request to arrive at the end point but the JaxB Schema object request that is passed in doesn't have either the receipt or order number.

    First question is this a valid SOAP request? I'd guess it is if spring isn't complaining.

    I went ahead and added the XSD to the marshaller to enable validation.

    Code:
    	<bean id="marshaller" class="org.springframework.oxm.jaxb.Jaxb2Marshaller">
    		<property name="contextPath"
    			value="com.anfcorp.rms.schemas.wms.receipt.messages.v1_0" />
    		<property name="schema" value="classpath:ReceiptsServiceMessages.xsd"/>
    	</bean>
    And now I receive this in response to sending my request....

    JAXB unmarshalling exception: null; nested exception is javax.xml.bind.UnmarshalException
    - with linked exception:
    [org.xml.sax.SAXParseException: cvc-complex-type.2.4.a: Invalid content was found starting with element 'receiptNumber'. One of '{"":receiptNumber}' is expected.]

    So it's not valid? What is the correct format? We can add the namespace to the envelope that makes it work, but I'm not clear on why the example above isn't a valid request, or so invalid that spring should complain.

    I've attached a snippet of my XSD.

    Code:
    <xs:schema targetNamespace="http://aaacorp.com/rms/schemas/wms/receipt/messages/v1_0"
    	xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:receipt="http://aaacorp.com/rms/schemas/wms/receipt/v1_0"
    	xmlns:pagination="http://aaacorp.com/rms/schemas/util/pagination"
    	xmlns:po="http://aaacorp.com/rms/schemas/po/v1_0" xmlns:tn="http://aaacorp.com/rms/schemas/wms/receipt/messages/v1_0">
    
    	<xs:element name="CanReceiptBeEditedRequest">
    		<xs:complexType>
    			<xs:sequence>
    				<xs:element name="receiptNumber" type="xs:long"
    					minOccurs="1" maxOccurs="1" />
    				<xs:element name="orderNumber" type="xs:long" minOccurs="1"
    					maxOccurs="1" />
    			</xs:sequence>
    		</xs:complexType>
    	</xs:element>
Working...
X