Hello John and Axis-Users,

I created a web service that receive and returns a Java Object.

--> public Object myMethod(Object o) throws Exception{

I noticed in the WSDL that Axis specified an AnyType object received and
returned by this web service. Now, I don't know how I must specify in my
WSDD the specific element to make Axis knows how to serialize my object.

When I did a web service to receives a java bean I put it in my WSDD and
works fine:

   <beanMapping qname="myNS:myBean"
     xmlns:myNS="urn:Filter"
     languageSpecificType="java:package.myBean" />

and in my cliente I put it:

QName qnMyBean = new QName("urn:myService", "myBean");

call.registerTypeMapping(
        myBean.class, qnMyBean,
        new org.apache.axis.encoding.ser.BeanSerializerFactory
        (myBean.class, qnMyBean), 
        new org.apache.axis.encoding.ser.BeanDeserializerFactory
        (myBean.class, qnMyBean));

My current situation is:

I have a web service that is receiving and returning a java Object, as I
said before. And I have a client that calls this web service passing a java
Bean and must receive a Vector, both as Object.

In my WSDD for this web service I only put the <beanMapping... about the
bean that I will send. And in my client I put the same
"call.registerTypeMapping" that I used in another client (showed above). But
didn't work. I'm receiving the error:

Erro: ; nested exception is: 
        org.xml.sax.SAXParseException: Premature end of file.


So, I would like to know how I must construct my WSDD and my client
appropriately to make this web service works fine. 


Thanks again for all helps,

Fabrício.



-----Mensagem original-----
De: John Delaney [mailto:[EMAIL PROTECTED] 
Enviada em: quarta-feira, 31 de agosto de 2005 22:43
Para: [email protected]
Assunto: Re: Is it possible?

Fabricio

It is entirely possible. You have to make sure that you define the
interface properly on both sides. Use the xsd:AnyType to describe you
java object. The only things that doesn't work completely are the
signatures of the methods in your web service, get used to giving each
method a unique name.

JWD

>>> [EMAIL PROTECTED] 09/01/05 04:13 AM >>>
Hello all,

Is it possible to create a web service that receives and returns a
generic java
object (Object)? And dynamically discover how to manipulate the
atributes of
it?

Maybe this is a fool question... Sorry and thanks!

Fabricio

----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.


-- 
No virus found in this incoming message.
Checked by AVG Anti-Virus.
Version: 7.0.344 / Virus Database: 267.10.18/87 - Release Date: 1/9/2005


Reply via email to