users@jax-rpc.java.net

Re: Using JAX-RPC in place of Apache SOAP

From: Rahul Sharma <rahul.sharma_at_Sun.COM>
Date: Sat, 16 Feb 2002 06:05:52 -0800

Simon Horrell wrote:

> On this note....
> Seems to me that whenever the JAX-RPC spec talks about what types will/won't
> map it references section 5.1 as the arbitrator. What about if there are
> custom type mappings in place? Would it not be more accurate to say that
> generated JAX-RPC [un]marshalling code can deal with any type that has a
> type mapping contained in its in-scope type registry. This type mapping may
> be for a supported type or may be a custom type mapping.


   Yes. This is another good way to describe the type mapping
   support in JAX-RPC spec.

   Regards,

   Rahul Sharma


> ----- Original Message -----
> From: "Arun Gupta" <arun.gupta_at_SUN.COM>
> To: <JAXRPC-INTEREST_at_JAVA.SUN.COM>
> Sent: Tuesday, February 12, 2002 6:05 PM
> Subject: Re: Using JAX-RPC in place of Apache SOAP
>
>
>
>>Hi Peter,
>>
>>The only Java classes that are supported are as given in section 5.1.3
>>of the spec. They are:
>>
>>- java.lang.String
>>- java.util.Date
>>- java.math.BigInteger
>>- java.math.BigDecimal
>>
>>java.util.Calendar is also supported. Beyond this, classes written using
>>Javabeans design pattern as described in section 5.3.5 are also
>>supported.
>>
>>For any other type of classes (e.g. Hashtable), you'll have to write
>>your own pluggable serializers/deserializers.
>>
>>call.invoke() is purposely return java.lang.Object. You need to cast it
>>to the actual object type returned by your method. For instance, if your
>>method signature is like:
>>
>>String sayHello() throws RemoteException;
>>
>>then your call will look like:
>>
>>String returnValue = (String)call.invoke(...);
>>
>>You may consider either changing your Hashtable class into a Javabean or
>>writing your own pluggable serializer/deserializer for Hashtable.
>>
>>Hope I clarified your doubts.
>>
>>Thanks for your interest in JAX-RPC.
>>
>>Regards,
>>-Arun
>>
>>"Peter C. Tribble" wrote:
>>
>>>I have an application suite that uses Apache SOAP to talk to arbitrary
>>>servers. As an exercise, I tried to replace the Apache SOAP layer with
>>>JAX-RPC.
>>>
>>>This has been less than fully successful. What I'm trying to do loks
>>>
> like
>
>>>this:
>>>
>>>EmbreoPublicRequest(EmbreoParams mysettings, String service, String
>>>
> method,
>
>>>Vector args)
>>>
>>>The idea is to call an arbitrary method associated with an arbitrary
>>>
> service
>
>>>with an arbitrary set of arguments; the actual URL of the endpoint is
>>>buried in the mysettings structure.
>>>
>>>The key here is that everything is arbitrary, so that I can't use static
>>>stubs. I've been trying to follow the example HelloClient in the DII
>>>section of the docs.
>>>
>>>I've managed to get to the point where I can successfuly set up and make
>>>
> a
>
>>>call to a server, and I'm pretty sure the call is getting through and
>>>generating the correct response.
>>>
>>>The problem is handling what comes back. In Apache SOAP I do:
>>>
>>> Response response = call.invoke(...,...);
>>>
>>>and the Response gets filled in with the return value(s) and status
>>>information. I can then use the getReturnValue() and getParams() methods
>>>to get at the result(s) of the call, and generatedFault() and getFault()
>>>methods to see if it failed and why. [In particular, I can actually
>>>look at the errors to work out why the request failed in some cases
>>>and respond appropriately.]
>>>
>>>There are two problems that are still causing problems. The first is
>>>
> that
>
>>>for any non-trivial call, I get deserialization errors. This may be
>>>related to the next problem.
>>>
>>>In JAX-RPC, the result of call.invoke() appears to be a simple Object.
>>>Most of my methods return multiple results (generally, a Hashtable or
>>>a Vector). How do I access these results?
>>>
>>>Ultimately, the question is: can I do what I'm trying to do with
>>>
> JAX-RPC?
>
>>>And if so, how? Is JAX-RPC the right thing I should be using? Can I
>>>
> analyze
>
>>>the entire returned response the way I can with Apache SOAP?
>>>
>>>Sorry to be so vague, but what I'm trying to do is to be completely
>>>
> generic.
>
>>>-Peter Tribble
>>>HGMP Computing Services
>>>http://www.hgmp.mrc.ac.uk/~ptribble/
>>>
>>--
>>=============================================
>>There is only one me, I must live myself!
>>There is only one today, I must live itself!
>>=============================================
>>http://members.tripod.com/~apgupta/index.html
>>=============================================
>>