users@jax-rpc.java.net

Re: Got "unexpected null value for literal data" exception in WSI compliant web service

From: Merten Schumann <Merten.Schumann_at_asg.com>
Date: Mon, 30 Aug 2004 10:43:09 +0200

Doug,

thank you for this information!

I have to offer an existing API as a web service. The API supports null
values in parameters. So, I think this language feature is a thing you
should/cannot support in web service area.

cu
   Merten

> -----Original Message-----
> From: Doug Kohlert [mailto:Doug.Kohlert_at_Sun.COM]
> Sent: Friday, August 27, 2004 11:30 PM
> To: users_at_jax-rpc.dev.java.net
> Subject: Re: Got "unexpected null value for literal data"
> exception in WSI compliant web service
>
> Merten,
> With just the WSI option you cannot send null values as parameters.
> This is because the default mode is rpc/lit and since
> message parts refer to types instead of elements there is no way to
> specify that a null value is valid.
> If you use the wsi option in combination with -f:documentliteral you
> will be able to send null values as the parts will reference
> nillable elements.
>
> Thank you for using JAXRPC.
>
>
> Merten Schumann wrote:
>
> >Hello,
> >
> >I've created a simple JAX-RPC web service with Sun J2EE 1.4 RI and
> >deployed the .war (including the JAX-RPC .jars from Sun J2EE 1.4) in
> >Tomcat 5.0.27. I tried to create two variants: WSI compliant and not
> >compliant (feature="wsi" to wscompile).
> >
> >There's a method
> > String execute(String msg, String user, String password) throws
> >RemoteException;
> >in the service' interface. In a JAX-RPC client I invoke the
> method with
> > execute("foo", null, null)
> >This works fine in non-WSI compliant version, but with features="wsi"
> >version I do get
> >
> >SEVERE: unexpected null value for literal data
> >unexpected null value for literal data
> >at
> ><my_service>_execute_RequestStruct__WSICompliant__LiteralSeri
> alizer.doDe
> >serialize(
> >
> ><my_service>_execute_RequestStruct__WSICompliant__LiteralSeri
> alizer.java
> >:70)
> >at
> >com.sun.xml.rpc.encoding.literal.LiteralObjectSerializerBase.
> internalDes
> >erialize(LiteralObjectSerializerBase.java:183)
> >at
> >com.sun.xml.rpc.encoding.literal.LiteralObjectSerializerBase.
> deserialize
> >(LiteralObjectSerializerBase.java:95)
> >at
> >de.rochade.srap.ws.RoSrapScriptExecService_Tie.deserialize_ex
> ecute(<my_s
> >ervice>_Tie.java:224)
> >at
> >de.rochade.srap.ws.RoSrapScriptExecService_Tie.readFirstBodyE
> lement(<my_
> >service>_Tie.java:185)
> >at
> >com.sun.xml.rpc.server.StreamingHandler.handle(StreamingHandl
> er.java:158
> >)
> >at
> >com.sun.xml.rpc.server.http.JAXRPCServletDelegate.doPost(JAXR
> PCServletDe
> >legate.java:316)
> >
> >The method works if I call execute("foo", "", "").
> >
> >I do not use method overloading in the service interface, there's not
> >another execute method.
> >
> >My question is, in WSI compliant way, is it not possible to hand over
> >null values to web service methods???
> >
> >Thanx a lot!
> > Merten
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: users-unsubscribe_at_jax-rpc.dev.java.net
> >For additional commands, e-mail: users-help_at_jax-rpc.dev.java.net
> >
> >
> >
> >
>
> --
> -------------------------------
> Doug Kohlert
> Sun MicroSystems, Inc.
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jax-rpc.dev.java.net
> For additional commands, e-mail: users-help_at_jax-rpc.dev.java.net
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_jax-rpc.dev.java.net
For additional commands, e-mail: users-help_at_jax-rpc.dev.java.net