Hi Dimuthu ( and all),

thanks a lot for your advise. I have tried already but there is no difference on the 
result.

I have monitored the connection with the TCPMonitor utility of Axis and I have 
discovered that in fact the problem is not in the client side but in the server side 
(or maybe also...), according to the SOAP message content of the returned response, as 
follows:

SOAP request:
----------------
POST /axis/services/StructTest HTTP/1.0 Content-Type: text/xml; charset=utf-8 Accept: 
application/soap+xml, application/dime, multipart/related, text/* User-Agent: Axis/1.1 
Host: 127.0.0.1 Cache-Control: no-cache Pragma: no-cache SOAPAction: "" 
Content-Length: 690  <?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>
  <serviceMethod soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/";>
   <arg1 href="#id0"/>
  </serviceMethod>
  <multiRef id="id0" soapenc:root="0" 
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"; 
xsi:type="ns1:MyStruct" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"; 
xmlns:ns1="urn:StructTest2">
   <a xsi:type="xsd:string">a</a>
   <b xsi:type="xsd:string">b</b>
  </multiRef>
 </soapenv:Body>
</soapenv:Envelope>
----------------------

SOAP Response:
----------------
HTTP/1.1 500 Internal Server Error Content-Type: text/xml; charset=utf-8 Date: Thu, 25 
Sep 2003 09:53:09 GMT Server: Apache Coyote/1.0 Connection: close  <?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>
  <soapenv:Fault>
   <faultcode>soapenv:Server.userException</faultcode>
   <faultstring>org.xml.sax.SAXException: Deserializing parameter &apos;arg1&apos;:  
could not find deserializer for type {urn:StructTest2}MyStruct</faultstring>
   <detail/>
  </soapenv:Fault>
 </soapenv:Body>
</soapenv:Envelope>
---------------------
I have modifyed the deployment descriptor as follows:
--------------------
<deployment xmlns="http://xml.apache.org/axis/wsdd/";
            xmlns:java="http://xml.apache.org/axis/wsdd/providers/java";>

 <service name="StructTest2" provider="java:RPC">
  <parameter name="className" value="StructTest2"/>
  <parameter name="allowedMethods" value="*"/>
  <beanMapping qname="myNS:MyStruct" 
               xmlns:myNS="urn:StructTest2" 
               languageSpecificType="java:MyStruct"/>
  <typeMapping qname="myNS:MyStruct" 
               xmlns:myNS="urn:StructTest2"
               serializer="org.apache.axis.encoding.ser.BeanSerializer" 
               deserializer="org.apache.axis.encoding.ser.BeanDeserializer"/>
 </service>

</deployment>
----------------------- 

but this has given no result either, so I do not know what to do.

I have tried to send MyStruct in the request and receive a single String in the 
response and that is working properly, so I do not understand why / when this error of 
"deserialization" is happening in the server side when the response should return also 
a MyStruct bean. (?)

I really need some guidance here. I guess it has to be some very easy / silly problem 
but, as a beginner with SOAP / Axis, I am blind to it. ...

Thanks a lot in advance for any help.
Best regards,

jose

> 
> Hi Jose,
> 
> Since you have the WSDL file run it through WSDL2Java and 
> just go through
> the *Binding stub. Then you will see how axis sets arguments 
> to the call
> object and register serializers/deserializers. It helped me a lot.
> 
> Regards,
> Dimuthu.
> 
> 
> 
> ----- Original Message -----
> From: Jose Soler
> To: [EMAIL PROTECTED]
> Sent: Wednesday, September 24, 2003 8:26 PM
> Subject: Need help deserializing at the client side
> 
> 
> Hi,
> I am new in Axis and web services and I am facing a problem 
> with the client
> implementation of a webservice that I can not solve.
> 
> I have my own bean as follows:
> -----------------------------------------------
> public class MyStruct {
> private String a;
> private String b;
> 
> public String geta(){return a;}
> public String getb(){return b;}
> public void seta(String na){a=na;}
> public void setb(String nb){b=nb;}
> }
> --------------------------------------------------
> The service is coded as follows:
> 
> //check if a service receives properly a struct passed in a 
> SOAP message.
> //assumed struct with 2 String components
> 
> 
> public class StructTest2
> {
> 
>     public MyStruct serviceMethod(MyStruct s)
>     {
>         String aux="";
>         aux=s.geta();
>         s.seta(s.getb());
>         s.setb(aux);
>         return s;
>     }
> }
> -----------------------------------------
> The WSDL for this service once deployed in Axis apears at the 
> end of this
> mail.
> -------------------------------------------
> The wsdd file contents are the following:
> 
> <deployment xmlns="http://xml.apache.org/axis/wsdd/";
>             
> xmlns:java="http://xml.apache.org/axis/wsdd/providers/java";>
> 
>  <service name="StructTest2" provider="java:RPC">
>   <parameter name="className" value="StructTest2"/>
>   <parameter name="allowedMethods" value="*"/>
>   <beanMapping qname="myNS:MyStruct" xmlns:myNS="urn:StructTest2"
> languageSpecificType="java:MyStruct"/>
>  </service>
> 
> </deployment>
> -----------------------------
> The client has been encoded as follows:
> 
> {
>    public static void main(String [] args) throws Exception {
> 
>        String target = 
> "http://localhost:8080/axis/services/StructTest";;
>        MyStruct request = new MyStruct();
>        MyStruct response;
>        //
>        request.seta(args[0]);
>        request.setb(args[1]);
>        //response.seta("j");
>        //response.setb("j");
>        //
>        Service  service = new Service();
>        Call     call    = (Call) service.createCall();
>        QName  qn  = new QName( "urn:StructTest2", "MyStruct");
>        //
>        String result= "OK: ";
>        try
> 
> 
>         call.registerTypeMapping(MyStruct.class, qn,
>             new
> org.apache.axis.encoding.ser.BeanSerializerFactory(MyStruct.cl
> ass, qn),
>             new
> org.apache.axis.encoding.ser.BeanDeserializerFactory(MyStruct.
> class, qn));
>         call.setTargetEndpointAddress( new java.net.URL(target) );
>         call.setOperationName("serviceMethod");
>         call.addParameter( "arg1", qn, ParameterMode.IN );
>         call.setReturnType(qn, MyStruct.class);
>         response =  (MyStruct) call.invoke( new Object [] {request});
>  System.out.println(result + response.geta() + " " + response.getb());
>  }catch (AxisFault fault){
>    System.out.println("Error: " + fault.toString());
>   }
>    }
> }
> 
> The error I get on executin ( no compilation errors) is the following:
> 
> C:\jose\SOAP\argtests\Struct2>javac StructTest2Client.java
> 
> C:\jose\SOAP\argtests\Struct2>java StructTest2Client works yes
> Error: org.xml.sax.SAXException: Deserializing parameter 
> 'arg1':  could not
> find
>  deserializer for type {urn:StructTest2}MyStruct
> 
> 
> But I have definrd the TypeMapping etc...I am lost.
> Any one can give me a piece of advice?
> 
> Thanks in advance,
> 
> jose
> 
> ----WSDL---
>   <?xml version="1.0" encoding="UTF-8" ?>
> - <wsdl:definitions
> targetNamespace="http://localhost:8080/axis/services/StructTest2";
> xmlns="http://schemas.xmlsoap.org/wsdl/";
> xmlns:apachesoap="http://xml.apache.org/xml-soap";
> xmlns:impl="http://localhost:8080/axis/services/StructTest2";
> xmlns:intf="http://localhost:8080/axis/services/StructTest2";
> xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/";
> xmlns:tns1="urn:StructTest2" 
> xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/";
> xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/";
> xmlns:xsd="http://www.w3.org/2001/XMLSchema";>
> - <wsdl:types>
> - <schema targetNamespace="urn:StructTest2"
> xmlns="http://www.w3.org/2001/XMLSchema";>
>   <import namespace="http://schemas.xmlsoap.org/soap/encoding/"; />
> - <complexType name="MyStruct">
> - <sequence>
>   <element name="a" nillable="true" type="xsd:string" />
>   <element name="b" nillable="true" type="xsd:string" />
>   </sequence>
>   </complexType>
>   </schema>
>   </wsdl:types>
> - <wsdl:message name="serviceMethodRequest">
>   <wsdl:part name="in0" type="tns1:MyStruct" />
>   </wsdl:message>
> - <wsdl:message name="serviceMethodResponse">
>   <wsdl:part name="serviceMethodReturn" type="tns1:MyStruct" />
>   </wsdl:message>
> - <wsdl:portType name="StructTest2">
> - <wsdl:operation name="serviceMethod" parameterOrder="in0">
>   <wsdl:input message="impl:serviceMethodRequest"
> name="serviceMethodRequest" />
>   <wsdl:output message="impl:serviceMethodResponse"
> name="serviceMethodResponse" />
>   </wsdl:operation>
>   </wsdl:portType>
> - <wsdl:binding name="StructTest2SoapBinding" type="impl:StructTest2">
>   <wsdlsoap:binding style="rpc"
> transport="http://schemas.xmlsoap.org/soap/http"; />
> - <wsdl:operation name="serviceMethod">
>   <wsdlsoap:operation soapAction="" />
> - <wsdl:input name="serviceMethodRequest">
>   <wsdlsoap:body 
> encodingStyle="http://schemas.xmlsoap.org/soap/encoding/";
> namespace="http://DefaultNamespace"; use="encoded" />
>   </wsdl:input>
> - <wsdl:output name="serviceMethodResponse">
>   <wsdlsoap:body 
> encodingStyle="http://schemas.xmlsoap.org/soap/encoding/";
> namespace="http://localhost:8080/axis/services/StructTest2"; 
> use="encoded" />
>   </wsdl:output>
>   </wsdl:operation>
>   </wsdl:binding>
> - <wsdl:service name="StructTest2Service">
> - <wsdl:port binding="impl:StructTest2SoapBinding" name="StructTest2">
>   <wsdlsoap:address
> location="http://localhost:8080/axis/services/StructTest2"; />
>   </wsdl:port>
>   </wsdl:service>
>   </wsdl:definitions>
> 
> 
> 

Reply via email to