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 / June 2004

Tip: Looking for answers? Try searching our database.

how to send objects with different namespaces to multiple Web Services

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
IanT - 29 Jun 2004 10:12 GMT
I have a problem where i would like to send the same object to 2 or
more different webservices which accept objects with exactly the same
structure. I realise that if we'd been wise we would have used the
same WSDL for each and i will do for future Development but for the
moment i have to consume a clients Service and have to make the best
of what i have.

The problem seems to be in the namespaces. Even though the objects are
structurally exactly the same they are obviously treated as different
types.

I would like to be able to convert a standard object so i can pass it
to both Services and hence avoid duplication.

To get around this i attempted to create a class which inherited from
a site specific class (from the proxy) and then populated itself from
a standard object but when i attempt to call the WebMethod i get the
following error.

"A first chance exception of type 'System.InvalidOperationException'
occurred in n-nbnq0s

Additional information: The type SSS_Generator.schemas.MyType was not
expected. Use the XmlInclude or SoapInclude attribute to specify types
that are not known statically."

This problem is generated by the WebProxy - it never actually gets
sent to the Web Service.

At the moment the only solution open to me is to write a function to
populate the class generated by the WebProxy from another standard
class which is structurally identical.

Does anyone have any other ideas?

many thanks

Ian
Dino Chiesa [Microsoft] - 30 Jun 2004 05:36 GMT
yes, read the article "sharing types" on MSDN from July 2002.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnservice/html/
service07162002.asp


That may help.

More generally, the client's WSDL should be architected so that data schema
is independent of the interface.  The WSDL should import XSD files that
describe the schema.  then you can also have a 2nd WSDL that imports the
same XSD's, as well as other XSDs.

If each XSD is defined with its own namespace, then you will be able to
share the corresponding types across clients, servers, etc.

-D

> I have a problem where i would like to send the same object to 2 or
> more different webservices which accept objects with exactly the same
[quoted text clipped - 34 lines]
>
> Ian

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.