Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / November 2007

Tip: Looking for answers? Try searching our database.

Update Web Services has caused unexpected changes to method signat

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Iain - 28 Nov 2007 22:09 GMT
Hi there.

I've got an app in c# that uses web services (both as consumer and server)
which I wrote some years ago and am now updating.

The server side gets information from SQLServer as XML and serialises the
result into an object tree generated on an XSD file.

The object in question is an Order Batch - a collection of orders.

Recently I needed to slight change the definition of an order, so I changed
the xsd file, rebuilt and then updated the web reference.

What's happening is that two of my methods (the only two which return an
order, rather than an order batch) now return a new type <MethodName>Result.  
(this is looking at the object browser in the client)

So GetOrder returns GetOrderResult which is identical in content to an
order, but it isn't!

Methods which return the OrderBatch type work successfully with no change.

During this rebuild, however, all the class names changed from the ones
which were in the xsd classes on the server side (e.g. Order [server xsd] now
seems to be OrderBatchTypeOrder [object browser on the client side]) and I
suspect that this is what is causing the problem.  And roughly the names
reflect nesting level in the XML so OrderBatchType contains
OrderBatchTypeOrder which contains OrderBatchTypeOrderPhysicalGoods and so on.

However, if I example the asmx output in a browser it has the original
(OrderBatch, Order) names rather than ones which the client seems to expect
(OrderBatchType, OrderBatchTypeOrder).

Any suggestions would be appreciated.

Iain
Iain - 29 Nov 2007 10:05 GMT
More detail.

What I'm seeing with this problem is that the client side is naming child
classes in a concatenated way rather than sticking to the original names.

So if I have OrderBatch containing Order containing OrderLine (ie OrderBatch
has an Order[] Order variable), Methods which return an OrderBatch generate
class definitions named OrderBatchOrder and OrderBatchOrderLine.

But methods which return an Order generate class definitions named Order and
OrderOrderLine.

And although and OrderOrderLine have exactly the same structure they are, of
course, different types and so incompatible.

What is wierd is that the WSDL looks exactly as I would expect (with
OrderBatch, Order and OrderLine elements).  It's something on the client side
which is doing it.

I've tried deleting and re-Adding the Web Service and I've googled till my
fingers are numb, but to no avail.

Help!

Iain

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.