|
Re: Found character data inside an array element while deserializing [message #161205 is a reply to message #161157] |
Mon, 20 February 2006 15:30 |
Ben Sisson Messages: 202 Registered: July 2009 |
Senior Member |
|
|
A little more information: the WSDL defines the output as a base64Binary.
This then translates to a byte[] in the method. When I look in the
SoapStud file this is how the method is defined:
oper = new org.apache.axis.description.OperationDesc();
oper.setName("Lib_FetchItemByID");
oper.addParameter(new javax.xml.namespace.QName("http://tempuri.org/",
"client_id"), new
javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "int"),
int.class, org.apache.axis.description.ParameterDesc.IN, false, false);
oper.addParameter(new javax.xml.namespace.QName("http://tempuri.org/",
"item_id"), new
javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "int"),
int.class, org.apache.axis.description.ParameterDesc.IN, false, false);
oper.setReturnType(new
javax.xml.namespace.QName("http://schemas.xmlsoap.org/soap/encoding/",
"base64"));
oper.setReturnClass(byte[].class);
oper.setReturnQName(new javax.xml.namespace.QName ("http://tempuri.org/",
"Lib_FetchItemByIDResult"));
oper.setStyle(org.apache.axis.constants.Style.WRAPPED);
oper.setUse(org.apache.axis.constants.Use.LITERAL);
_operations[6] = oper;
There is also a method defined in the Web Services that the WSDL has
defined as an input parameter base64Binary, that is used to send data to
be stored. This method that I'm having trouble with retrieves the same
data. The method that sends the data I have no problems with. I take my
String data, perform a getbytes() and save the data into a byte[]. I pass
that from the client to the Web Service and have no problem.
So, when I try to retrieve the same data, I just copy the string, perform
a getbytes(), and return it as a byte[]. The data is in the same format
at this point that it was received. That is when I get the
org.xml.sax.SAXException: Found character data inside an array element
while deserializing Error message. The whole message appears as follows
(it appears to be an issue with Axis):
org.xml.sax.SAXException: Found character data inside an array element
while deserializing
at
org.apache.axis.encoding.ser.ArrayDeserializer.characters(Ar rayDeserializer.java:502)
at
org.apache.axis.encoding.DeserializationContext.characters(D eserializationContext.java:966)
at
org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRe corder.java:177)
at
org.apache.axis.message.MessageElement.publishToHandler(Mess ageElement.java:1141)
at org.apache.axis.message.RPCElement.deserialize(RPCElement.ja va:236)
at org.apache.axis.message.RPCElement.getParams(RPCElement.java :384)
at org.apache.axis.client.Call.invoke(Call.java:2448)
at org.apache.axis.client.Call.invoke(Call.java:2347)
at org.apache.axis.client.Call.invoke(Call.java:1804)
at
org.tempuri.Library_Support_ServicesSoapStub.lib_FetchItemBy ID(Library_Support_ServicesSoapStub.java:381)
at
org.bass.client.library.support.services.librarySupportServi cesPanel$3.actionPerformed(librarySupportServicesPanel.java: 365)
at
javax.swing.AbstractButton.fireActionPerformed(AbstractButto n.java:1849)
at
javax.swing.AbstractButton$Handler.actionPerformed(AbstractB utton.java:2169)
at
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultBu ttonModel.java:420)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel .java:258)
at
javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Bas icButtonListener.java:234)
at java.awt.Component.processMouseEvent(Component.java:5488)
at javax.swing.JComponent.processMouseEvent(JComponent.java:312 6)
at java.awt.Component.processEvent(Component.java:5253)
at java.awt.Container.processEvent(Container.java:1966)
at java.awt.Component.dispatchEventImpl(Component.java:3955)
at java.awt.Container.dispatchEventImpl(Container.java:2024)
at java.awt.Component.dispatchEvent(Component.java:3803)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container. java:4212)
at java.awt.LightweightDispatcher.processMouseEvent(Container.j ava:3892)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java: 3822)
at java.awt.Container.dispatchEventImpl(Container.java:2010)
at java.awt.Window.dispatchEventImpl(Window.java:1774)
at java.awt.Component.dispatchEvent(Component.java:3803)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
at
java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventD ispatchThread.java:242)
at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDis patchThread.java:163)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread. java:157)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread. java:149)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:11 0)
>>I have a Java client, creted from a WSDL using the WSDL2JAVA plugin, that
>>calls a Web Service. The return value of the Web Service is a byte[]. The
>>client makes the call, and through the debug I see that the byte array is
>>populated correctly. However, somewhere between the return at the Web
>>Service and the client I receive the following error message.
>>org.xml.sax.SAXException: Found character data inside an array element
>>while deserializing
>>Can someone help?
>>Thanks,
>>Ben
|
|
|
|
Re: Found character data inside an array element while deserializing [message #838610 is a reply to message #161157] |
Sat, 07 April 2012 10:23 |
abhinav ladani Messages: 2 Registered: April 2012 |
Junior Member |
|
|
Hi to all,
I generated webservice using eclipse using axis i have methods which is returning String arrays ex.. public String [] getName();, public String[][]getList();
My steps,
I right cleck on class and than create webservice using wizard i used document/literal wrapped wsdl style and i than complete the wizard i created webservice successfully.
than i generate client using wsdl than call this public String[][]getList() && method public String [] getName(); it works fine.
but the problem is when i just stopped the server and restart it again
than i call above method client
public String [] getName(); working fine.
public String[][]getList(); Not Working.
Its giving me
SEVERE: Exception:
org.xml.sax.SAXException: Found character data inside an array element while
Any one can help me please.
Sincerely,
Abhinav Ladani.
[Updated on: Sat, 07 April 2012 10:24] Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.03503 seconds