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 Fabrício <fa...@de9.ime.eb.br> on 2005/09/05 15:43:41 UTC

Another issue

Hello all,

 

As I said in previous messages, I want to create a web service that could
receive any types and dynamically extracts the contents of those types.
Thus, I saw in java Object a solution for my problem. Hence, I created the
web service that receives and returns the java Object:

 

public Object myMethod(Object o) throws Exception{

            …

}

 

Now, my problem is: How can I create, in WSDD and in the client, the Mapping
to serialize my object, once I don’t know specifically what type I’m
receiving and returning?

 

Some times I can receive a bean for a person (name, age, weight), other
times I can receive a bean about address (street, state, country), or a bean
about cars (color, model, vendor)… I don’t know previously the type that my
web service will receives. If I knew I could mount my WSDD with no problems
(passing the specific beanMapping) and in my client too (mounting my
call.registerTypeMapping(specif class information and (De)
BeanSerializerFactory).

 

My doubt is how I must construct my WSDD and my client to make my web
service works. Or anyone could see another solution for my problem? Instead
of java Objects. Or this is an unreachable web service?

 

Thanks a lot for any help,

 

Fabrício.


Re: Another issue

Posted by jayachandra <ja...@gmail.com>.
Alternately, you could code your own Serializer/Deserializer taking help 
from existing SimpleSerializer and Deserializer Factories that are present 
in org.apache.axis.encoding.ser package and later use <typeMapping ...> in 
your WSDD.
 For more information take a look at 
http://ws.apache.org/axis/java/user-guide.html#WhenBeansAreNotEnoughCustomSerialization
 Regards
Jayachandra
 On 9/5/05, Jeff Greif <jg...@alumni.princeton.edu> wrote: 
> 
> Look into message-style services (see the Axis user guide, Service Styles
> section, and the Wiki). A few signatures are possible, and one of these
> might be what you're looking for:
> Element[] your-method-name(Element[] requestBodyElements);
> Document your-method-name(Document requestBody);
> 
> The client calling the service would supply DOM Elements or Documents. The
> server would determine the type of document in order to decide what to
> return. The client would know what to do with whatever XML is returned.
> 
> Jeff
> ----- Original Message -----
> From: Fabrício
> To: axis-user@ws.apache.org
> Sent: Monday, September 05, 2005 6:43 AM
> Subject: Another issue
> 
> 
> Hello all,
> 
> As I said in previous messages, I want to create a web service that could
> receive any types and dynamically extracts the contents of those types.
> Thus, I saw in java Object a solution for my problem. Hence, I created the
> web service that receives and returns the java Object:
> 
> public Object myMethod(Object o) throws Exception{
> .
> }
> 
> Now, my problem is: How can I create, in WSDD and in the client, the 
> Mapping
> to serialize my object, once I don't know specifically what type I'm
> receiving and returning?
> 
> Some times I can receive a bean for a person (name, age, weight), other
> times I can receive a bean about address (street, state, country), or a 
> bean
> about cars (color, model, vendor). I don't know previously the type that 
> my
> web service will receives. If I knew I could mount my WSDD with no 
> problems
> (passing the specific beanMapping) and in my client too (mounting my
> call.registerTypeMapping(specif class information and (De)
> BeanSerializerFactory).
> 
> My doubt is how I must construct my WSDD and my client to make my web
> service works. Or anyone could see another solution for my problem? 
> Instead
> of java Objects. Or this is an unreachable web service?
> 
> Thanks a lot for any help,
> 
> Fabrício.
> 
> 
> 


-- 
-- Jaya

Re: Another issue

Posted by Jeff Greif <jg...@alumni.princeton.edu>.
Look into message-style services (see the Axis user guide, Service Styles 
section,  and the Wiki).  A few signatures are possible, and one of these 
might be what you're looking for:
  Element[] your-method-name(Element[] requestBodyElements);
  Document your-method-name(Document requestBody);

The client calling the service would supply DOM Elements or Documents.  The 
server would determine the type of document in order to decide what to 
return.  The client would know what to do with whatever XML is returned.

Jeff
----- Original Message ----- 
From: Fabrício
To: axis-user@ws.apache.org
Sent: Monday, September 05, 2005 6:43 AM
Subject: Another issue


Hello all,

As I said in previous messages, I want to create a web service that could 
receive any types and dynamically extracts the contents of those types. 
Thus, I saw in java Object a solution for my problem. Hence, I created the 
web service that receives and returns the java Object:

public Object myMethod(Object o) throws Exception{
            .
}

Now, my problem is: How can I create, in WSDD and in the client, the Mapping 
to serialize my object, once I don't know specifically what type I'm 
receiving and returning?

Some times I can receive a bean for a person (name, age, weight), other 
times I can receive a bean about address (street, state, country), or a bean 
about cars (color, model, vendor). I don't know previously the type that my 
web service will receives. If I knew I could mount my WSDD with no problems 
(passing the specific beanMapping) and in my client too (mounting my 
call.registerTypeMapping(specif class information and (De) 
BeanSerializerFactory).

My doubt is how I must construct my WSDD and my client to make my web 
service works. Or anyone could see another solution for my problem? Instead 
of java Objects. Or this is an unreachable web service?

Thanks a lot for any help,

Fabrício.