WCF - ASMX Interoperability – Best Practices – Part I#
These are probably few of the most popular questions on the forums and in the WCF sessions.

  • How can I make my WCF WSDL same as Asmx WSDL? It looks different even when I use basic http binding with nothing fancy (security, reliable messaging..no WS* of course).
  • I’m doing interop with Java and my stub generator is unable to understand the WSDL generated by WCF but it works just fine with Asmx WSDL, what am I doing wrong?
  • What binding should I use which works best for interop?
  • Dude, where are my types? 

etc...

In short, the answer is, there is no silver bullet when it comes to interop. There are several case by case things you’d need to consider when trying to make your contracts visible to outside world. Having said that, there are best practices you can follow which I’d cover in this and upcoming blog posts.

The WSDL generated via WCF is different from traditional ASMX WSDL because they have split the schema into multiple segments (WSDL0, WSDL1....). This is the reason why when you look at the WSDL, you'll notice that the types seem to be missing! The stub building tools which come with other servers (Weblogic 6.0 for example) do not yet know this and do not iterate through the links specified in the schema by default, therefore you would not be able to make proxies out of it.

One of the big benefits of using WCF meta-data generation engine is that you can get XSD’s out of it too. Other platforms (read Java) tools understand and prefers XSD's (even though WSDL is the standard, XSD’s are cleaner IMHO). You can now easily generate them via a WCF service like follows.

  • service.svc?xsd=xsd0
  • service.svc ?xsd=xsd1
  • service.svc?xsd=xsd2

Each of these xsd's has separated out contract, type and type definition.

Similarly you'd have WSDL0, WSDL1 and WSDL2 so

  • service.svc?wsdl=wsdl0
  • service.svc?wsdl=wsdl1
  • service.svc?wsdl=wsdl2

Again, the wsdl's are separated to keep the contract, type and type definition (what is a double in interop environment) apart and not in giant one big file, which seems to be much easier but in essence its not.
Improving WCF Interoperability: Flattening your WSDL is an excellent article by Christian Weyer on increasing the interop bar. It explains the reasoning behind why a simple basic http binding service based WCF generated WSDL cannot communicate with its Java counterparts anymore and how to fix this problem.

In the next part I’ll discuss and share some examples and code samples.





10/8/2007 7:22:34 AM (Pacific Standard Time, UTC-08:00) #    Comments [4]  |  Trackback

 

All content © 2008, Adnan Masood
About the Author
On this page
Calendar
<October 2008>
SunMonTueWedThuFriSat
2829301234
567891011
12131415161718
19202122232425
2627282930311
2345678
Archives
Sitemap
Blogroll OPML
microsoft
Blogroll
Disclaimer

Powered by: newtelligence dasBlog 1.8.5223.2

The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

Send mail to the author(s) E-mail

Theme design by Jelle Druyts