Complex soap messages with structures

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

  1. Dan

    Dan Guest

    Now I am really confused.

    here is the stream going in

    <SOAP-ENV:Envelope
    xmlns:SOAP-
    ENV="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
    xmlns:xsd="http://www.w3.org/1999/XMLSchema"
    xmlns:xe="urn:embrasure"
    xmlns:xe1=" urn:VerifyStatus"
    xmlns:xe2="http://schemas.xmlsoap.org/soap/encoding/"
    >

    <SOAP-ENV:Body>
    <xe1:standard SOAP-
    ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding
    /" >
    <xe1:key xsi:type="xe:messagekey">
    <partnerkey
    xsi:type="xsd:string">Embasure</partnerkey>
    <companykey
    xsi:type="xsd:string">PHTRopphile,disney</companykey>
    </xe1:key>
    </xe1:standard>
    </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>


    Here is the server response:
    <soap:Envelope
    xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <soap:Body>
    <soap:Fault>
    <faultcode>soap:Client</faultcode>

    <faultstring>System.Web.Services.Protocols.SoapException:
    Server was unable to read request. --->
    System.InvalidOperationException: There is an error in XML
    document (11, 6). ---> System.InvalidOperationException:
    <standard xmlns=' urn:VerifyStatus'> was not expected.
    at
    Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializat
    ionReader1.Read17_standard()
    --- End of inner exception stack trace ---
    at System.Xml.Serialization.XmlSerializer.Deserialize
    (XmlReader xmlReader, String encodingStyle)
    at System.Xml.Serialization.XmlSerializer.Deserialize
    (XmlReader xmlReader)
    at
    System.Web.Services.Protocols.SoapServerProtocol.ReadParame
    ters()
    --- End of inner exception stack trace ---
    at
    System.Web.Services.Protocols.SoapServerProtocol.ReadParame
    ters()
    at
    System.Web.Services.Protocols.WebServiceHandler.Invoke()
    at
    System.Web.Services.Protocols.WebServiceHandler.CoreProcess
    Request()</faultstring>
    <detail />
    </soap:Fault>
    </soap:Body>
    </soap:Envelope>

    What am I doing wrong!

    te service is set up as :

    /// Make service accessible from the outside
    [WebService (Namespace="http://172.17.8.26/Soap" )]
    [SoapRpcService
    (RoutingStyle=SoapServiceRoutingStyle.SoapAction)]

    public class Service1 :
    System.Web.Services.WebService

    and the method is:

    [ SoapRpcMethod(Action="standard",
    RequestNamespace="VerifyStatus",
    RequestElementName="standard",
    ResponseNamespace="VerifyStatus",
    ResponseElementName="standardResponse")]
    // standard ping call with key passed for verifystatus
    [WebMethod (Description="Validate SOAP server availability
    and Message Key integrity")]

    public messagekey standard(messagekey key)
    {
    messagekey kys = new keys();
    //Make sure Embrasure is who is calling us
    if(key.partnerKey.CompareTo("Embrasure") == 0)
    {
    // Validate the login and Embrasure
    string[] ks = getkey(key.partnerKey, key.companyKey);

    kys.partnerKey = ks[0];
    kys.companyKey = ks[1];

    }
    return kys;

    }

    Why cant it see the namespace for the call!

    HELP

    Thanks
    Dan

    >-----Original Message-----
    >OK, I am having a problem getting the xml to format for
    >this soap message.
    >
    ><SOAP-ENV:Envelope xmlns:SOAP-
    >ENV="http://schemas.xmlsoap.org/soap/envelope/"
    > xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
    > xmlns:xsd="http://www.w3.org/1999/XMLSchema"
    > xmlns:xe="urn:mine"
    > xmlns:xe1=" urn:VerifyStatus"
    > xmlns:xe2="http://schemas.xmlsoap.org/soap/encoding/"
    > >

    > <SOAP-ENV:Body>
    > <xe1:standard SOAP-
    >ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encodin

    g
    >/" >
    > <xe1:key xsi:type="xe:messagekey">
    > <partnerkey
    >xsi:type="xsd:string">someguy</partnerkey>
    > <companykey
    >xsi:type="xsd:string">blah,blah</companykey>
    > </xe1:key>
    > </xe1:standard>
    > </SOAP-ENV:Body>
    ></SOAP-ENV:Envelope>
    >
    >Can anyone help.
    >
    >here is the webmethod:
    >
    > [WebMethod (Description="Validate SOAP
    >server availability and Message Key integrity")]
    > [TraceExtension()]
    > [SoapDocumentMethod
    >("http://172.17.89.26/standard",
    >
    >RequestNamespace="http://172.17.89.26/standard",
    >
    >ResponseNamespace="http://172.17.89.26/standardResponse",
    > Use=SoapBindingUse.Encoded)
    > ]
    >public keys standard([XmlElement("key")] messagekey key)
    >{
    > keys kys = new keys();
    > //Make sure Embrasure is who is calling us
    > if(key.partnerKey.CompareTo("Embrasure") == 0)
    > {
    > // Validate the login and Embrasure
    > string[] ks = getkey(key.partnerKey, key.companyKey);
    >
    > kys.partnerKey = ks[0];
    > kys.companyKey = ks[1];
    >
    > }
    >return kys;
    >
    >}
    >
    >here is the messagekey class:
    >[XmlRoot("key")]
    >public class messagekey
    >{
    > public string partnerKey="";
    > public string companyKey = "";
    > public messagekey()
    > {
    > }
    >}
    >
    >and the responding keys class
    >[XmlRoot("return")]
    >public class keys
    >{
    > public string partnerKey="";
    > public string companyKey = "";
    > [XmlElement("timestamp")]
    > public DateTime timestamp;
    > public keys()
    > {
    > timestamp=DateTime.Now;
    > }
    >
    >}
    >
    >
    ><SOAP-ENV:Envelope xmlns:SOAP-
    >ENV="http://schemas.xmlsoap.org/soap/envelope/"
    > xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
    > xmlns:xsd="http://www.w3.org/1999/XMLSchema"
    > xmlns:xe="urn:mine"
    > xmlns:xe1=" urn:VerifyStatus"
    > xmlns:xe2="http://schemas.xmlsoap.org/soap/encoding/"
    > >

    > <SOAP-ENV:Body>
    > <xe1:standard SOAP-
    >ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encodin

    g
    >/" >
    > <xe1:key xsi:type="xe:messagekey">
    > <partnerkey
    >xsi:type="xsd:string">someguy</partnerkey>
    > <companykey
    >xsi:type="xsd:string">blah,blah</companykey>
    > </xe1:key>
    > </xe1:standard>
    > </SOAP-ENV:Body>
    ></SOAP-ENV:Envelope>
    >
    >the response should look like this.
    ><SOAP-ENV:Envelope
    > xmlns:SOAP-
    >ENV="http://schemas.xmlsoap.org/soap/envelope/"
    > xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
    > xmlns:xsd="http://www.w3.org/1999/XMLSchema"
    > >

    > <SOAP-ENV:Body>
    > <ns1:standardResponse xmlns:ns1="urn:VerifyStatus"
    > SOAP-
    >ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encodin

    g
    >/">
    > <return xmlns:ns2="urn:mine"
    >xsi:type="ns2:messagekey">
    > <partnerkey xsi:type="xsd:string">PARTNER
    >KEY</partnerkey>
    > <companykey xsi:type="xsd:string">COMPANY
    >KEY</companykey>
    > <timestamp xsi:type="xsd:date">YYYY-MM-DD
    >HH24:MI:SS </timestamp>
    > </return>
    > </ns1:standardResponse>
    > </SOAP-ENV:Body>
    ></SOAP-ENV:Envelope>
    >
    >
    >I cant get the response nor does the method see the
    >message object being passed in.
    >
    >Does any one have any ideas. I dont want to hack teh XML
    >stream going out.
    >
    >Thanks
    >Dan
    >
    >.
    >
     
    Dan, Aug 29, 2003
    #1
    1. Advertising

  2. Hi Dan,

    Thanks for your posting. I am checking this issue, and will get back to you
    with my findings.

    Best regards,
    Lewis

    --------------------
    | Content-Class: urn:content-classes:message
    | From: "Dan" <>
    | Sender: "Dan" <>
    | References: <0e2d01c36d84$51e9e6e0$>
    | Subject: Complex soap messages with structures
    | Date: Fri, 29 Aug 2003 10:03:07 -0700
    | Lines: 261
    | Message-ID: <019801c36e4f$6afb6d40$>
    | MIME-Version: 1.0
    | Content-Type: text/plain;
    | charset="iso-8859-1"
    | Content-Transfer-Encoding: 7bit
    | X-Newsreader: Microsoft CDO for Windows 2000
    | X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4910.0300
    | Thread-Index: AcNuT2r4Lxah9o6KQIOECwinUacaCA==
    | Newsgroups: microsoft.public.dotnet.framework.aspnet.webservices
    | Path: cpmsftngxa06.phx.gbl
    | Xref: cpmsftngxa06.phx.gbl
    microsoft.public.dotnet.framework.aspnet.webservices:19100
    | NNTP-Posting-Host: TK2MSFTNGXA11 10.40.1.163
    | X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webservices
    |
    | Now I am really confused.
    |
    | here is the stream going in
    |
    | <SOAP-ENV:Envelope
    | xmlns:SOAP-
    | ENV="http://schemas.xmlsoap.org/soap/envelope/"
    | xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
    | xmlns:xsd="http://www.w3.org/1999/XMLSchema"
    | xmlns:xe="urn:embrasure"
    | xmlns:xe1=" urn:VerifyStatus"
    | xmlns:xe2="http://schemas.xmlsoap.org/soap/encoding/"
    | >
    | <SOAP-ENV:Body>
    | <xe1:standard SOAP-
    | ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding
    | /" >
    | <xe1:key xsi:type="xe:messagekey">
    | <partnerkey
    | xsi:type="xsd:string">Embasure</partnerkey>
    | <companykey
    | xsi:type="xsd:string">PHTRopphile,disney</companykey>
    | </xe1:key>
    | </xe1:standard>
    | </SOAP-ENV:Body>
    | </SOAP-ENV:Envelope>
    |
    |
    | Here is the server response:
    | <soap:Envelope
    | xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
    | xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    | xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    | <soap:Body>
    | <soap:Fault>
    | <faultcode>soap:Client</faultcode>
    |
    | <faultstring>System.Web.Services.Protocols.SoapException:
    | Server was unable to read request. --->
    | System.InvalidOperationException: There is an error in XML
    | document (11, 6). ---> System.InvalidOperationException:
    | <standard xmlns=' urn:VerifyStatus'> was not expected.
    | at
    | Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializat
    | ionReader1.Read17_standard()
    | --- End of inner exception stack trace ---
    | at System.Xml.Serialization.XmlSerializer.Deserialize
    | (XmlReader xmlReader, String encodingStyle)
    | at System.Xml.Serialization.XmlSerializer.Deserialize
    | (XmlReader xmlReader)
    | at
    | System.Web.Services.Protocols.SoapServerProtocol.ReadParame
    | ters()
    | --- End of inner exception stack trace ---
    | at
    | System.Web.Services.Protocols.SoapServerProtocol.ReadParame
    | ters()
    | at
    | System.Web.Services.Protocols.WebServiceHandler.Invoke()
    | at
    | System.Web.Services.Protocols.WebServiceHandler.CoreProcess
    | Request()</faultstring>
    | <detail />
    | </soap:Fault>
    | </soap:Body>
    | </soap:Envelope>
    |
    | What am I doing wrong!
    |
    | te service is set up as :
    |
    | /// Make service accessible from the outside
    | [WebService (Namespace="http://172.17.8.26/Soap" )]
    | [SoapRpcService
    | (RoutingStyle=SoapServiceRoutingStyle.SoapAction)]
    |
    | public class Service1 :
    | System.Web.Services.WebService
    |
    | and the method is:
    |
    | [ SoapRpcMethod(Action="standard",
    | RequestNamespace="VerifyStatus",
    | RequestElementName="standard",
    | ResponseNamespace="VerifyStatus",
    | ResponseElementName="standardResponse")]
    | // standard ping call with key passed for verifystatus
    | [WebMethod (Description="Validate SOAP server availability
    | and Message Key integrity")]
    |
    | public messagekey standard(messagekey key)
    | {
    | messagekey kys = new keys();
    | //Make sure Embrasure is who is calling us
    | if(key.partnerKey.CompareTo("Embrasure") == 0)
    | {
    | // Validate the login and Embrasure
    | string[] ks = getkey(key.partnerKey, key.companyKey);
    |
    | kys.partnerKey = ks[0];
    | kys.companyKey = ks[1];
    |
    | }
    | return kys;
    |
    | }
    |
    | Why cant it see the namespace for the call!
    |
    | HELP
    |
    | Thanks
    | Dan
    |
    | >-----Original Message-----
    | >OK, I am having a problem getting the xml to format for
    | >this soap message.
    | >
    | ><SOAP-ENV:Envelope xmlns:SOAP-
    | >ENV="http://schemas.xmlsoap.org/soap/envelope/"
    | > xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
    | > xmlns:xsd="http://www.w3.org/1999/XMLSchema"
    | > xmlns:xe="urn:mine"
    | > xmlns:xe1=" urn:VerifyStatus"
    | > xmlns:xe2="http://schemas.xmlsoap.org/soap/encoding/"
    | > >
    | > <SOAP-ENV:Body>
    | > <xe1:standard SOAP-
    | >ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encodin
    | g
    | >/" >
    | > <xe1:key xsi:type="xe:messagekey">
    | > <partnerkey
    | >xsi:type="xsd:string">someguy</partnerkey>
    | > <companykey
    | >xsi:type="xsd:string">blah,blah</companykey>
    | > </xe1:key>
    | > </xe1:standard>
    | > </SOAP-ENV:Body>
    | ></SOAP-ENV:Envelope>
    | >
    | >Can anyone help.
    | >
    | >here is the webmethod:
    | >
    | > [WebMethod (Description="Validate SOAP
    | >server availability and Message Key integrity")]
    | > [TraceExtension()]
    | > [SoapDocumentMethod
    | >("http://172.17.89.26/standard",
    | >
    | >RequestNamespace="http://172.17.89.26/standard",
    | >
    | >ResponseNamespace="http://172.17.89.26/standardResponse",
    | > Use=SoapBindingUse.Encoded)
    | > ]
    | >public keys standard([XmlElement("key")] messagekey key)
    | >{
    | > keys kys = new keys();
    | > //Make sure Embrasure is who is calling us
    | > if(key.partnerKey.CompareTo("Embrasure") == 0)
    | > {
    | > // Validate the login and Embrasure
    | > string[] ks = getkey(key.partnerKey, key.companyKey);
    | >
    | > kys.partnerKey = ks[0];
    | > kys.companyKey = ks[1];
    | >
    | > }
    | >return kys;
    | >
    | >}
    | >
    | >here is the messagekey class:
    | >[XmlRoot("key")]
    | >public class messagekey
    | >{
    | > public string partnerKey="";
    | > public string companyKey = "";
    | > public messagekey()
    | > {
    | > }
    | >}
    | >
    | >and the responding keys class
    | >[XmlRoot("return")]
    | >public class keys
    | >{
    | > public string partnerKey="";
    | > public string companyKey = "";
    | > [XmlElement("timestamp")]
    | > public DateTime timestamp;
    | > public keys()
    | > {
    | > timestamp=DateTime.Now;
    | > }
    | >
    | >}
    | >
    | >
    | ><SOAP-ENV:Envelope xmlns:SOAP-
    | >ENV="http://schemas.xmlsoap.org/soap/envelope/"
    | > xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
    | > xmlns:xsd="http://www.w3.org/1999/XMLSchema"
    | > xmlns:xe="urn:mine"
    | > xmlns:xe1=" urn:VerifyStatus"
    | > xmlns:xe2="http://schemas.xmlsoap.org/soap/encoding/"
    | > >
    | > <SOAP-ENV:Body>
    | > <xe1:standard SOAP-
    | >ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encodin
    | g
    | >/" >
    | > <xe1:key xsi:type="xe:messagekey">
    | > <partnerkey
    | >xsi:type="xsd:string">someguy</partnerkey>
    | > <companykey
    | >xsi:type="xsd:string">blah,blah</companykey>
    | > </xe1:key>
    | > </xe1:standard>
    | > </SOAP-ENV:Body>
    | ></SOAP-ENV:Envelope>
    | >
    | >the response should look like this.
    | ><SOAP-ENV:Envelope
    | > xmlns:SOAP-
    | >ENV="http://schemas.xmlsoap.org/soap/envelope/"
    | > xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
    | > xmlns:xsd="http://www.w3.org/1999/XMLSchema"
    | > >
    | > <SOAP-ENV:Body>
    | > <ns1:standardResponse xmlns:ns1="urn:VerifyStatus"
    | > SOAP-
    | >ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encodin
    | g
    | >/">
    | > <return xmlns:ns2="urn:mine"
    | >xsi:type="ns2:messagekey">
    | > <partnerkey xsi:type="xsd:string">PARTNER
    | >KEY</partnerkey>
    | > <companykey xsi:type="xsd:string">COMPANY
    | >KEY</companykey>
    | > <timestamp xsi:type="xsd:date">YYYY-MM-DD
    | >HH24:MI:SS </timestamp>
    | > </return>
    | > </ns1:standardResponse>
    | > </SOAP-ENV:Body>
    | ></SOAP-ENV:Envelope>
    | >
    | >
    | >I cant get the response nor does the method see the
    | >message object being passed in.
    | >
    | >Does any one have any ideas. I dont want to hack teh XML
    | >stream going out.
    | >
    | >Thanks
    | >Dan
    | >
    | >.
    | >
    |
     
    Lewis Wang [MSFT], Sep 1, 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. Dennis Gavrilov
    Replies:
    1
    Views:
    1,470
    Dennis Gavrilov
    Jul 24, 2003
  2. Markus Kern
    Replies:
    7
    Views:
    2,549
    Victor Bazarov
    Feb 22, 2005
  3. Ravi Shankar Nair

    Regarding complex Menu structures

    Ravi Shankar Nair, Jun 26, 2006, in forum: Java
    Replies:
    4
    Views:
    514
    Oliver Wong
    Jun 28, 2006
  4. tweak
    Replies:
    14
    Views:
    2,818
    Eric Sosman
    Jun 11, 2004
  5. Alfonso Morra
    Replies:
    11
    Views:
    753
    Emmanuel Delahaye
    Sep 24, 2005
Loading...

Share This Page