users@jax-rpc.java.net

Re: soapfault

From: Doug Kohlert <Doug.Kohlert_at_Sun.COM>
Date: Thu, 12 Aug 2004 11:24:36 -0700

Daniel,
The faultcode and faultstring must be unqualified. You need to remove
the default namespace declaration xmlns="factum.se/dab".
This is what your message should look like:

<?xml version="1.0" encoding="iso-8859-1"?>
<SOAP-ENV:Envelope xmlns:DAB="factum.se/dab"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Header/>
<SOAP-ENV:Body>
<SOAP-ENV:Fault>
<faultcode> SOAP-ENV:Server </faultcode>
<faultstring> [CDATA[Entry not found.]] </faultstring>
</SOAP-ENV:Fault>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

Thanks

Daniel Hägg wrote:

> Hi,
> I am trying to port a client application from Apache Axis 1.0 to JWSDP
> 1.4. Everything seem to work except handling of soap fault elements. I
> get "deserialization error: XML reader error: unexpected character
> content: "SOAP-ENV:Server"" on my client when the server returns a
> soap fault like this:
>
> <?xml version="1.0" encoding="iso-8859-1"?><SOAP-ENV:Envelope
> xmlns="factum.se/dab" xmlns:DAB="factum.se/dab"
> xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
> <SOAP-ENV:Header/>
> <SOAP-ENV:Body>
> <SOAP-ENV:Fault>
> <SOAP-ENV:faultcode>
> SOAP-ENV:Server
> </SOAP-ENV:faultcode>
> <SOAP-ENV:faultstring>
> [CDATA[Entry not found.]]
> </SOAP-ENV:faultstring>
> </SOAP-ENV:Fault>
> </SOAP-ENV:Body>
> </SOAP-ENV:Envelope>
>
> Is it a bug in JAX-RPC ?
>
> Here is the complete call stack:
>
> java.rmi.RemoteException: Runtime exception; nested exception is:
> deserialization error:
> XML reader error: unexpected character content: "SOAP-ENV:Server" at
> com.sun.xml.rpc.client.StreamingSender._handleRuntimeExceptionInSend(StreamingSender.java:318)
>
> at com.sun.xml.rpc.client.StreamingSender._send(StreamingSender.java:300)
> at clients.DabCtrlApi.ApiPort_Stub.requestCancel(ApiPort_Stub.java:1004)
> at clients.JaxRpcCfg.Frame1.cancelButton_actionPerformed(Frame1.java:250)
> at clients.JaxRpcCfg.Frame1$3.actionPerformed(Frame1.java:93)
> at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
> at
> javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Unknown
> Source)
> at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
> at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
> at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown
> Source)
> at java.awt.Component.processMouseEvent(Unknown Source)
> at java.awt.Component.processEvent(Unknown Source)
> at java.awt.Container.processEvent(Unknown Source)
> at java.awt.Component.dispatchEventImpl(Unknown Source)
> at java.awt.Container.dispatchEventImpl(Unknown Source)
> at java.awt.Component.dispatchEvent(Unknown Source)
> at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
> at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
> at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
> at java.awt.Container.dispatchEventImpl(Unknown Source)
> at java.awt.Window.dispatchEventImpl(Unknown Source)
> at java.awt.Component.dispatchEvent(Unknown Source)
> at java.awt.EventQueue.dispatchEvent(Unknown Source)
> at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
> at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
> at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
> at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
> at java.awt.EventDispatchThread.run(Unknown Source)
> Caused by: deserialization error: XML reader error: unexpected
> character content: "SOAP-ENV:Server"
> at
> com.sun.xml.rpc.encoding.ObjectSerializerBase.deserialize(ObjectSerializerBase.java:233)
>
> at
> com.sun.xml.rpc.client.StreamingSender._readBodyFaultElement(StreamingSender.java:447)
>
> at com.sun.xml.rpc.client.StreamingSender._send(StreamingSender.java:208)
> ... 26 more
>
> On the suggestion from "dkohlert" in the webservice forum at
> java.sun.com I have modified the soap fault (changing the server) so
> that faultcode and faultstring isn't namespace qulified. But that did
> not help (and I don't understand why it should).
>
> Any other ideas?
>

-- 
-------------------------------
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