php soapclient to c#

本文关键字:to soapclient php | 更新日期: 2023-09-27 17:49:39

<?php
$client = new SoapClient(null, array('location' => "http://www.progez.com/demo/webservice/wsHotel.sh",'uri' => "http://www.progez.com/demo/", 'encoding' =>"ISO-8859-9"));
$parm['login'] = "USERNAME";
$parm['pass'] = "PASSWORD";
$parm['agency_code'] = "ADM";
$parm['letters'] = "bodrum";
$inf =($client->__soapCall("destinationListByLetterV2",array($parm)));
print_r($inf);
?>

如何转换c#代码?

php soapclient to c#

您首先通过指向web服务WSDL,使用Visual Studio中的svcutil.exe或Add Service引用对话框生成强类型代理。这将生成一个强类型客户端,允许您使用该服务。然后消费:

using (var client = new SomeServiceClient())
{
    var result = client.destinationListByLetterV2("USERNAME", "PASSWORD", "ADM", "bodrum");
}