You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by th...@yahoo.com on 2003/09/30 11:05:41 UTC

[Wrapped/Literal] No Deserializer defined for array of xsd:string

Hi

I posted this to the axis-user list yesterday, but I
probably should have posted to axis-dev.

--------------

I am using Axis 1.1 to call a wrapped service.
I have a simple Java class
public class Test
{
 public TestResponse callMethod( String method,
String[] params )
 {
  return( null );
 }
}

The wsdl for this Java class was produced using
org.apache.axis.wsdl.Java2WSDL, the options --style
WRAPPED --use LITERAL specified.
The client stub and server impl were produced using
org.apache.axis.wsdl.WSDL2Java.
When the service is called the following SOAP request
and AXIS fault response are produced :-
 
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
 <soapenv:Body>
  <callMethod xmlns="http://wrapped.test.com">
   <method xmlns="">test</method>
   <params xsi:type="Array"
soapenc:arrayType="xsd:string[0]"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns=""/>
  </callMethod>
 </soapenv:Body>
</soapenv:Envelope>

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
 <soapenv:Body>
  <soapenv:Fault>
   <faultcode>soapenv:Server.userException</faultcode>
   <faultstring>org.xml.sax.SAXException: No
deserializer defined for array type
{http://www.w3.org/2001/XMLSchema}string</faultstring>
   <detail/>
  </soapenv:Fault>
 </soapenv:Body>
</soapenv:Envelope>

Firstly, I am a little confused why when --use LITERAL
is specified to Java2WSDL that the string array is
still SOAP encoded ?. I have seem some debate on this
issue recently.
 
Secondly, the problem I am seeing appears to be caused
by the attribute xsi:type="Array" on the <params>
element. The value "Array" is not indicated to be in
the http://schemas.xmlsoap.org/soap/encoding/"
namespace using the defined "soapenc" prefix.

On further investigation this may be caused by a what
appears to be a bug in the class
org.apache.axis.utils.NStack. The stack believes that
"http://schemas.xmlsoap.org/soap/encoding/" namespace
is the default namespace and hence does not require a
prefix. This only occurs at the point when this
attribute is serialized.
 
I would appreciate your thoughts/advice, Is this a bug
? am I doing something wrong ?
 
Thanks
Steve


__________________________________
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com