471,354 Members | 1,507 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,354 software developers and data experts.

How to add style="document" attribute in .Net 2.0 wsdl

When .Net 1.0 webservice (VS2003) generates a wsdl -

<wsdl:binding name="TestSoap" type="tns:TestSoap">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http"
style="document"/(note: style attribute present)
<wsdl:operation name="HelloWorld">
<soap:operation soapAction="http://tempuri.org/HelloWorld"
style="document" />

But when .Net 2.0 webservice (VS2005) generates a wsdl -

<wsdl:binding name="TestSoap" type="tns:TestSoap">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" /(note:
style attribute missing)
<wsdl:operation name="HelloWorld">
<soap:operation soapAction="http://tempuri.org/HelloWorld"
style="document" />

so the new VS2005 webservice wsdl omits the style="document" attribute. The
style is however "document" by default.

The problem that this causes is - Java specifically requires the
style="document" when it consumes a .Net Webservice.

And we do not want our Java users to make any change on their side. All our
webservices are currently in VS2003 and want to convert to VS2005, but want
this change to be transparant to Java users.

I found that in .Net2.0 using SoapExtensionReflector you can intercept the
wsdl, the wsdl/servicedescription is accessible via a object model - a
ServiceDescription class and through one of it's collection which is the
BindingCollection (of the SoapExtension collection) you can set the style to
either "document" or "RPC"

When I set it to RPC it does add the style="RPC" attribute. But when I set
style to document it still omits the style="document"
NOTE: style is a enumerated type. here is my code below.

ServiceDescription myDescription =

BindingCollection myBindingCollection = myDescription.Bindings;
SoapBinding sb =
sb.Style = SoapBindingStyle.Document; //does not add
style="document" attribute

sb.Style = SoapBindingStyle.Rpc; //does add style="rpc" attribute

Any clues ?? No, we don't want to manually create the wsdl. We want a
solution that will not break Java code. Other than the missing style
attribute the rest of the wsdl looks similar to the one created by VS2003.
May 5 '07 #1
0 2477

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

52 posts views Thread by Markus Elfring | last post: by
5 posts views Thread by johnsuth | last post: by
5 posts views Thread by Tobin Fricke | last post: by
reply views Thread by XIAOLAOHU | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.