PC Review


Reply
Thread Tools Rate Thread

Derive a WebService Proxy Class

 
 
Michael
Guest
Posts: n/a
 
      11th Sep 2006
Hi

I use VS.NET 2005.
I generated a Proxy file (reference.vb) with the build in WSDL
Generator -> so far so good.
I have to provide some classes from that to COM via the interop-layer
-> okay.

There are some (data)classes with members declared as
System.Nullable(Of Long).
The problem is this members are not exported to the COM-Interface
trough the interop-layer.
That is right because you can't set a long variable for instance in
Visual Basic to null, because it is a primitive type.
My Idea is now to make my own COM-Classes from deriving this
Proxy-Classes and check with an addition porperty parameter if the
VB-Client wants to set a long member to null.
so far so good, but when i call a webservice (via the proxy file with
the invoke method) and my COM-Data Class then i get an XML-Serializer
error.
Another point behind this idea with the separated COM-Class is the
independency of proxy which will be always overriden by the WSDL
generator when i recreate (update) the proxy !!!
I tried to cast my COM-Class to the proxy class, but that doesn't
really work !!!

Maybe there is complete another idea to provide this functionality.

please help
thx in advance
michael

 
Reply With Quote
 
 
 
 
Cowboy \(Gregory A. Beamer\)
Guest
Posts: n/a
 
      12th Sep 2006
There is nothing inherently wrong with setting up a translation layer to
abstract the web proxy. In fact, in many instances, it is precisely what you
would want to do. There is no need, however, to add properties to represent
the null, at least not on the .NET side, and you might be able to represent
the null in other ways on the COM side (for example, if valid values on your
long are always positive, set a negative to indicate null -- this has to be
documented in case the system ever has to change).

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

*************************************************
Think outside of the box!
*************************************************
"Michael" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi
>
> I use VS.NET 2005.
> I generated a Proxy file (reference.vb) with the build in WSDL
> Generator -> so far so good.
> I have to provide some classes from that to COM via the interop-layer
> -> okay.
>
> There are some (data)classes with members declared as
> System.Nullable(Of Long).
> The problem is this members are not exported to the COM-Interface
> trough the interop-layer.
> That is right because you can't set a long variable for instance in
> Visual Basic to null, because it is a primitive type.
> My Idea is now to make my own COM-Classes from deriving this
> Proxy-Classes and check with an addition porperty parameter if the
> VB-Client wants to set a long member to null.
> so far so good, but when i call a webservice (via the proxy file with
> the invoke method) and my COM-Data Class then i get an XML-Serializer
> error.
> Another point behind this idea with the separated COM-Class is the
> independency of proxy which will be always overriden by the WSDL
> generator when i recreate (update) the proxy !!!
> I tried to cast my COM-Class to the proxy class, but that doesn't
> really work !!!
>
> Maybe there is complete another idea to provide this functionality.
>
> please help
> thx in advance
> michael
>



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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
Webservice proxy class issues.. Ivan Microsoft C# .NET 0 3rd Mar 2009 02:44 PM
How do I derive a class from Socket class. Valerie Hough Microsoft Dot NET Framework 1 7th Oct 2007 04:37 AM
How to create a proxy class for a webservice? joymac Microsoft Dot NET 0 9th Feb 2007 10:21 AM
casting from base class to derive class Locia Microsoft C# .NET 2 17th Sep 2005 01:29 AM
how to derive class from generic Image class Marcin Kowalewski Microsoft C# .NET 3 22nd Aug 2003 08:10 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:33 PM.