You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Stephane Glowacki <sg...@ulb.ac.be> on 2007/05/21 16:20:47 UTC

SubElement error (soap message size ?)

Hi all,

I'm trying to use Axis2-1.2 for my project. Unfortunately, I get some errors.
Below you can read the all deployment steps and the wsdl generated file and the soap responses.

- Install Apache Tomcat 6.0.10 and deploy an Axis 2-2.1war file (building via Ant).
- Deploy my web services in the service directory of Axis webapps.
  For information, here my services.xml :
  <service name="MyServices">
    <messageReceivers>
      <messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-out"
                       class="org.apache.axis2.rpc.receivers.RPCMessageReceiver"/>
      <messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-only"
                       class="org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiver"/>
    </messageReceivers>
	  <parameter name="ServiceClass" locked="false">com.nscaxis.server.NscProdTrackingServices</parameter>
	  <operation name="getJobTickets" mep="http://www.w3.org/2004/08/wsdl/in-out"/>
	  <operation name="getJobTicketsFromContainer" mep="http://www.w3.org/2004/08/wsdl/in-out"/>
  </service>

  And the MyServices?wsdl file :

<wsdl:definitions xmlns:axis2="http://server.nscaxis.com" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:ns0="http://nscsql.com/xsd" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:ns1="http://server.nscaxis.com/xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://server.nscaxis.com">
  <wsdl:documentation>MyServices</wsdl:documentation>
    <wsdl:types>
      <xs:schema xmlns:ax21="http://nscsql.com/xsd" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://nscsql.com/xsd">
        <xs:element name="Container" type="ax21:Container" />
        <xs:complexType name="Container">
          <xs:sequence>
            <xs:element name="barcode" nillable="true" type="xs:string" />
            <xs:element name="description" nillable="true" type="xs:string" />
            <xs:element name="destination" nillable="true" type="xs:string" />
            <xs:element name="id" type="xs:int" />
            <xs:element name="name" nillable="true" type="xs:string" />
          </xs:sequence>
        </xs:complexType>
        <xs:element name="JobTicket" type="ax21:JobTicket" />
        <xs:complexType name="JobTicket">
          <xs:sequence>
            <xs:element name="applicatif" nillable="true" type="xs:string" />
            <xs:element name="arrivalDate" nillable="true" type="xs:dateTime" />
            <xs:element name="containerId" type="xs:int" />
            <xs:element name="dDName" nillable="true" type="xs:string" />
            <xs:element name="description" nillable="true" type="xs:string" />
            <xs:element name="disposalDate" nillable="true" type="xs:dateTime" />
            <xs:element name="filiere" nillable="true" type="xs:string" />
            <xs:element name="finishingDate" nillable="true" type="xs:dateTime" />
            <xs:element name="flux" type="xs:int" />
            <xs:element name="generationDate" nillable="true" type="xs:dateTime" />
            <xs:element name="id" type="xs:int" />
            <xs:element name="inputFile1" nillable="true" type="xs:string" />
            <xs:element name="inputFile2" nillable="true" type="xs:string" />
            <xs:element name="inputFile3" nillable="true" type="xs:string" />
            <xs:element name="inputFile4" nillable="true" type="xs:string" />
            <xs:element name="inputFile5" nillable="true" type="xs:string" />
            <xs:element name="internalDest" nillable="true" type="xs:string" />
            <xs:element name="jobBarCode" nillable="true" type="xs:string" />
            <xs:element name="jobName" nillable="true" type="xs:string" />
            <xs:element name="jobNum" nillable="true" type="xs:string" />
            <xs:element name="paperCode" nillable="true" type="xs:string" />
            <xs:element name="previsionnalSendingType" nillable="true" type="xs:string" />
            <xs:element name="printingDate" nillable="true" type="xs:dateTime" />
            <xs:element name="realSendingType" nillable="true" type="xs:string" />
            <xs:element name="renaFile" nillable="true" type="xs:string" />
            <xs:element name="sWMode" type="xs:int" />
            <xs:element name="sendingDate" nillable="true" type="xs:dateTime" />
            <xs:element name="status" type="xs:int" />
            <xs:element name="totalEnv" type="xs:int" />
            <xs:element name="totalEnvDone" type="xs:int" />
            <xs:element name="totalFaces" type="xs:int" />
            <xs:element name="totalSheets" type="xs:int" />
            <xs:element name="SWMode_MERGE" type="xs:int" />
            <xs:element name="SWMode_SPLIT" type="xs:int" />
            <xs:element name="SWMode_TRACK" type="xs:int" />
            <xs:element name="Status_Arrival" type="xs:int" />
            <xs:element name="Status_Disposal" type="xs:int" />
            <xs:element name="Status_Printed" type="xs:int" />
            <xs:element name="Status_Processed" type="xs:int" />
            <xs:element name="Status_Sent" type="xs:int" />
          </xs:sequence>
        </xs:complexType>
      </xs:schema>
      <xs:schema xmlns:ns="http://server.nscaxis.com/xsd" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://server.nscaxis.com/xsd">
        <xs:element name="getContainersResponse">
          <xs:complexType>
            <xs:sequence>
              <xs:element maxOccurs="unbounded" name="return" nillable="true" type="ns0:Container" />
            </xs:sequence>
          </xs:complexType>
        </xs:element>
        <xs:element name="getJobTickets">
          <xs:complexType>
            <xs:sequence>
              <xs:element name="param0" nillable="true" type="xs:int" />
            </xs:sequence>
          </xs:complexType>
        </xs:element>
        <xs:element name="getJobTicketsResponse">
          <xs:complexType>
            <xs:sequence>
              <xs:element maxOccurs="unbounded" name="return" nillable="true" type="ns0:JobTicket" />
            </xs:sequence>
          </xs:complexType>
        </xs:element>
      </xs:schema>
    </wsdl:types>
    <wsdl:message name="getContainersMessage" />
    <wsdl:message name="getContainersResponse">
      <wsdl:part name="part1" element="ns1:getContainersResponse" />
    </wsdl:message>
    <wsdl:message name="getJobTicketsMessage">
      <wsdl:part name="part1" element="ns1:getJobTickets" />
    </wsdl:message>
    <wsdl:message name="getJobTicketsResponse">
      <wsdl:part name="part1" element="ns1:getJobTicketsResponse" />
    </wsdl:message>
    <wsdl:portType name="MyServicesPortType">
      <wsdl:operation name="getContainers">
        <wsdl:input xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" message="axis2:getContainersMessage" wsaw:Action="urn:getContainers" />
        <wsdl:output message="axis2:getContainersResponse" />
      </wsdl:operation>
      <wsdl:operation name="getJobTickets">
        <wsdl:input xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" message="axis2:getJobTicketsMessage" wsaw:Action="urn:getJobTickets" />
        <wsdl:output message="axis2:getJobTicketsResponse" />
      </wsdl:operation>
    </wsdl:portType>
    <wsdl:binding name="MyServicesSOAP11Binding" type="axis2:MyServicesPortType">
      <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
      <wsdl:operation name="getContainers">
        <soap:operation soapAction="urn:getContainers" style="document" />
        <wsdl:input>
          <soap:body use="literal" />
        </wsdl:input>
        <wsdl:output>
          <soap:body use="literal" />
        </wsdl:output>
      </wsdl:operation>
      <wsdl:operation name="getJobTickets">
        <soap:operation soapAction="urn:getJobTickets" style="document" />
        <wsdl:input>
          <soap:body use="literal" />
        </wsdl:input>
        <wsdl:output>
          <soap:body use="literal" />
        </wsdl:output>
      </wsdl:operation>
    </wsdl:binding>
    <wsdl:binding name="MyServicesSOAP12Binding" type="axis2:MyServicesPortType">
      <soap12:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
      <wsdl:operation name="getContainers">
        <soap12:operation soapAction="urn:getContainers" style="document" />
        <wsdl:input>
          <soap12:body use="literal" />
        </wsdl:input>
        <wsdl:output>
          <soap12:body use="literal" />
        </wsdl:output>
      </wsdl:operation>
      <wsdl:operation name="getJobTickets">
        <soap12:operation soapAction="urn:getJobTickets" style="document" />
        <wsdl:input>
          <soap12:body use="literal" />
        </wsdl:input>
        <wsdl:output>
          <soap12:body use="literal" />
        </wsdl:output>
      </wsdl:operation>
    </wsdl:binding>
    <wsdl:binding name="MyServicesHttpBinding" type="axis2:MyServicesPortType">
      <http:binding verb="POST" />
      <wsdl:operation name="getContainers">
        <http:operation location="getContainers" />
        <wsdl:input>
          <mime:content type="text/xml" />
        </wsdl:input>
        <wsdl:output>
          <mime:content type="text/xml" />
        </wsdl:output>
      </wsdl:operation>
      <wsdl:operation name="getJobTickets">
        <http:operation location="getJobTickets" />
        <wsdl:input>
          <mime:content type="text/xml" />
        </wsdl:input>
        <wsdl:output>
          <mime:content type="text/xml" />
        </wsdl:output>
      </wsdl:operation>
    </wsdl:binding>
    <wsdl:service name="MyServices">
      <wsdl:port name="MyServicesSOAP11port_http" binding="axis2:MyServicesSOAP11Binding">
        <soap:address location="http://10.160.124.224:9090/axis2/services/MyServices" />
      </wsdl:port>
      <wsdl:port name="MyServicesSOAP12port_http" binding="axis2:MyServicesSOAP12Binding">
        <soap12:address location="http://10.160.124.224:9090/axis2/services/MyServices" />
      </wsdl:port>
      <wsdl:port name="MyServicesHttpport" binding="axis2:MyServicesHttpBinding">
        <http:address location="http://10.160.124.224:9090/axis2/services/MyServices" />
      </wsdl:port>
    </wsdl:service>
  </wsdl:definitions>

- Client side, call the GetJobTickets service :

  NscTestClient test = new NscTestClient();
  MyServicesMyServicesHttpportStub stub = new MyServicesMyServicesHttpportStub();

  GetJobTickets request = new GetJobTickets();
  request.setParam0(1);
  GetJobTicketsResponse response = stub.getJobTickets(request);
  JobTicket[] jobs = response.get_return();
  System.out.println("Jobs size: " + jobs.length);

  GetContainersResponse resp = stub.getContainers();
  Container[] containers = resp.get_return();
  System.out.println("Containers size: " + containers.length);

- When I call the GetJobTickets service, I get this error :
Exception in thread "main" java.lang.RuntimeException: java.lang.RuntimeException: Unexpected subelement description
	at com.nscaxis.server.MyServicesMyServicesHttpportStub.fromOM(MyServicesMyServicesHttpportStub.java:7447)
	at com.nscaxis.server.MyServicesMyServicesHttpportStub.getJobTickets(MyServicesMyServicesHttpportStub.java:390)
	at com.nscaxis.client.NscTestClient.main(NscTestClient.java:19)
Caused by: java.lang.RuntimeException: Unexpected subelement description
	at com.nscaxis.server.MyServicesMyServicesHttpportStub$JobTicket$Factory.parse(MyServicesMyServicesHttpportStub.java:3693)
	at com.nscaxis.server.MyServicesMyServicesHttpportStub$GetJobTicketsResponse$Factory.parse(MyServicesMyServicesHttpportStub.java:7303)
	at com.nscaxis.server.MyServicesMyServicesHttpportStub.fromOM(MyServicesMyServicesHttpportStub.java:7434)
	... 2 more

- I use TcpMon to visualize the SOAP response (please note I indented manually the xml response part) :
TTP/1.1 200 OK
Server: Apache-Coyote/1.1
Content-Type: application/xml;action="urn:getJobTickets";;charset=UTF-8
Transfer-Encoding: chunked
Date: Mon, 21 May 2007 13:50:01 GMT

2000
<ns:getJobTicketsResponse xmlns:ns="http://server.nscaxis.com/xsd">
  <ns:return>
    <applicatif xmlns="http://nscsql.com/xsd">FPI     </applicatif>
    <arrivalDate xmlns="http://nscsql.com/xsd">2007-05-14T14:32:07.000Z</arrivalDate>
    <containerId xmlns="http://nscsql.com/xsd">0</containerId>
    <description xmlns="http://nscsql.com/xsd">Output provennant de l'application FPI                                                                                          </description>
    <disposalDate xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://nscsql.com/xsd" xsi:nil="true" />
    <filiere xmlns="http://nscsql.com/xsd">INS     </filiere>
    <finishingDate xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://nscsql.com/xsd" xsi:nil="true" />
    <flux xmlns="http://nscsql.com/xsd">34</flux>
    <generationDate xmlns="http://nscsql.com/xsd">2007-04-13T14:35:01.000Z</generationDate>
    <id xmlns="http://nscsql.com/xsd">11</id>
    <inputFile1 xmlns="http://nscsql.com/xsd">SPL.GW83000A.FLUX0341.E3029513                                                                                                  </inputFile1>
    <inputFile2 xmlns="http://nscsql.com/xsd">SPL.GW83000A.FLUX0342.E3029513                                                                                                  </inputFile2>
    <inputFile3 xmlns="http://nscsql.com/xsd">SPL.GW83000A.FLUX0343.E3029513                                                                                                  </inputFile3>
    <inputFile4 xmlns="http://nscsql.com/xsd">SPL.GW83000A.FLUX0344.E3029513                                                                                                  </inputFile4>
    <inputFile5 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://nscsql.com/xsd" xsi:nil="true" />
    <internalDest xmlns="http://nscsql.com/xsd">N/A                 </internalDest>
    <jobBarCode xmlns="http://nscsql.com/xsd">07103043501323525001</jobBarCode>
    <jobName xmlns="http://nscsql.com/xsd">GTJ30295</jobName>
    <jobNum xmlns="http://nscsql.com/xsd">JOB32352</jobNum>
    <paperCode xmlns="http://nscsql.com/xsd">QX25            </paperCode>
    <previsionnalSendingType xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://nscsql.com/xsd" xsi:nil="true" />
    <printingDate xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://nscsql.com/xsd" xsi:nil="true" />
    <realSendingType xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://nscsql.com/xsd" xsi:nil="true" />
    <renaFile xmlns="http://nscsql.com/xsd">DPR.GW83500A.RENA0074.C2881213                                                                                                  </renaFile>
    <sendingDate xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://nscsql.com/xsd" xsi:nil="true" />
    <status xmlns="http://nscsql.com/xsd">1</status>
    <totalEnv xmlns="http://nscsql.com/xsd">29</totalEnv>
    <totalEnvDone xmlns="http://nscsql.com/xsd">0</totalEnvDone>
    <totalFaces xmlns="http://nscsql.com/xsd">152</totalFaces>
    <totalSheets xmlns="http://nscsql.com/xsd">76</totalSheets>
  </ns:return>
</ns:getJobTicketsResponse>
0

Effectively, the dDName field is missing in this response. But I don't understand why. Axis2 generates a correct wsdl. It constructs this bad response and my service provides a JobTicket object which contains a dDName field.
I'm lost regarding this behaviour... I get an error in the message only for the JobTicket object. Maybe the max length of a SOAP Message is fixed (configuration file?) ?

Additional question, if the returned collection is empty, I get this response from my service :
  <ns:getContainersResponse xmlns:ns="http://server.nscaxis.com/xsd" />
So, I get this error at the client side :
Exception in thread "main" java.lang.RuntimeException: java.lang.RuntimeException: Unexpected subelement getContainersResponse
	at com.nscaxis.server.MyServicesMyServicesHttpportStub.fromOM(MyServicesMyServicesHttpportStub.java:7447)
	at com.nscaxis.server.MyServicesMyServicesHttpportStub.getContainers(MyServicesMyServicesHttpportStub.java:180)
	at com.nscaxis.client.NscTestClient.main(NscTestClient.java:25)
Caused by: java.lang.RuntimeException: Unexpected subelement getContainersResponse
	at com.nscaxis.server.MyServicesMyServicesHttpportStub$GetContainersResponse$Factory.parse(MyServicesMyServicesHttpportStub.java:6537)
	at com.nscaxis.server.MyServicesMyServicesHttpportStub.fromOM(MyServicesMyServicesHttpportStub.java:7441)
	... 2 more

How can I avoid this error message ?


Thanks in advance for your help.

Regards,

Stephane

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org