By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,615 Members | 1,961 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,615 IT Pros & Developers. It's quick & easy.

problem reading an array returned from a service

P: n/a
Using .NET 1.1 I trying to consume a web service that returns an integer and
an array of type string which I declare and use line this

Dim Results() As String
Me.txtMain.Text = consumeWebService.GetPublishedDatabases("1.0",
Results).ToString

The problem is that the array "Results" is always 'Nothing' - that is it
never gets filled with the value being returned. In looking at the SOAP
traffic with SOAPscope the service is returning what I expect. I just can not
get it into my array. I suspect that it has something to do with the way I am
creating the array but am at a loss as to what I should be doing.

In addition to the SOAP message I have included the relevant parts of the
WSDL below.

Can anyone help?

Thanks,

Matthew
-- Pseudocode returned ---
Count = 2,
Array List
{
[write = no]
[read = yes]
Item[0] = Copy of MIMH,
[write = no]
[read = yes]
Item[1] = MIMH
}

In the actuall XML the following is returned.

- + <SOAP-ENV:Envelope
xmlns:SOAPSDK1="http://www.w3.org/2001/XMLSchema"
xmlns:SOAPSDK2="http://www.w3.org/2001/XMLSchema-instance"
xmlns:SOAPSDK3="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
- + <SOAP-ENV:Body SOAP-ENV:encodingStyle="">
- + <SOAPSDK4:GetPublishedDatabasesResults
xmlns:SOAPSDK4="urn:RSSoap1.0">
- + <SOAPSDK4:Count>2</SOAPSDK4:Count>
- + <SOAPSDK4:List SOAPSDK2:type="SOAPSDK3:Array"
SOAPSDK3:arrayType="SOAPSDK1:string[2]">
- + <SOAPSDK4:Item write="no" read="yes">Copy of
MIMH</SOAPSDK4:Item>
- + <SOAPSDK4:Item write="no" read="yes">MIMH</SOAPSDK4:Item>
</SOAPSDK4:List>
</SOAPSDK4:GetPublishedDatabasesResults>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

The WSDL relevant to this is

<types>
<xs:schema targetNamespace="http://localhost/cgi-bin/RSService/">
<!-- definition of elements -->
<!-- xs definition: List - complexType:Array -->
<xs:complexType name="List">
<xs:complexContent mixed="false">
<xs:restriction base="soapenc:Array">
<xs:attribute ref="soapenc:arrayType" ws:arrayType="xs:string[]"
xmlns:ws="http://schemas.xmlsoap.org/wsdl/"/>
</xs:restriction>
</xs:complexContent>
</xs:complexType>
</xs:schema>
</types>
....
<operation name="GetPublishedDatabases">
<soap:operation soapAction="GetPublishedDatabases"/>
<input>
<soap:body use="encoded" namespace="urn:RSSoap"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</input>
<output>
<soap:body use="encoded" namespace="urn:RSSoap"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</output>
</operation>


Mar 14 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
have you try just for testing to declare your array as follow :

Dim Results(100) As String

serge
"Matthew" wrote:
Using .NET 1.1 I trying to consume a web service that returns an integer and
an array of type string which I declare and use line this

Dim Results() As String
Me.txtMain.Text = consumeWebService.GetPublishedDatabases("1.0",
Results).ToString

The problem is that the array "Results" is always 'Nothing' - that is it
never gets filled with the value being returned. In looking at the SOAP
traffic with SOAPscope the service is returning what I expect. I just can not
get it into my array. I suspect that it has something to do with the way I am
creating the array but am at a loss as to what I should be doing.

In addition to the SOAP message I have included the relevant parts of the
WSDL below.

Can anyone help?

Thanks,

Matthew
-- Pseudocode returned ---
Count = 2,
Array List
{
[write = no]
[read = yes]
Item[0] = Copy of MIMH,
[write = no]
[read = yes]
Item[1] = MIMH
}

In the actuall XML the following is returned.

- + <SOAP-ENV:Envelope
xmlns:SOAPSDK1="http://www.w3.org/2001/XMLSchema"
xmlns:SOAPSDK2="http://www.w3.org/2001/XMLSchema-instance"
xmlns:SOAPSDK3="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
- + <SOAP-ENV:Body SOAP-ENV:encodingStyle="">
- + <SOAPSDK4:GetPublishedDatabasesResults
xmlns:SOAPSDK4="urn:RSSoap1.0">
- + <SOAPSDK4:Count>2</SOAPSDK4:Count>
- + <SOAPSDK4:List SOAPSDK2:type="SOAPSDK3:Array"
SOAPSDK3:arrayType="SOAPSDK1:string[2]">
- + <SOAPSDK4:Item write="no" read="yes">Copy of
MIMH</SOAPSDK4:Item>
- + <SOAPSDK4:Item write="no" read="yes">MIMH</SOAPSDK4:Item>
</SOAPSDK4:List>
</SOAPSDK4:GetPublishedDatabasesResults>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

The WSDL relevant to this is

<types>
<xs:schema targetNamespace="http://localhost/cgi-bin/RSService/">
<!-- definition of elements -->
<!-- xs definition: List - complexType:Array -->
<xs:complexType name="List">
<xs:complexContent mixed="false">
<xs:restriction base="soapenc:Array">
<xs:attribute ref="soapenc:arrayType" ws:arrayType="xs:string[]"
xmlns:ws="http://schemas.xmlsoap.org/wsdl/"/>
</xs:restriction>
</xs:complexContent>
</xs:complexType>
</xs:schema>
</types>
...
<operation name="GetPublishedDatabases">
<soap:operation soapAction="GetPublishedDatabases"/>
<input>
<soap:body use="encoded" namespace="urn:RSSoap"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</input>
<output>
<soap:body use="encoded" namespace="urn:RSSoap"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</output>
</operation>

Mar 15 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.