Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Services > Typed dataset used by two webservices problem

Reply
Thread Tools

Typed dataset used by two webservices problem

 
 
Simon Storr
Guest
Posts: n/a
 
      02-23-2004
I have two webservices, for arguments sake FredWS and JimWS. They both
contain webmethods which have a typed dataset JoeDataset as a parameter. If
I add a web reference to FredWS (called FredWSProxy) then a class named
FredWSProxy.JoeDataset will be created mapping to JoeDataset (similarly
JimWSProxy.JoeDataset for a web reference to JimWS).

Now in my web app I have a function which calls FredWS returning a
FredWSProxy.JoeDataset. The problem arises when I want to pass this dataset
to JimWSProxy - I can't due to an invalid typecast! Is there a way around
this or do I really have to move all my code into one big webservice?

Also the code generated by the typed dataset xsd generator is huge - is
there any way to 'turn off' sections of code that we don't use from being
generated (all the async stuff for instance?)

Thanks in advance,

Simon


 
Reply With Quote
 
 
 
 
richlm
Guest
Posts: n/a
 
      02-23-2004
One approach I have seen is not to pass dataset directly, but wrap it in an
XML document
e.g.
[WebMethod]
public XmlDocument GetJoeDataset()
{
return new XmlDataDocument(_JoeDataset);
}

You'll still have to do the work of type checking against a XML schema - we
have moved from compile-time-type-checking to run-time-type-checking.
If you have an .xsd you can still re-create a dataset at the client, if
that's what you need.
Here's a couple of articles that discuss this approach:
http://msdn.microsoft.com/msdnmag/is...s/default.aspx
http://msdn.microsoft.com/library/de...ce02112003.asp

It is not just the proxy code that is huge - the serialized message can be
pretty big too - which the above approach does not solve.

Another "idea" (quick & dirty solution...) could be to use Dataset.Merge to
perform the type conversion. Of course this is a deep copy - but then so is
serializing across the wire, so if you can accept the overhead perhaps this
might work for you.

I prefer to think of web services as a message-based protocol more than a
RPC-type protocol - and therefore serialized XML (which I control) often
fits more naturally than complex types (especially ones native to .NET).
That's just my opinion - there are of course many viewpoints on this.

Hope this helps.
Richard.


"Simon Storr" <(E-Mail Removed)> wrote in message
news:eASJ0Zi%(E-Mail Removed)...
> I have two webservices, for arguments sake FredWS and JimWS. They both
> contain webmethods which have a typed dataset JoeDataset as a parameter.

If
> I add a web reference to FredWS (called FredWSProxy) then a class named
> FredWSProxy.JoeDataset will be created mapping to JoeDataset (similarly
> JimWSProxy.JoeDataset for a web reference to JimWS).
>
> Now in my web app I have a function which calls FredWS returning a
> FredWSProxy.JoeDataset. The problem arises when I want to pass this

dataset
> to JimWSProxy - I can't due to an invalid typecast! Is there a way around
> this or do I really have to move all my code into one big webservice?
>
> Also the code generated by the typed dataset xsd generator is huge - is
> there any way to 'turn off' sections of code that we don't use from being
> generated (all the async stuff for instance?)
>
> Thanks in advance,
>
> Simon
>
>



 
Reply With Quote
 
 
 
 
Yan-Hong Huang[MSFT]
Guest
Posts: n/a
 
      02-26-2004
Hello Simon,

Do you have any more concerns on Richard's suggestion? Please feel free to
post here if there is any more questions.

Thanks very much.

Best regards,
Yanhong Huang
Microsoft Community Support

Get Secure! ĘC www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Difference Between Typed Dataset and Untyped Dataset thomson ASP .Net 2 01-19-2005 08:16 AM
Converting a generic Dataset to a typed dataset William Gower ASP .Net 2 07-26-2004 10:14 PM
copying a datatable content from an untyped dataset into a table which is inside a typed dataset Nedu N ASP .Net 2 10-31-2003 01:05 PM
Ccopying a datatable content from an untyped dataset into a table which is inside a typed dataset Nedu N ASP .Net 1 10-31-2003 02:39 AM



Advertisments