Hi,

I developped a WS with IBM tools and used the wsdl in Visual Studio
2003 to add a Web Reference in my client.

I have no problems with methods returning a simple type (ex. boolean)
or complexType (ex. AccountInfo (a class defined by myself)).

Though I got en empty object, when I am calling a method returning an
array of complex type (AccountInfo). I checked the SOAP message and
it contains all the informations.

In the wsdl the array is defined by an unbouned element:
<complexType name="AccountInfo">
<sequence>
<element name="number" type="xsd:long"/>
<element name="owner" nillable="true"
type="xsd:string"/>
<element name="label" nillable="true"
type="xsd:string"/>
<element name="rubrique" nillable="true"
type="xsd:string"/>
<element name="balance" type="xsd:long"/>
<element name="currencyIso" nillable="true"
type="xsd:string"/>
<element name="availableAmount"
type="xsd:long"/>
</sequence>
</complexType>
<element name="getAccountsResponse">
<complexType>
<sequence>
<element maxOccurs="unbounded"
name="getAccountsReturn" type="impl:AccountInfo"/>
</sequence>
</complexType>
</element>

Did someone return successfully an array (of simple or complex) type
in a ws method call?

:-)
Anne C.


Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com

Re: Problem with WS method returning an array of complex type by Mickey

Mickey
Tue May 25 11:44:55 CDT 2004

What does the response look like on the wire? Can you change the web service
to doc/literal? I've seen some rpc/encoded web services written so that the
arrays are returned naked - instead of this:
<foos>
<foo/>
<foo/>
<foo/>
</foos>

You get:
<foo/>
<foo/>
<foo/>


--
Mickey Williams
Author, "Microsoft Visual C# .NET Core Reference", MS Press
www.servergeek.com/blogs/mickey



"isbjoern04" <isbjoern04@sol-dot-dk.no-spam.invalid> wrote in message
news:40b364ee_2@Usenet.com...
> Hi,
>
> I developped a WS with IBM tools and used the wsdl in Visual Studio
> 2003 to add a Web Reference in my client.
>
> I have no problems with methods returning a simple type (ex. boolean)
> or complexType (ex. AccountInfo (a class defined by myself)).
>
> Though I got en empty object, when I am calling a method returning an
> array of complex type (AccountInfo). I checked the SOAP message and
> it contains all the informations.
>
> In the wsdl the array is defined by an unbouned element:
> <complexType name="AccountInfo">
> <sequence>
> <element name="number" type="xsd:long"/>
> <element name="owner" nillable="true"
> type="xsd:string"/>
> <element name="label" nillable="true"
> type="xsd:string"/>
> <element name="rubrique" nillable="true"
> type="xsd:string"/>
> <element name="balance" type="xsd:long"/>
> <element name="currencyIso" nillable="true"
> type="xsd:string"/>
> <element name="availableAmount"
> type="xsd:long"/>
> </sequence>
> </complexType>
> <element name="getAccountsResponse">
> <complexType>
> <sequence>
> <element maxOccurs="unbounded"
> name="getAccountsReturn" type="impl:AccountInfo"/>
> </sequence>
> </complexType>
> </element>
>
> Did someone return successfully an array (of simple or complex) type
> in a ws method call?
>
> :-)
> Anne C.
>
>
> Posted Via Usenet.com Premium Usenet Newsgroup Services
> ----------------------------------------------------------
> ** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
> ----------------------------------------------------------
> http://www.usenet.com



re:Problem with WS method returning an array of complex type by isbjoern04

isbjoern04
Wed May 26 09:28:21 CDT 2004

Hi,

It is already in doc/literal.

The repsonse looks like this:

HTTP/1.1 200 OK
Server: WebSphere Application Server/5.0
Content-Type: text/xml; charset=utf-8
Content-Language: fr-CH
Connection: close

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<getAccountsResponse xmlns="NameSpaceName">
<ns-269198536:AccountInfo
xmlns:ns-269198536="NameSpaceName">
<ns-269198536:number>5566</ns-269198536:number>
<ns-269198536:owner>BQUE PIGUET CIE YVERDON
</ns-269198536:owner>
<ns-269198536:label>VOSTRO</ns-269198536:label>
<ns-269198536:rubrique/>
<ns-269198536:balance>15577899</ns-269198536:balance>
<ns-269198536:currencyIso>USD</ns-269198536:currencyIso><ns-269198536:availableAmount>15577899</ns-269198536:availableAmount></ns-269198536:AccountInfo>
<ns-269198536:AccountInfo xmlns:ns-269198536="NameSpaceName">
<ns-269198536:number>9575751</ns-269198536:number><ns-269198536:owner>MUSIO
MICHELE </ns-269198536:owner>
<ns-269198536:label>BCV RAPID</ns-269198536:label>
<ns-269198536:rubrique/>
<ns-269198536:balance>428346</ns-269198536:balance>
<ns-269198536:currencyIso>CHF</ns-269198536:currencyIso>
<ns-269198536:availableAmount>428346</ns-269198536:availableAmount></ns-269198536:AccountInfo>
</getAccountsResponse>
</soapenv:Body>
</soapenv:Envelope>

------
Anne C.


Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com