1 Reply Latest reply on Feb 1, 2005 6:05 AM by thomas.diesler

    echoing request fails

    tbiernat

      i have a simple service generated from wsdl/schema with jwsdp-1.5 wscompile, deployed to jboss 4.01.
      the request is sent minus some nonessential elements (minOccurs=0) and looks like this:

      POST /CashLetterService/process HTTP/1.1
      Content-Type: text/xml; charset=utf-8
      Content-Length: 603
      SOAPAction: ""
      User-Agent: Java/1.4.2
      Host: 127.0.0.1
      Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
      Connection: keep-alive
      
      <?xml version="1.0" encoding="UTF-8"?>
       <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:enc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns0="urn:service/types">
       <env:Body>
       <ns0:CashLetter>
       <prodId>C</prodId>
       <recvingBankABA>053000219</recvingBankABA>
       <sendingBankABA>102000018</sendingBankABA>
       <trackingNbr>UPS-001</trackingNbr>
       <totalItems>50</totalItems>
       <totalAmount>10000.01</totalAmount>
       <entryUserId>/O=NSS/CN=nss-test</entryUserId>
       </ns0:CashLetter>
       </env:Body>
       </env:Envelope>
      


      the service implementation simply returns the request, but now it has nils for those nonessential elements and looks like this:

      HTTP/1.1 200 OK
      X-Powered-By: Servlet 2.4; Tomcat-5.0.28/JBoss-4.0.1 (build: CVSTag=JBoss_4_0_1 date=200412230944)
      Content-Type: text/xml;charset=utf-8
      Transfer-Encoding: chunked
      Date: Thu, 27 Jan 2005 00:41:53 GMT
      Server: Apache-Coyote/1.1
      
      2be
      <?xml version="1.0" encoding="UTF-8"?>
       <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
       <soapenv:Body>
       <ns1:CashLetter xmlns:ns1="urn:service/types">
       <conditionCode xsi:nil="1"/>
       <conditionText xsi:nil="1"/>
       <prodId>C</prodId>
       <recvingBankABA>053000219</recvingBankABA>
       <sendingBankABA>102000018</sendingBankABA>
       <trackingNbr>UPS-001</trackingNbr>
       <totalItems>50</totalItems>
       <totalAmount>10000.01</totalAmount>
       <entryUserId>/O=NSS/CN=nss-test</entryUserId>
       <cashLetterId xsi:nil="1"/>
       </ns1:CashLetter>
       </soapenv:Body>
       </soapenv:Envelope>
      0
      


      this results in a client stack trace like so:

      [junit] java.rmi.RemoteException: Runtime exception; nested exception is:
       [junit] unexpected null value for literal data
       [junit] at com.sun.xml.rpc.client.StreamingSender._handleRuntimeExceptionInSend(StreamingSender.java:318)
       [junit] at com.sun.xml.rpc.client.StreamingSender._send(StreamingSender.java:300)
       [junit] at service.cashletter.ServicePort_Stub.process(ServicePort_Stub.java:67)
       [junit] at service.cashletter.ServiceTestCase.testProcess(ServiceTestCase.java:38)
       [junit] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       [junit] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       [junit] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       [junit] at java.lang.reflect.Method.invoke(Method.java:324)
      


      the schema for the request message looks like this:
      <element name="CashLetter">
       <complexType>
       <sequence>
       <element name="conditionCode" type="string"
       minOccurs="0" />
       <element name="conditionText" type="string"
       minOccurs="0" />
       <element name="prodId" type="string" />
       <element name="recvingBankABA" type="string" />
       <element name="sendingBankABA" type="string" />
       <element name="trackingNbr" type="string" minOccurs="0" />
       <element name="totalItems" type="int" />
       <element name="totalAmount" type="decimal" />
       <element name="entryUserId" type="string" />
       <element name="cashLetterId" type="long" minOccurs="0" />
       </sequence>
       </complexType>
       </element>
      


      the relevant wsdl is
       <message name="Request">
       <part name="in" element="types:CashLetter" />
       </message>
       <message name="Response">
       <part name="out" element="types:CashLetter" />
       </message>
       <message name="ServiceException">
       <part name="ex" element="types:ServiceException" />
       </message>
      
       <portType name="ServicePort">
       <operation name="process">
       <input message="tns:Request" />
       <output message="tns:Response" />
       <fault name="ServiceException"
       message="tns:ServiceException" />
       </operation>
       </portType>
      
       <binding name="ServiceBinding" type="tns:ServicePort">
       <soap:binding transport="http://schemas.xmlsoap.org/soap/http"
       style="document" />
       <operation name="process">
       <soap:operation soapAction="" />
       <input>
       <soap:body use="literal" />
       </input>
       <output>
       <soap:body use="literal" />
       </output>
       <fault name="ServiceException">
       <soap:fault name="ServiceException" use="literal" />
       </fault>
       </operation>
       </binding>
      


      this does not seem reasonable. any ideas?

        • 1. Re: echoing request fails
          thomas.diesler

          I think this is a fundamental issue caused by schema unawareness of the underlying Axis stack. A possible fix would be to support minOccurs=0 in ws4ee-deployment.xml.

          Currently JBossWS is undergoing a complete rewrite which is schema aware.

          Can you change the schema definition?