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/30 11:58:48 UTC

[Axis2] Problem - Sent a null object instead the right object to the service

Hello Friends,

I get a trouble with my Axis2 application. I would like to send an object from the client sent to the server side.
But I provide a non null object to the Axis stub and it send a null object to the server side.
I created a service called setJobTicket (with this prototype : public boolean setJobTicket (NscJOBTICKET job))

The services.xml :
<service name="NscPostServices">
  <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">be.axatech.nscaxis.server.NscProdTrackingServices</parameter>
	<operation name="setJobTicket" mep="http://www.w3.org/2004/08/wsdl/in-out"/>
</service>

The corresponding NscPostServices wsdl file :
<wsdl:definitions xmlns:axis2="http://server.nscaxis"
                  xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
                  xmlns:ns0="http://nscsql/xsd"
                  xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
                  xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
                  xmlns:ns1="http://server.nscaxis/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">
  <wsdl:documentation>
NscPostServices</wsdl:documentation>
  <wsdl:types>
    <xs:schema xmlns:ax21="http://nscsql/xsd"
               attributeFormDefault="qualified"
               elementFormDefault="qualified"
               targetNamespace="http://nscsql/xsd">
      <xs:element name="NscJOBTICKET"
                  type="ax21:NscJOBTICKET"/>
      <xs:complexType name="NscJOBTICKET">
        <xs:sequence>
          <xs:element name="applicatif"
                      nillable="true"
                      type="xs:string"/>
          <xs:element name="applicatifString"
                      nillable="true"
                      type="xs:string"/>
          <xs:element name="arrivalDate"
                      nillable="true"
                      type="xs:dateTime"/>
          <xs:element name="arrivalDateString"
                      nillable="true"
                      type="xs:string"/>
          <xs:element name="containerId"
                      type="xs:int"/>
          <xs:element name="containerIdString"
                      nillable="true"
                      type="xs:string"/>
          <xs:element name="ddName"
                      nillable="true"
                      type="xs:string"/>
          <xs:element name="ddNameString"
                      nillable="true"
                      type="xs:string"/>
          <xs:element name="description"
                      nillable="true"
                      type="xs:string"/>
          <xs:element name="descriptionString"
                      nillable="true"
                      type="xs:string"/>
          <xs:element name="disposalDate"
                      nillable="true"
                      type="xs:dateTime"/>
          <xs:element name="disposalDateString"
                      nillable="true"
                      type="xs:string"/>
          <xs:element name="filiere"
                      nillable="true"
                      type="xs:string"/>
          <xs:element name="filiereString"
                      nillable="true"
                      type="xs:string"/>
          <xs:element name="finishingDate"
                      nillable="true"
                      type="xs:dateTime"/>
          <xs:element name="finishingDateString"
                      nillable="true"
                      type="xs:string"/>
          <xs:element name="flux"
                      type="xs:int"/>
          <xs:element name="fluxString"
                      nillable="true"
                      type="xs:string"/>
          <xs:element name="generationDate"
                      nillable="true"
                      type="xs:dateTime"/>
          <xs:element name="generationDateString"
                      nillable="true"
                      type="xs:string"/>
          <xs:element name="id"
                      type="xs:int"/>
          <xs:element name="idString"
                      nillable="true"
                      type="xs:string"/>
          <xs:element name="inputFile1"
                      nillable="true"
                      type="xs:string"/>
          <xs:element name="inputFile1String"
                      nillable="true"
                      type="xs:string"/>
          <xs:element name="inputFile2"
                      nillable="true"
                      type="xs:string"/>
          <xs:element name="inputFile2String"
                      nillable="true"
                      type="xs:string"/>
          <xs:element name="inputFile3"
                      nillable="true"
                      type="xs:string"/>
          <xs:element name="inputFile3String"
                      nillable="true"
                      type="xs:string"/>
          <xs:element name="inputFile4"
                      nillable="true"
                      type="xs:string"/>
          <xs:element name="inputFile4String"
                      nillable="true"
                      type="xs:string"/>
          <xs:element name="inputFile5"
                      nillable="true"
                      type="xs:string"/>
          <xs:element name="inputFile5String"
                      nillable="true"
                      type="xs:string"/>
          <xs:element name="internalDest"
                      nillable="true"
                      type="xs:string"/>
          <xs:element name="internalDestString"
                      nillable="true"
                      type="xs:string"/>
          <xs:element name="jobBarCode"
                      nillable="true"
                      type="xs:string"/>
          <xs:element name="jobBarCodeString"
                      nillable="true"
                      type="xs:string"/>
          <xs:element name="jobName"
                      nillable="true"
                      type="xs:string"/>
          <xs:element name="jobNameString"
                      nillable="true"
                      type="xs:string"/>
          <xs:element name="jobNum"
                      nillable="true"
                      type="xs:string"/>
          <xs:element name="jobNumString"
                      nillable="true"
                      type="xs:string"/>
          <xs:element name="paperCode"
                      nillable="true"
                      type="xs:string"/>
          <xs:element name="paperCodeString"
                      nillable="true"
                      type="xs:string"/>
          <xs:element name="previsionnalSendingType"
                      type="xs:int"/>
          <xs:element name="previsionnalSendingTypeString"
                      nillable="true"
                      type="xs:string"/>
          <xs:element name="printingDate"
                      nillable="true"
                      type="xs:dateTime"/>
          <xs:element name="printingDateString"
                      nillable="true"
                      type="xs:string"/>
          <xs:element name="realSendingType"
                      type="xs:int"/>
          <xs:element name="realSendingTypeString"
                      nillable="true"
                      type="xs:string"/>
          <xs:element name="renaFile"
                      nillable="true"
                      type="xs:string"/>
          <xs:element name="renaFileString"
                      nillable="true"
                      type="xs:string"/>
          <xs:element name="sendingDate"
                      nillable="true"
                      type="xs:dateTime"/>
          <xs:element name="sendingDateString"
                      nillable="true"
                      type="xs:string"/>
          <xs:element name="status"
                      type="xs:int"/>
          <xs:element name="statusString"
                      nillable="true"
                      type="xs:string"/>
          <xs:element name="swMode"
                      type="xs:int"/>
          <xs:element name="swModeString"
                      nillable="true"
                      type="xs:string"/>
          <xs:element name="totalEnv"
                      type="xs:int"/>
          <xs:element name="totalEnvDone"
                      type="xs:int"/>
          <xs:element name="totalEnvDoneString"
                      nillable="true"
                      type="xs:string"/>
          <xs:element name="totalEnvString"
                      nillable="true"
                      type="xs:string"/>
          <xs:element name="totalFaces"
                      type="xs:int"/>
          <xs:element name="totalFacesString"
                      nillable="true"
                      type="xs:string"/>
          <xs:element name="totalSheets"
                      type="xs:int"/>
          <xs:element name="totalSheetsString"
                      nillable="true"
                      type="xs:string"/>
        </xs:sequence>
      </xs:complexType>
    </xs:schema>
    <xs:schema xmlns:ns="http://server.nscaxis/xsd"
               attributeFormDefault="qualified"
               elementFormDefault="qualified"
               targetNamespace="http://server.nscaxis/xsd">
      <xs:element name="setJobTicket">
        <xs:complexType>
          <xs:sequence>
            <xs:element name="job"
                        nillable="true"
                        type="ns0:NscJOBTICKET"/>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
    </xs:schema>
  </wsdl:types>
  <wsdl:message name="setJobTicketMessage">
    <wsdl:part name="part1"
               element="ns1:setJobTicket"/>
  </wsdl:message>
  <wsdl:message name="setJobTicketResponse">
    <wsdl:part name="part1"
               element="ns1:setJobTicketResponse"/>
  </wsdl:message>
  <wsdl:portType name="NscPostServicesPortType">
    <wsdl:operation name="setJobTicket">
      <wsdl:input xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl"
                  message="axis2:setJobTicketMessage"
                  wsaw:Action="urn:setJobTicket"/>
      <wsdl:output message="axis2:setJobTicketResponse"/>
    </wsdl:operation>
  </wsdl:portType>
  <wsdl:binding name="NscPostServicesSOAP11Binding"
                type="axis2:NscPostServicesPortType">
    <soap:binding transport="http://schemas.xmlsoap.org/soap/http"
                  style="document"/>
    <wsdl:operation name="setJobTicket">
      <soap:operation soapAction="urn:setJobTicket"
                      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="NscPostServicesSOAP12Binding"
                type="axis2:NscPostServicesPortType">
    <soap12:binding transport="http://schemas.xmlsoap.org/soap/http"
                    style="document"/>
    <wsdl:operation name="setJobTicket">
      <soap12:operation soapAction="urn:setJobTicket"
                        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="NscPostServicesHttpBinding"
                type="axis2:NscPostServicesPortType">
    <http:binding verb="POST"/>
    <wsdl:operation name="setJobTicket">
      <http:operation location="setJobTicket"/>
      <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="NscPostServices">
    <wsdl:port name="NscPostServicesSOAP11port_http"
               binding="axis2:NscPostServicesSOAP11Binding">
      <soap:address location="http://192.168.1.4:9090/axis2/services/NscPostServices"/>
    </wsdl:port>
    <wsdl:port name="NscPostServicesSOAP12port_http"
               binding="axis2:NscPostServicesSOAP12Binding">
      <soap12:address location="http://192.168.1.4:9090/axis2/services/NscPostServices"/>
    </wsdl:port>
    <wsdl:port name="NscPostServicesHttpport"
               binding="axis2:NscPostServicesHttpBinding">
      <http:address location="http://192.168.1.4:9090/axis2/services/NscPostServices"/>
    </wsdl:port>
  </wsdl:service>
</wsdl:definitions>

The client side java code is :
    public void setJobTicket (NscJOBTICKET job)
    {
        try
        {
            SetJobTicket request = new SetJobTicket();
            request.setJob(job);
            stub.setJobTicket(request);
        }
        catch (java.rmi.RemoteException e)
        {
            e.printStackTrace();
        }        
    }
   
Please note that the job parameter is a Axis generated object and it is not null.

When I called the setJobTicket service via the sutb Axis, the soap message is the following (extract from the TCPMon program) :

POST /axis2/services/NscPostServices/setJobTicket HTTP/1.1
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
SOAPAction: ""
User-Agent: Axis2
Host: 127.0.0.1:9090
Transfer-Encoding: chunked

4
job=
0?

So the Axis service receive a null object ! I don't understand where is my problem. I provide a non-null object to the client side and this one send a null object :(

Can you help me ?

Thanks in advance,

Stephane

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