-----Original Message-----
From: Patrick van Kann [mailto:[EMAIL PROTECTED]
Sent: Wednesday, 30 March 2005 10:27 PM
To: [email protected]
Subject: Is there a bug with Axis webservice methods returning arrays?I posted a question yesterday about a problem I had with a webmethod returning an array i.e:
public TestData[] getTestsAsArray()
I thought it was to do with the fact that I was using Castor serializers/deserializers.
However, I have re-tested it with the standard Axis Bean serializers and generated data classes and get exactly the same error - which I believe is because the soap message returned is not valid xml (see below).
[java] Exception caught org.xml.sax.SAXParseException: Element type "ns1:te
stData" must be followed by either attribute specifications, ">" or "/>".
[java] AxisFault
So is there a general Axis problem with returning typed arrays in a document/wrapped webservice? I noticed on this wiki page that such a problem has existed before:
http://wiki.apache.org/ws/DotNetInteropArrays
Unfortunately no bugzilla id is mentioned so I can't be sure. I'd really appreciate some insight as at the moment I am compelled to wrap my arrays in another complex type (i.e. TestDataArrayWrapper) and return this from the webservice instead. This seems to work but it does seem a little clunky.
The SOAP message returned is below.
<?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>
<getTestsAsArrayResponse
xmlns="http://www.fortune-cookie.com/schemas/services/timesheet/wsdl">
<ns1:testData[,unbounded]
xmlns:ns1="http://www.fortune-cookie.com/schemas/services/timesheet/data">
<name xmlns="">test1</name>
</ns1:testData[,unbounded]>
</getTestsAsArrayResponse>
</soapenv:Body>
</soapenv:Envelope>
It is the [,unbounded] part that seems to be causing the problem.
Thanks in advance,
Patrick
Title: Is there a bug with Axis webservice methods returning arrays?
I had
a similar problem when testing WRAPPED style.
I wish
I could present more accurate information than "I have noticed the same
thing"
I was
experimenting with the WSDL2Java and Java2WSDL using RPC and WRAPPED styles
on a sample service code.
I
was testing returning a Bean array type, using
wrapped
Book[] getBooks ( int id )
When my AxisServer engine returned the SOAP message, the Axis client
throw an exception about missing something, I have forgotten the message
and
did
not keep a record.
I went
back to using RPC style
I
would prefer to use WRAPPED style.
========================================================================
I
wrote a simple Java interface and implementation class called BookService and
BookServiceStub.
Java2WSDL created the WSDL
WSDL2Java created the Axis client code
java
org.apache.axis.wsdl.Java2WSDL
-l "http://url"
-o BookService.wsdl -b
BookServiceBinding
-S
BookServiceService
-s
BookServicePort
-P
BookServicePortType
-y RPC
-u ENCODED
-T 1.1
-A
OPERATION
-i
BookServiceStub
BookService
============================================================================
- RE: Is there a bug with Axis webservice methods returning... Alick Buckley
- Re: Is there a bug with Axis webservice methods retu... James Black
- RE: Is there a bug with Axis webservice methods retu... Patrick van Kann
