Martin,
thank you. That was a good advice pointing me to more helpful informations.

All,
in case someone is interested in this problems' solution, I'll describe it
below:

1. transformed my old class MyService into an interface 
2. used Java2WSDL to create a wsdl-file from that interface
3. used WSDL2Java to create all client and server classes from that
wsdl-file
4. moved the logic from my old MyService class to generated class
MySoapBindingImpl

;) Sorry - I guess, I missed out on example six of the user guide...



> ----------
> Von:  Martin Jericho[SMTP:[EMAIL PROTECTED]]
> Antwort an:   [EMAIL PROTECTED]
> Gesendet:     Donnerstag, 18. Juli 2002 02:39
> An:   [EMAIL PROTECTED]
> Betreff:      Re: Bean data not serialized
> 
> I assume the code snippet of the getIt method is from your source
> MyService
> class.
> This class only defines the interface.  Axis will generate a new class
> called MyServiceSoapBindingImpl, which is where you have to implement the
> getIt method.
> By default, the getIt method in the generated MyServiceSoapBindingImpl
> class
> just returns null.
> 
> ----- Original Message -----
> From: "(RV) Buchberger, J�rg" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Thursday, July 18, 2002 12:14 AM
> Subject: Bean data not serialized
> 
> 
> > 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>
> >
> >
> >
> >
> 

Reply via email to