integer array return from SOAP call

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Chris Smith

    #1

    integer array return from SOAP call

    I've got a web service that returns an int[]. When called from most
    clients, it works fine. The .NET framework'd wsdl.exe, though,
    generates a stub that fails to get the values in the array.

    The WSDL is at:



    The code looks like this (with passwords blanked out):

    using System;

    namespace TestWS
    {
    class MainClass
    {
    public static void Main(string[] args)
    {
    MainServiceServ ice dac = new MainServiceServ ice();

    int a = dac.getRootGrou p(
    "mindiq", "cdsmith", "********") ;
    Console.WriteLi ne(a);
    int[] subs = dac.getSubGroup s(
    "mindiq", "cdsmith", "********", a);
    for (int i = 0; i < subs.Length; i++)
    {
    Console.Write(s ubs[i] + " ");
    }

    Console.WriteLi ne();
    }
    }
    }

    The SOAP response to the second operation (getSubGroups) looks like this
    (all newlines come from my newsreader wrapping):

    <soapenv:Envelo pe
    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"><soap env:Body>
    <ns1:getSubGrou psResponse
    soapenv:encodin gStyle="http://schemas.xmlsoap .org/soap/encoding/"
    xmlns:ns1="http ://webservice.mind iqweb.mindiq.co m"><getSubGroup sReturn
    soapenc:arrayTy pe="xsd:int[3]" xsi:type="soape nc:Array"
    xmlns:soapenc=" http://schemas.xmlsoap .org/soap/encoding/"><item
    href="#id0"/><item href="#id1"/><item href="#id2"/></getSubGroupsRet urn>
    </ns1:getSubGroup sResponse><mult iRef id="id2" soapenc:root="0 "
    soapenv:encodin gStyle="http://schemas.xmlsoap .org/soap/encoding/"
    xsi:type="xsd:i nt"
    xmlns:soapenc=" http://schemas.xmlsoap .org/soap/encoding/">4207
    </multiRef><multi Ref id="id0" soapenc:root="0 "
    soapenv:encodin gStyle="http://schemas.xmlsoap .org/soap/encoding/"
    xsi:type="xsd:i nt"
    xmlns:soapenc=" http://schemas.xmlsoap .org/soap/encoding/">1064
    </multiRef><multi Ref id="id1" soapenc:root="0 "
    soapenv:encodin gStyle="http://schemas.xmlsoap .org/soap/encoding/"
    xsi:type="xsd:i nt"
    xmlns:soapenc=" http://schemas.xmlsoap .org/soap/encoding/">2084
    </multiRef></soapenv:Body></soapenv:Envelop e>

    And the code prints:

    7
    0 0 0

    It should print:

    7
    1064 2084 4207

    Any ideas what is wrong?

    --

    The Easiest Way To Train Anyone... Anywhere.

    Chris Smith - Lead Software Developer/Technical Trainer
    MindIQ Corporation
Working...