method parameters empty? XML namespace prefix issue?

Ask a Question related to ASP.NET Web Services, Design and Development.

  1. #1

    Default method parameters empty? XML namespace prefix issue?

    Hi,

    I'm trying to create a simple test/dummy .NET XML web service (using
    WSDL/XSD and the WSDL.exe tool) that an existing .NET Remoting XML web
    service client can talk to.

    The good news is it seems to be very close to working. The not-so-good news
    is that when a method is invoked, when I breakpoint on the server side, all
    the parameters to the method are either null (strings) or zero (ints), even
    though the client specified real values for all of them. Running the SOAP
    TRACE revealed the following:

    HTTP headers:

    <HTTPHeaders>
    <user-agent>Mozilla/4.0+(compatible; MSIE 6.0; Windows 5.1.2600.0; MS .NET
    Remoting; MS .NET CLR 1.1.4322.2032 )</user-agent>
    <content-type>text/xml; charset="utf-8"</content-type>

    <soapaction>"http://schemas.microsoft.com/clr/nsassem/xxxxxx/TSGsmInterface#Downlink"</soapaction>
    <content-length>716</content-length>
    <expect>100-continue</expect>
    <host>f812f61:8080</host>
    </HTTPHeaders>

    Request:

    <SOAP-ENV:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
    xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:clr="http://schemas.microsoft.com/soap/encoding/clr/1.0"
    SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
    <SOAP-ENV:Body>
    <i2:Downlink id="ref-1"
    xmlns:i2="http://schemas.microsoft.com/clr/nsassem/xxxxxx/TSGsmInterface">
    <key id="ref-3">92</key>
    <priority>1</priority>
    <message id="ref-4">A1234560765432101000003</message>
    <telephone id="ref-5">9123-456-7890</telephone>
    </i2:Downlink>
    </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>

    Does the fact that there is no "i2:" namespace prefix on the parameters (ex.
    "<key>", "<prioirity>", etc.) cause the server/service to not see the values
    somehow? (I assume this "i2" namespace was created by the XML/SOAP
    serializer on the client side?) I've defined the service method is defined
    (C#) as follows:

    [System.Web.Services.WebMethod(Description="Send a Downlink Message to the
    GSM Provider")]
    [System.Web.Services.Protocols.SoapDocumentMethodAt tribute("http://schemas.microsoft.com/clr/nsassem/xxxxxx.TS.GSM.IMessageToGNU/TSGsmInterface#Downlink",
    RequestElementName="GSMDownlink",
    RequestNamespace="http://schemas.microsoft.com/clr/nsassem/xxxxxx.TS.GSM.IMessageToGNU/TSGsmInterface/types",
    ResponseElementName="GSMDownlinkResponse",
    ResponseNamespace="http://schemas.microsoft.com/clr/nsassem/xxxxxx.TS.GSM.IMessageToGNU/TSGsmInterface/types",
    Use=System.Web.Services.Description.SoapBindingUse .Literal,
    ParameterStyle=System.Web.Services.Protocols.SoapP arameterStyle.Wrapped)]
    [return: System.Xml.Serialization.XmlElementAttribute("upli nkMatchID")]
    override public string Downlink(string key, int priority, string message,
    string telephone)
    {
    drb Guest

  2. Similar Questions and Discussions

    1. Namespace Prefix in Response Element child nodes
      In my .Net web service. I want to declare all the namespaces in my soap response element and have all the child elements use prefixes. I know how to...
    2. Help! SOAP::Lite: How to set the namespace prefix for the request?
      Hi, I have to send attributes as <urn:Foo> ... </urn:Foo> and *not* <Foo xsi:type="..."> ... </Foo>
    3. namespace issue
      Hi there, I have a flex app using mxml components that are packaged in a structure and located inside: <flexapp>/WEB-INF/flex/user_classes/ ...
    4. Namespace Prefix problem
      Hi, i have a SOAP XML which is similar to this: <request xmlns="http://www.someurl.com"> <abc> <xyz></xyz> <xyz></xyz> </abc> I need the...
    5. CGI.pm's Param method in another namespace
      How do I get a list of the names of all the parameters that have been imported using the import_names method? For example, $query = new CGI;...
  3. #2

    Default RE: method parameters empty? XML namespace prefix issue?

    Well, I managed to brute-force/trial-and-error until I got the desired
    result. Looks like the problem was in the WSDL file I wrote to generate the
    service method stub.

    In my previous post I listed the code generated for the service method.
    When I made the following changes, things worked:

    [System.Web.Services.WebMethod(Description="Send a Downlink Message to the
    GSM Provider")
    [System.Web.Services.Protocols.SoapDocumentMethodAt tribute("http://schemas.microsoft.com/clr/nsassem/xxxxxx.TS.GSM.IMessageToGNU/TSGsmInterface#Downlink"
    RequestNamespace="http://schemas.microsoft.com/clr/nsassem/xxxxxx.TS.GSM.IMessageToGNU/TSGsmInterface"
    ResponseNamespace="http://schemas.microsoft.com/clr/nsassem/xxxxxx.TS.GSM.IMessageToGNU/TSGsmInterface",
    Use=System.Web.Services.Description.SoapBindingUse .Literal,
    ParameterStyle=System.Web.Services.Protocols.SoapP arameterStyle.Wrapped)]
    [return: System.Xml.Serialization.XmlElementAttribute("upli nkMatchID")]
    override public string
    Downlink([System.Xml.Serialization.XmlElementAttribute(Form= System.Xml.Schema.XmlSchemaForm.Unqualified)]
    string key,
    [System.Xml.Serialization.XmlElementAttribute(Form= System.Xml.Schema.XmlSchemaForm.Unqualified)]
    int priority,
    [System.Xml.Serialization.XmlElementAttribute(Form= System.Xml.Schema.XmlSchemaForm.Unqualified)]
    string message,
    [System.Xml.Serialization.XmlElementAttribute(Form= System.Xml.Schema.XmlSchemaForm.Unqualified)] string telephone)
    {
    drb Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139