[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.aspnet.webservices

ResponseElementName - how can I include a prefix?

karasu

8/11/2003 3:07:00 AM

I am using a web reference to communicate to a web service. My
application was coded using C#. I don't have any control over the
format of the XML sent to me.

The XML sent to me looks like the following:

<soap:Body>
<abc:PerformActionResponse xmlns="http://www.different.com...
<Id>12345</Id>
<status>Success</status>
</abc:PerformActionResponse>
</soap:Body>

The applicable entry in my Reference.cs file looks like the following:

[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://www.example.com/PerformAc...,
RequestNamespace="http://www.example...,
ResponseNamespace="http://www.different...,
ResponseElementName="abc:PerformActionResponse",
Use=System.Web.Services.Description.SoapBindingUse.Literal,
ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
public void PerformAction(out string Id, out ReturnCode status)
{
object[] results = this.Invoke("PerformAction", new object[] {});
Id = ((string)(results[0]));
status = ((ReturnCode)(results[1]));
}

With the 'abc:' prefix added and sent from the web service, none of my
out parameters are assigned to the results object, all entries are
null. I've tried adding and omitting the prefix from the
ResponseElementName value, both fail the same way.

I created my own webservice to test. Everything works if there is no
prefix in the ResponseElementName element, the results object is set
correctly. It fails as above if a prefix is used.

How can I modify my application to properly handle the above XML sent
from the webservice?