Creating a C# webservice client having SoapParameterStyle as Bare as opposed to wrapped

Posted by Pratik Bhatt on Stack Overflow See other posts from Stack Overflow or by Pratik Bhatt
Published on 2010-06-15T06:11:01Z Indexed on 2010/06/15 18:42 UTC
Read the original article Hit count: 239

Filed under:
|
|
|

I am trying to create a Soap Web Service Client using the Visual C# 2008 Express IDE. I Do that by Right-Clicking Project Name->Add service Reference. Everything is working out fine, and the client is being generated as follows

[System.Web.Services.Protocols.SoapDocumentMethodAttribute("operationInfo", RequestElementName="mainInfoTag", RequestNamespace="http://www.example.com/test", ResponseElementName="Answer", ResponseNamespace="http://www.example.com/test", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
[return: System.Xml.Serialization.XmlElementAttribute("somenewID")]
public string storeWarrantyInformation(tagBelowMainInfoTag tag, out string somenewID, out string someotherID) 

As you can see, the method is marked with SoapParameterStyle.Wrapped, what this is does is that it does not create a class corresponding "mainInfoTag".

The Questions I have is what determines the Client SoapParameterStyle in the proxy class. I would like to get SoapParamterStyle as Bare, so that I have access to the root XML element. Is there some setting I can specify in the IDE or through 'wsdl.exe' to make this happen.

© Stack Overflow or respective owner

Related posts about c#

Related posts about .NET