Does that title mean anything to anyone? I'm frustrated with this .net thing now.
I'm using .net 2.0 for web service and web application.
I have a class library which contains class for my common data structures (not structs, but classes).
Something like:
I include this class library in both the web app and the web service where they use it for whatever they need.
Now in the webservice I have a method like this:
Add reference to the web service in the web application and it generates the service proxies with new classes for the data objects which obviously conflicts with the classes in my common class library.
On the client web application I am just trying to do the following:
I'm basically trying to share a common type library between web service and its client/consumer, but ofcourse this idea goes against the whole idea of SOAP, etc, etc.
Is there some elegant way to handle this?
I've found some options. The first involves manually altering the reference.cs file for the webservice reference in the web application and switching out all references to the client proxy types with the matching data classes in the class library, but this will fail whenever the web reference is updated.
The other option is to switch the .net 2.0 web service to a WCF service and use DataContract, etc, but unfortunately I don't have the liberty of using 3.0/3.5.
If anyone has a good/clean/elegant solution to sharing a common data class/type library between a webservice and the client then please let me know how you did it.
It seems to be a fairly common annoyance, but not many solutions out there.
I'm using .net 2.0 for web service and web application.
I have a class library which contains class for my common data structures (not structs, but classes).
Something like:
Code:
namespace moocow {
public class moocowData_A
{
public string Value { get; set; }
}
public class moocowData_B
{
public string Value { get; set; }
}
}
I include this class library in both the web app and the web service where they use it for whatever they need.
Now in the webservice I have a method like this:
Code:
[WebMethod]
public moocowData_B ProcessCowFromAtoB(moocowData_A some_adata)
{
moocowData_B some_bdata = ShakeItUp(some_adata);
return some_bdata;
}
Add reference to the web service in the web application and it generates the service proxies with new classes for the data objects which obviously conflicts with the classes in my common class library.
On the client web application I am just trying to do the following:
Code:
thatMoocowService tms = new thatMoo...
moocow.moocowData_A = new moocow.moocowData_A();
// set some values in it and then send to web service which has the same class library dll reference
moocow.moocowData_B = tms.ProcessCowFromAtoB(mcd_a);
I'm basically trying to share a common type library between web service and its client/consumer, but ofcourse this idea goes against the whole idea of SOAP, etc, etc.
Is there some elegant way to handle this?
I've found some options. The first involves manually altering the reference.cs file for the webservice reference in the web application and switching out all references to the client proxy types with the matching data classes in the class library, but this will fail whenever the web reference is updated.
The other option is to switch the .net 2.0 web service to a WCF service and use DataContract, etc, but unfortunately I don't have the liberty of using 3.0/3.5.
If anyone has a good/clean/elegant solution to sharing a common data class/type library between a webservice and the client then please let me know how you did it.
It seems to be a fairly common annoyance, but not many solutions out there.