How to write c# proxy class to get at this data?

Discussion in 'ASP .Net Web Services' started by Datura, Aug 29, 2003.

  1. Datura

    Datura Guest

    Hi, I'm trying to use a wdsl generated proxy class to Invoke a web services
    method which outputs a soap envelope shown below.



    The response I'm looking for has two parts, one is a "Result" node, which I
    am successful in getting back, the other is the "vntReturn" node, which I
    know is being sent, but the Invoke method is not returning.



    The problem seems to be that the Invoke method simply is returning only one
    value, that found in the "Return" node. The attempt to assign vntReturn
    from results[1] gives a run-time error of array index out-of-bounds.



    Here's the proxy class code:




    [System.Web.Services.Protocols.SoapRpcMethodAttribute("http://tempuri.org/Da
    vinci/action/Gateway.Perform",
    RequestNamespace="http://tempuri.org/Davinci/message/",
    ResponseNamespace="http://tempuri.org/Davinci/message/")]
    [return: System.Xml.Serialization.SoapElementAttribute("Result")]
    public string Perform(string vntReceive, string vntReturn) {
    object[] results = this.Invoke("Perform", new object[] {
    vntReceive,
    vntReturn});
    vntReturn = ((string)(results[1]));
    /return ((string)(results[0]));
    }


    Any help or pointers greatly appreciated!



    Thanks!





    <SOAP-ENV:Body xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
    SOAPENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">

    <SOAPSDK4:performResponse
    xmlns:SOAPSDK4="http://tempuri.org/Davinci/message/">

    <Result>true</Result>

    <vntReturn
    xmlns:SOAPSDK2="http://www.w3.org/2001/XMLSchema-instance"
    SOAPSDK2:type="SOAPSDK1:string">

    &lt;body&gt;


    &lt;security_user_id&gt;&lt;![CDATA[5]]&gt;&lt;/security_user_id&gt;


    &lt;security_group_id&gt;&lt;![CDATA[1]]&gt;&lt;/security_group_id&gt;


    &lt;security_group_descr_short&gt;&lt;![CDATA[MTG]]&gt;&lt;/security_group_d
    escr_short&gt;


    &lt;user_name&gt;&lt;![CDATA[James Carmichael]]&gt;&lt;/user_name&gt;


    &lt;user_logon&gt;&lt;![CDATA[CARMICHAELJ]]&gt;&lt;/user_logon&gt;


    &lt;error_level_id&gt;&lt;![CDATA[2]]&gt;&lt;/error_level_id&gt;


    &lt;mts_server_name&gt;&lt;![CDATA[D01SVR84]]&gt;&lt;/mts_server_name&gt;


    &lt;db_server_name&gt;&lt;![CDATA[D01SVR82]]&gt;&lt;/db_server_name&gt;


    &lt;db_name&gt;&lt;![CDATA[rccl_qa]]&gt;&lt;/db_name&gt;


    &lt;international_rep_ind&gt;&lt;![CDATA[0]]&gt;&lt;/international_rep_ind&g
    t;


    &lt;ir_country_code&gt;&lt;![CDATA[]]&gt;&lt;/ir_country_code&gt;


    &lt;session_id&gt;&lt;![CDATA[{CB415EAD-7F2A-42E6-B715-C0F3FDE284B8}]]&gt;&l
    t;/session_id&gt;

    &lt;/body&gt;

    </vntReturn>

    </SOAPSDK4:performResponse>

    </SOAP-ENV:Body>
     
    Datura, Aug 29, 2003
    #1
    1. Advertising

  2. Index out of bounds means the array you are indexing does not include the
    element you are attempting to access. It seems likely that the results
    array has just one element?

    Have you traced the SOAP on the wire?
    eg, with proxytrace? http://www.pocketsoap.com/tcptrace/pt.aspx

    What do you see, can you post it ?

    Also, Why are you modifying the generated proxy? Shouldn't you just USE
    the generated proxy?

    -Dino


    can you show us
    "Datura" <> wrote in message
    news:ugw3b.3205020$...
    > Hi, I'm trying to use a wdsl generated proxy class to Invoke a web

    services
    > method which outputs a soap envelope shown below.
    >
    >
    >
    > The response I'm looking for has two parts, one is a "Result" node, which

    I
    > am successful in getting back, the other is the "vntReturn" node, which I
    > know is being sent, but the Invoke method is not returning.
    >
    >
    >
    > The problem seems to be that the Invoke method simply is returning only

    one
    > value, that found in the "Return" node. The attempt to assign vntReturn
    > from results[1] gives a run-time error of array index out-of-bounds.
    >
    >
    >
    > Here's the proxy class code:
    >
    >
    >
    >
    >

    [System.Web.Services.Protocols.SoapRpcMethodAttribute("http://tempuri.org/Da
    > vinci/action/Gateway.Perform",
    > RequestNamespace="http://tempuri.org/Davinci/message/",
    > ResponseNamespace="http://tempuri.org/Davinci/message/")]
    > [return: System.Xml.Serialization.SoapElementAttribute("Result")]
    > public string Perform(string vntReceive, string vntReturn) {
    > object[] results = this.Invoke("Perform", new object[] {
    > vntReceive,
    > vntReturn});
    > vntReturn = ((string)(results[1]));
    > /return ((string)(results[0]));
    > }
    >
    >
    > Any help or pointers greatly appreciated!
    >
    >
    >
    > Thanks!
    >
    >
    >
    >
    >
    > <SOAP-ENV:Body xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
    > SOAPENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
    >
    > <SOAPSDK4:performResponse
    > xmlns:SOAPSDK4="http://tempuri.org/Davinci/message/">
    >
    > <Result>true</Result>
    >
    > <vntReturn
    > xmlns:SOAPSDK2="http://www.w3.org/2001/XMLSchema-instance"
    > SOAPSDK2:type="SOAPSDK1:string">
    >
    > &lt;body&gt;
    >
    >
    > &lt;security_user_id&gt;&lt;![CDATA[5]]&gt;&lt;/security_user_id&gt;
    >
    >
    > &lt;security_group_id&gt;&lt;![CDATA[1]]&gt;&lt;/security_group_id&gt;
    >
    >
    >

    &lt;security_group_descr_short&gt;&lt;![CDATA[MTG]]&gt;&lt;/security_group_d
    > escr_short&gt;
    >
    >
    > &lt;user_name&gt;&lt;![CDATA[James Carmichael]]&gt;&lt;/user_name&gt;
    >
    >
    > &lt;user_logon&gt;&lt;![CDATA[CARMICHAELJ]]&gt;&lt;/user_logon&gt;
    >
    >
    > &lt;error_level_id&gt;&lt;![CDATA[2]]&gt;&lt;/error_level_id&gt;
    >
    >
    > &lt;mts_server_name&gt;&lt;![CDATA[D01SVR84]]&gt;&lt;/mts_server_name&gt;
    >
    >
    > &lt;db_server_name&gt;&lt;![CDATA[D01SVR82]]&gt;&lt;/db_server_name&gt;
    >
    >
    > &lt;db_name&gt;&lt;![CDATA[rccl_qa]]&gt;&lt;/db_name&gt;
    >
    >
    >

    &lt;international_rep_ind&gt;&lt;![CDATA[0]]&gt;&lt;/international_rep_ind&g
    > t;
    >
    >
    > &lt;ir_country_code&gt;&lt;![CDATA[]]&gt;&lt;/ir_country_code&gt;
    >
    >
    >

    &lt;session_id&gt;&lt;![CDATA[{CB415EAD-7F2A-42E6-B715-C0F3FDE284B8}]]&gt;&l
    > t;/session_id&gt;
    >
    > &lt;/body&gt;
    >
    > </vntReturn>
    >
    > </SOAPSDK4:performResponse>
    >
    > </SOAP-ENV:Body>
    >
    >
    >
    >
     
    Dino Chiesa [MSFT], Aug 29, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. vidy5300
    Replies:
    0
    Views:
    872
    vidy5300
    Jun 7, 2004
  2. Replies:
    0
    Views:
    1,643
  3. Karsten Wutzke
    Replies:
    1
    Views:
    880
    Steven Simpson
    Aug 20, 2007
  4. Replies:
    2
    Views:
    309
    Twisted
    Aug 20, 2007
  5. Klein Stéphane
    Replies:
    3
    Views:
    595
    Steve Holden
    Dec 20, 2009
Loading...

Share This Page