Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / May 2005

Tip: Looking for answers? Try searching our database.

method parameters empty?  XML namespace prefix issue?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
drb - 19 May 2005 14:06 GMT
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.SoapDocumentMethodAttribute("http://schemas.microsoft.com/clr/nsassem/xxxxxx.TS.GSM.IMessageToGNU/TSGsmInterf
ace#Downlink
",
        RequestElementName="GSMDownlink",
        RequestNamespace="http://schemas.microsoft.com/clr/nsassem/xxxxxx.TS.GSM.IMessageToGNU/TSGsmInterf
ace/types
",
        ResponseElementName="GSMDownlinkResponse",
        ResponseNamespace="http://schemas.microsoft.com/clr/nsassem/xxxxxx.TS.GSM.IMessageToGNU/TSGsmInterf
ace/types
",
        Use=System.Web.Services.Description.SoapBindingUse.Literal,
        ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
    [return: System.Xml.Serialization.XmlElementAttribute("uplinkMatchID")]
    override public string Downlink(string key, int priority, string message,
string telephone)
    {
    .
    .
    .
    }

Do I need to put namespace qualifiers on the parameters/arguments somehow?  
Or is there something else I need to do?

There has to be a straightforward answer to this, because both the client
and the server are ASP.NET, right?

Thanks very much for any help,
Dave
drb - 20 May 2005 14:54 GMT
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.SoapDocumentMethodAttribute("http://schemas.microsoft.com/clr/nsassem/xxxxxx.TS.GSM.IMessageToGNU/TSGsmInterf
ace#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.SoapParameterStyle.Wrapped)]
    [return: System.Xml.Serialization.XmlElementAttribute("uplinkMatchID")]
    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)
    {
    .
    .
    .
    }

Hope this helps someone else out there...!

Dave

> Hi,
>
[quoted text clipped - 72 lines]
> Thanks very much for any help,
> Dave

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.