axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Heitzso <heit...@bellsouth.net>
Subject Re: Bean data not serialized
Date Wed, 17 Jul 2002 14:21:50 GMT
Please post your code for the 'SimpleItem' bean itself.  
I'm guessing you don't have getters/setters required by bean
serializer/deserializer in your bean.

==========================================

On Wed, 2002-07-17 at 10:14, (RV) Buchberger, Jörg wrote:
> Hi all.
> 
> I'm new to this. So, probably I missed out on something.
> After following thru the userguide examples I tried to send a Bean via Axis
> SOAP.
> 
> No exceptions, no AxisFault.
> The Application runs and requests,
> the Service returns a BeanObject,
> Axis seems to serialize the Bean,
> soap envelope is sent (seems to be empty),
> Axis seems to deserialize the Bean,
> the client app receives a Bean of the type requested,
> but ==> without data <== .
> 
> Any ideas? 
> Note: code snippets and other info about my setup and the messages are at
> the end of this posting.
> 
> Any help is greatly appreciated.
> Best regards.
> Joerg Buchberger
> 
> 
> p.s. info on my setup:
> 
> -----------------------------
> MyService-method and -output:
> -----------------------------
> 
> public SimpleObject getIt()
> {
>     int id = this.getSomeId();
>     String name = this.getName(id);
>     SimpleItem anItem = new SimpleItem(id, name);
> 
> System.out.println(anItem.getId()+""+anItem.getName());
> 
>     return anItem;
> 
> } // END getIt
> 
> 
> stdout:
> -------
> 77 FooBar
> 
> 
> -----------------------------------
> Clientside code snippet and output:
> -----------------------------------
> 
> <snippet>
> String url = host+port+"/axis/services/MyService";
> 
> Service  service = new Service();
> Call     call    = (Call) service.createCall();
> 
> QName qn = new QName("urn:BeanService", "SimpleObject");
> call.registerTypeMapping(SimpleObject.class, qn,
>   new BeanSerializerFactory(SimpleObject.class, qn),
>   new BeanDeserializerFactory(SimpleObject.class, qn));
> 
> call.setTargetEndpointAddress( new java.net.URL(url) );
> call.setOperationName(new QName("getIt") );
> 
> anItem = (SimpleObject) call.invoke(new Object[] {});
> 
> System.out.println(anItem.getId()+" "+anItem.getName());
> </snippet>
> 
> 
> stdout:
> -------
> 0 null
> 
> 
> 
> -------------------------
> AdminClient list snippet:
> -------------------------
> 
> <service name="MyService" provider="java:RPC">
>   <parameter name="allowedMethods" value="*"/>
>   <parameter
>      name="className"
>      value="my.packg.ws.MyService"/>
>   <parameter name="sendXsiTypes" value="true"/>
>   <parameter name="sendMultiRefs" value="true"/>
>   <parameter name="sendXMLDeclaration" value="true"/>
>   <beanMapping
>      languageSpecificType="java:my.packg.SimpleObject"
>      qname="ns1:SimpleObject"
>      xmlns:ns1="urn:BeanService"/>
> </service>
> 
> 
> ------------
> TCP-Monitor:
> ------------
> 
> Note: I abbreviated the long lines.
> 
> ==== Request ====
> 
> POST /axis/services/TreeService HTTP/1.0
> Host: localhost
> Content-Type: text/xml; charset=utf-8
> SOAPAction: ""
> Content-Length: 409
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <soapenv:Envelope
>    soapenv:encodingStyle="http://schemas..."
>    xmlns:soapenv="http://schemas.xmlsoap..."
>    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>    xmlns:xsi="http://www.w3.org/2001/XMLSchema-i..."
>    xmlns:SOAP-ENC="http://schemas.xmlsoap...">
>  <soapenv:Body>
>   <GetRootItem/>
>  </soapenv:Body>
> </soapenv:Envelope>
> 
> ==== Response ====
> 
> HTTP/1.1 200 OK
> Content-Type: text/xml; charset=utf-8
> Date: Wed, 17 Jul 2002 13:08:03 GMT
> Server: Apache Tomcat/4.0.4 (HTTP/1.1 Connector)
> Connection: close
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <soapenv:Envelope
>    xmlns:soapenv="http://schemas.xmlsoap.org/soap..."
>    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>    xmlns:xsi="http://www.w3.org/2001/XMLSchema-i...">
>   <soapenv:Body>
>     <getItResponse soapenv:encodingStyle="http://...">
>       <getItReturn href="#id0"/>
>     </getItResponse>
>     <multiRef
>       id="id0"
>       soapenc:root="0"
>       soapenv:encodingStyle="http://schemas..."
>       xsi:type="ns1:SimpleObject"
>       xmlns:soapenc="http://schemas.xmlsoap.org..."
>       xmlns:ns1="urn:BeanService"/>
>   </soapenv:Body>
> </soapenv:Envelope>
> 



Mime
View raw message