Soap Web服务在Visual Studio中返回null

时间:2015-05-25 14:27:57

标签: c# web-services soap

我正在调用一个不能在Visual Studio中运行的soap Web服务。它返回null,但soapUI返回一个值。我在visual studio中使用Web服务引用。当我将这个wsdl文件添加到soapUI它的工作并返回正确的数据作为响应,但在Visual Studio中它不起作用(找不到记录)。

   //request
   HotelBookingRequest request = new HotelBookingRequest();
   request.Profile = profile;
   request.PassengerDetails = passangers;
   request.HotelDetails = detail;

   XmlSerializer x1 = new XmlSerializer(typeof(HotelBookingRequest));
   TextWriter writer1 = new StreamWriter("HotelBookingRequest.xml");
   x1.Serialize(writer1, request);

   //response
   HotelServiceClient client = new HotelServiceClient();
   HotelBookingResponse response = client.HotelBooking(request);

   XmlSerializer x = new XmlSerializer(typeof(HotelBookingResponse));
   TextWriter writer = new StreamWriter("HotelBookingResponse.xml");
   x.Serialize(writer, response);

0 个答案:

没有答案