Hi Ian,
This is tricky. It's actually one of the tenets of Service Orientation
that Web Services share schema (i.e. the shape of the object) and not
type (an implementation).
However, sometimes we developers who are lucky enough to have control
of both sides of the service boundary may want to reuse our classes in
the way you describe. I've done the same thing in the past by
generating the web service proxy myself (using WSDL.exe) and adding it
to my project just like any other .cs file. Then you can simply jump in
and make some gentle changes to use of foo instead of ws.foo. It's that
easy.
Let me know how you get on.
Josh
http://www.thejoyofcode.com/
Kolbis Guy - 28 Mar 2006 18:00 GMT
Hi Josh,
You are right when you say that they should share schema.
However, what should you do when updating a web reference?
And how can you share schema in this case?
> Hi Ian,
>
[quoted text clipped - 14 lines]
> Josh
> http://www.thejoyofcode.com/
Josh Twist - 29 Mar 2006 08:03 GMT
Hello again all,
Yes, updating web reference is the caveat to this. If you 'update the
web reference' you need to reimplement your changes.
The new SchemaImporterExtension is something I've been meaning to look
at for a while now and not got round to it (I wanted to enhance this to
automate it such that it scans your .sln for projects with matching
classes but I need to somehow get information from devenv.exe into
wsdl.exe - one day :).
At the end of the day it's all a trade-off, choose which one suits you.
My WSDLs are designed up front so don't change too often, hence I don't
mind reimplimenting a few classes here and there when they do.
Josh
http://www.thejoyofcode.com/
IanH - 28 Mar 2006 19:00 GMT
I have been down the manual wsdl route before and was trying to avoid it again.
Thank for reminding me about the SOA principle, it takes the pain away
slightly, i guess the thing to really do is, just like Kolbis suggests and
implement a facade wrapper to really hide and abstract the entire we service
implementation.
Still seems a little strange as the objects were initially generated from
XML schemas - i think this may be explained by subtle differences between
2003 and 2004 serialisation.
Thanks anyway.
> Hi Ian,
>
[quoted text clipped - 14 lines]
> Josh
> http://www.thejoyofcode.com/
Ashish - 29 Mar 2006 00:35 GMT
you can create a component from SchemaImporterExtension class and
register it on the development machine, look at this article
http://www.microsoft.com/belux/nl/msdn/community/columns/jdruyts/wsproxy.mspx
hth
> I have been down the manual wsdl route before and was trying to avoid it again.
> Thank for reminding me about the SOA principle, it takes the pain away
[quoted text clipped - 26 lines]
>>Josh
>>http://www.thejoyofcode.com/
Tobias - 10 Mar 2008 12:16 GMT
Hello,
I have the same problem and I solved most of it by implementing my own
SchemaImporterExtension class.
However the only type that it doesn't work with are Typed DataSets
This i a really huge problem !
Has anyone been able to solve this ?
I have searched around a lot and can't seem to find any information
that would solve this problem, only unanswered questions about it.
( http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=374848&SiteID=1 )
I would really appreciate any help about this.
Best regards
Tobias
Softronic
(valid MSDN subscription)
> you can create a component from SchemaImporterExtension class and
> register it on the development machine, look at this article
[quoted text clipped - 33 lines]
> >>Josh
> >>http://www.thejoyofcode.com/
John Saunders [MVP] - 10 Mar 2008 18:25 GMT
> Hello,
>
[quoted text clipped - 10 lines]
>
> I would really appreciate any help about this.
My best advice would be to not use DataSet at all.
See
http://www.hanselman.com/blog/ReturningDataSetsFromWebServicesIsTheSpawnOfSatanA
ndRepresentsAllThatIsTrulyEvilInTheWorld.aspx
for a point of view similar to mine on the subject.

Signature
--------------------------------------------------------------------------------
John Saunders | MVP - Windows Server System - Connected System Developer
Tobias - 11 Mar 2008 11:18 GMT
> > Hello,
> >
[quoted text clipped - 16 lines]
> http://www.hanselman.com/blog/ReturningDataSetsFromWebServicesIsTheSpawnOfSatanA
ndRepresentsAllThatIsTrulyEvilInTheWorld.aspx
> for a point of view similar to mine on the subject.
Well, thank you for your input ;-)
But unfortunately, it doesn't matter how much I agree with you
because I am in this situation and don't have a choice but to use Typed
DataSets.
Have started to write our own custom tool that "cleans" the proxy class from
DataSets and inserting Using statements instead.
But if anyone has any other ideas ? I would certanly like to hear about them.
/Tobias