Webreference vs servicereference. Why ony one works ?
Posted
by phenevo
on Stack Overflow
See other posts from Stack Overflow
or by phenevo
Published on 2010-04-23T08:06:46Z
Indexed on
2010/04/23
8:23 UTC
Read the original article
Hit count: 373
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);
© Stack Overflow or respective owner