Hello all
We have an SOA application that includes an ASP.NET webservice and WinForms
client. My question is regarding the use of Add Web Reference in Visual
Studio. The tool is nice because it easilly creates and updates the
client-side proxies that we need to communicate with the webservice. The
problem is that our webservice methods accept and return business objects
and when generating the proxies, VS creates scoped versions of these
business objects for use with the webservice methods.
It is undesirable to have the proxy generator create these business objects
for several reasons:
1. There are some references to business objects that exist on separate
webservices. For example, Customer.asmx has a GetCustomer method that
returns a Customer object and Invoicing.asmx has a CreateInvoice method that
takes a Customer object. These are the same customer object in both cases,
so it would make sense that we could call Customer.GetCus tomer and then pass
the Customer object to Invoicing.Creat eInvoice. The problem is that the
proxy generator creates scoped versions of Customer when generating the
proxy for both webservices, which means a CustomerProxy.C ustomer cannot be
passed to a method expecting a InvoicingProxy. Customer.
2. The business objects contain helper methods that should ideally be
available to the client application, so we'd like to continue to reference
the business object library from the client as well.
3. The web service proxy generator changes properties to fields in the
business objects. This prevents the WinForms combobox from being able to
databind to a collection of the object with the DisplayMember and
ValueMember properties set.
For this reason, it seems ideal that the Client and Webservice should both
reference the same business object class library, and that the Add Web
Reference tool NOT create scoped versions of the business objects. Right
now, we are getting around the behavior of Add Web Reference by using
WSDL.exe to generate a proxy class and then removing the business object
definitions by hand. This is a bit tedious, however, and I would like to be
able to use Add Web Reference's functionality to both add new proxies and
update existing ones as the webservice changes.
Does anyone have any advice on what we can do here?
Thanks,
Eric
We have an SOA application that includes an ASP.NET webservice and WinForms
client. My question is regarding the use of Add Web Reference in Visual
Studio. The tool is nice because it easilly creates and updates the
client-side proxies that we need to communicate with the webservice. The
problem is that our webservice methods accept and return business objects
and when generating the proxies, VS creates scoped versions of these
business objects for use with the webservice methods.
It is undesirable to have the proxy generator create these business objects
for several reasons:
1. There are some references to business objects that exist on separate
webservices. For example, Customer.asmx has a GetCustomer method that
returns a Customer object and Invoicing.asmx has a CreateInvoice method that
takes a Customer object. These are the same customer object in both cases,
so it would make sense that we could call Customer.GetCus tomer and then pass
the Customer object to Invoicing.Creat eInvoice. The problem is that the
proxy generator creates scoped versions of Customer when generating the
proxy for both webservices, which means a CustomerProxy.C ustomer cannot be
passed to a method expecting a InvoicingProxy. Customer.
2. The business objects contain helper methods that should ideally be
available to the client application, so we'd like to continue to reference
the business object library from the client as well.
3. The web service proxy generator changes properties to fields in the
business objects. This prevents the WinForms combobox from being able to
databind to a collection of the object with the DisplayMember and
ValueMember properties set.
For this reason, it seems ideal that the Client and Webservice should both
reference the same business object class library, and that the Add Web
Reference tool NOT create scoped versions of the business objects. Right
now, we are getting around the behavior of Add Web Reference by using
WSDL.exe to generate a proxy class and then removing the business object
definitions by hand. This is a bit tedious, however, and I would like to be
able to use Add Web Reference's functionality to both add new proxies and
update existing ones as the webservice changes.
Does anyone have any advice on what we can do here?
Thanks,
Eric
Comment