Webservices sharing types with client Apps (and BLTs :) )

  • Thread starter Thread starter Rory Becker
  • Start date Start date
R

Rory Becker

I have a businessLogic Assembly (BL) which contains a Type (BLT).

I have a WindowsForms App which uses BL and the Type BLT within it

I also have a WebService which also uses BL and BLT

I would like my WinApp to be able to reference the WebService and make a
call into it that returns list(Of BLT) and then use that list within the
WinApp as if it had been created there.

However the webservice proxy object wrapped arount the List(Of BLT) is such
that the WinApp cannot use it as a List(Of BLT).

What is the correct way to do this?


Thanks in Advance
 
Hi Rory,

Based on my experience, the problem you mentioned is due to the natural
behavior of webservice and its client-side proxy generator. Webservice is
an interopable distribute component, its client consumer app should be able
to consume it via the WSDL document and generate the proxy class depend on
the WSDL document. And the client application maybe of heterogenous
platform(non-.NET).

So for your scenario, you'll find by default the .NET generated proxy will
produce its own wrapper classes for those custom classes used in the
webservice(as parameter or return value). If you want to replace them with
your own types(so as to share them with other projects), you can consider
the following ones:

** still generate the proxy through Add WebReference

** manually change the Types (of the parameters or return values) in the
generated proxy's source code

** however, to make the change persisted(not changable when you update the
proxy), you can use a partial class file for the proxy and add your own
methods(with changed types) in that partial class file.

Some reference article and thread that may help you:

#How to customize the Web Service proxy generated by wsdl.exe (or add web
references)
http://news.speeple.com/msdn.com/2007/09/01/how-to-customize-the-web-service
-proxy-generated-by-wsdl-exe-or-add-web-references.htm

http://groups.google.com/group/microsoft.public.dotnet.framework.webservices
/browse_thread/thread/bc7bb2a6c63b538f/7de622dd21265625

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead



==================================================

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.



Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.

==================================================


This posting is provided "AS IS" with no warranties, and confers no rights.







--------------------
Date: Wed, 20 Feb 2008 14:48:28 +0000 (UTC)
Message-ID: <[email protected]>
From: Rory Becker <[email protected]>
Subject: Webservices sharing types with client Apps (and BLTs :) )
 
Back
Top