The Artima Developer Community
Sponsored Link

.NET Buzz Forum
.NET Web Services and the WS-I Basic Profile

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Peter G Provost

Posts: 849
Nickname: pprovost
Registered: Aug, 2003

Peter G Provost is a Solution Architect for Interlink Group in Denver, CO.
.NET Web Services and the WS-I Basic Profile Posted: Sep 4, 2003 5:02 PM
Reply to this message Reply

This post originated from an RSS feed registered with .NET Buzz by Peter G Provost.
Original Post: .NET Web Services and the WS-I Basic Profile
Feed Title: Peter Provost's Geek Noise
Feed URL: /error.aspx?aspxerrorpath=/Rss.aspx
Feed Description: Technology news, development articles, Microsoft .NET, and other stuff...
Latest .NET Buzz Posts
Latest .NET Buzz Posts by Peter G Provost
Latest Posts From Peter Provost's Geek Noise

Advertisement

I've spent much of the day using with the WS-I Testing Tools to test a very simple .NET Web Service and I'm surprised by what I'm finding.

My first test was to uncomment the HelloWorld method. I massaged the analyzerConfigBinding.xml configuration file from the WS-I samples directory so that it called my webservice. It passed with flying colors.

The next thing I wanted to try was passing my own classes back from a web service. I creates a fairly complex class model that defined a Contacts class containing Contact objects, each of which has properties like FirstName, Address, etc.

Once again it passes. So far so good. But what about DataSets?

I have seen countless demonstrations by MS people showing DataSets passed to and from web services. While I've never been much of a fan of this myself, I didn't have a good reason other than vague "concerns" about interoperability. It appears that my concerns are well founded as I have not been able to get a DataSet to pass through the WS-I analyzer.

I created a simple Web Method that returned a DataSet. It failed on tests WSI2102, WSI2122, and WSI2703.

The first test (2102) fails because the <schema> element contains an <import> element that specifies http://www.w3.org/2001/XMLSchema as the namespace. There isn't a valid schema file at that URL. Maybe they meant http://www.w3.org/2001/XMLSchema.xsd?

The second (2122) and third (2703) tests fail because deep down in the <types> section of the WSDL, a DataSet is defined as being a sequence of a <s:element ref="s:schema" /> followed by <s:any />. What I think is happening here is that it is telling us that the schema for the dataset will be sent with the dataset itself. This apparently isn't allowed in WS-I Basic Profile. (Now that I write this, I think I understand what InfoPath is complaining about when I tried to have it consume a DataSet from a webservice.)

So plain-jane DataSets are out. What about typed DataSets? I created a simple typed DataSet and dragged the authors table from the pubs database onto it. Modified my web service to return this DataSet and...

BOOM! The analyzer tool chokes on the WSDL and throws an InvalidOperationException during XmlSerializer.Deserialize. One thing to note is that the data set definition has changed from the sequence I descibed above to a sequence containing just an <s:any> element with its namespace attribute set to the address of the XSD file for the DataSet. I suspect the WS-I tool is choking either on the <s:any> element or on the XSD file. Not sure which at this point.

So, after all of this I think it is safe to say that my original vague feelings about not using DataSets in Web Services was the right thing, even if I didn't have a good reason why. So how does this affect the old "DataSets vs. Strongly Typed Collection" debate? I think it is obvious where I stand.

Read: .NET Web Services and the WS-I Basic Profile

Topic: SOAP: Service-Oriented Architecture Previous Topic   Next Topic Topic: CF.NET/SQL CE Article on VSM

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use