使用C#连接到SOAP API

时间:2019-05-04 11:10:30

标签: c# soap

我正在尝试实现客户端以访问https://vendor-ctrip.fws.ctripqa.com/Hotel/OTAReceive/HotelStaticInfoService.asmx上的api。

但是我不知道如何将凭据和其他参数传递给Web服务。

我设法使用c#设置了控制台应用程序,并将该服务添加为连接服务。

// endpoint
HotelStaticInfoServiceSoapClient.EndpointConfiguration endpoint = new HotelStaticInfoServiceSoapClient.EndpointConfiguration();
// client
HotelStaticInfoServiceSoapClient client = new HotelStaticInfoServiceSoapClient(endpoint);
// request
OTA_HotelDescriptiveContentNotifRQ dreq = new OTA_HotelDescriptiveContentNotifRQ();
//response
HotelDescriptiveContentNotifResponse dres = await client.HotelDescriptiveContentNotifAsync(dreq);

任何人都可以指引我正确的方向。

0 个答案:

没有答案