Webreference vs servicereference. Only one works ? Serialization ?
- by phenevo
Hi,
I've got two applications.
One uses webreference to my webservice, and second use servicereference to my webservice.
There is metohod which I'm invoking:
[WebMethod]
public Car[] GetCars(string carCode)
{
Cars[] cars= ModelToContract.ToCars(MyFacade.GetCars(carCode);
return cars;
}
Car has two pools:
string Code {get;set;}
CarType Type {get;set;}
public enum CarType
{
Van=0,
Pickup=1
}
I'm debuging this webMethod, and...
at the end webservice throw good collection of cars, which has one car:
code="bmw",Type.Van
But...
Application with webrefence receives the same collection
and application with servicereference gets collection, where field code is null...
Invoking servicereference:
MyService myService=new MyService()
Cars[] cars= client.GetCars(carcode);
Invoking webservice:
MyService.MyServiceSoapClient client = new MyServiceS.MyServiceSoapClient();
Cars[] cars= client.GetCars(carcode);