Quantcast

JAX-WS + JSON question

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

JAX-WS + JSON question

media_fw9999
After some hit and trial I have managed to get the JSON extension for jax-ws from the commons project working.
However it doesnt seem to work for methods that have arguments in their signatures.  The problem seems to be in the binding layer as indicated by the exception below.

I can see the HTTP request go on the wire with the JSON payload, however the service fails to parse this - presumably somewhere in the jaxb layer and a null is passed to the method.

Any ideas ?

/s



ERROR:  'Invalid JSON namespace: http://www.w3.org/2001/XMLSchema-instance'
Sep 6, 2007 3:16:45 PM com.sun.xml.ws.transport.http.servlet.WSServletDelegate d
oGet
SEVERE: caught throwable
javax.xml.ws.WebServiceException: javax.xml.bind.MarshalException
 - with linked exception:
[javax.xml.transform.TransformerException: java.lang.IllegalStateException: Inva
lid JSON namespace: http://www.w3.org/2001/XMLSchema-instance]
        at com.sun.xml.ws.message.jaxb.JAXBMessage.writePayloadTo(JAXBMessage.ja
va:317)
        at org.jvnet.jax_ws_commons.json.JSONCodec.encode(JSONCodec.java:93)
        at com.sun.xml.ws.transport.http.HttpAdapter.encodePacket(HttpAdapter.ja
va:320)
        at com.sun.xml.ws.transport.http.HttpAdapter.access$100(HttpAdapter.java
:93)
        at com.sun.xml.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdap
ter.java:454)
        at com.sun.xml.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:244
)
        at com.sun.xml.ws.transport.http.servlet.ServletAdapter.handle(ServletAd
apter.java:135)
        at com.sun.xml.ws.transport.http.servlet.WSServletDelegate.doGet(WSServl
etDelegate.java:129)
        at com.sun.xml.ws.transport.http.servlet.WSServletDelegate.doPost(WSServ
letDelegate.java:160)
        at com.sun.xml.ws.transport.http.servlet.WSServlet.doPost(WSServlet.java
:75)

 
 

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: JAX-WS + JSON question

Jitendra Kotamraju
Sameer Tyagi wrote:
> After some hit and trial I have managed to get the JSON extension for jax-ws from the commons project working.
> However it doesnt seem to work for methods that have arguments in their signatures.  The problem seems to be in the binding layer as indicated by the exception below.
>
> I can see the HTTP request go on the wire with the JSON payload, however the service fails to parse this - presumably somewhere in the jaxb layer and a null is passed to the method.
>
> Any ideas ?
>  
Looks like a bug to me. SchemaConvention.java has two maps and they
don't seem to have this namespace. Can you file a bug for this.

Jitu

> /s
>
>
>
> ERROR:  'Invalid JSON namespace: http://www.w3.org/2001/XMLSchema-instance'
> Sep 6, 2007 3:16:45 PM com.sun.xml.ws.transport.http.servlet.WSServletDelegate d
> oGet
> SEVERE: caught throwable
> javax.xml.ws.WebServiceException: javax.xml.bind.MarshalException
>  - with linked exception:
> [javax.xml.transform.TransformerException: java.lang.IllegalStateException: Inva
> lid JSON namespace: http://www.w3.org/2001/XMLSchema-instance]
>         at com.sun.xml.ws.message.jaxb.JAXBMessage.writePayloadTo(JAXBMessage.ja
> va:317)
>         at org.jvnet.jax_ws_commons.json.JSONCodec.encode(JSONCodec.java:93)
>         at com.sun.xml.ws.transport.http.HttpAdapter.encodePacket(HttpAdapter.ja
> va:320)
>         at com.sun.xml.ws.transport.http.HttpAdapter.access$100(HttpAdapter.java
> :93)
>         at com.sun.xml.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdap
> ter.java:454)
>         at com.sun.xml.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:244
> )
>         at com.sun.xml.ws.transport.http.servlet.ServletAdapter.handle(ServletAd
> apter.java:135)
>         at com.sun.xml.ws.transport.http.servlet.WSServletDelegate.doGet(WSServl
> etDelegate.java:129)
>         at com.sun.xml.ws.transport.http.servlet.WSServletDelegate.doPost(WSServ
> letDelegate.java:160)
>         at com.sun.xml.ws.transport.http.servlet.WSServlet.doPost(WSServlet.java
> :75)
>
>  
>  
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>  

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Loading...