0

I am trying to send the object through a method api of web service. As service is binded by BasichttpBinding.

OneClickOrder OneClick = new OneClickOrder();
OneClick.Mobile = Session["Mobile"].ToString();
OneClick.OrderDetailsList = OrderDetailsList.ToArray();
OneClick.OrderId = 10000;
OneClick.PromoSiteId = PromoSiteId;
OneClick.TotalPrice = Convert.ToInt32(lblafterDiscount.Text);
var OrderResponse = service.OneClickOrder(OneClick);

While using service API, I got an SOAP exception

The formatter threw an exception while trying to deserialize the message: There was an error while trying to deserialize parameter http://tempuri.org/:order. The InnerException message was 'Error in line 1 position 588. 'EndElement' 'order' from namespace 'http://tempuri.org/' is not expected. Expecting element 'Mobile'.'. Please see InnerException for more details.

I didn't get what could be wrong. Is this a problem of Service Side or client side? And i am currently working at client side.

4

1 回答 1

0

问题是您的 DataContract 类OneClickOrder在服务器和客户端上都不相同。

在客户端,它与服务器不同。因此,请检查您的 OneClickOrder DataContract 类,在服务器和客户端上是否相同。

于 2012-09-06T07:34:26.637 回答