SOAP 서비스를 호출하는 PHP 코드가 작동하며 작동합니다. 그것의 다음과 같습니다 :C#에서 비누 서비스 호출
<?php
try
{
$client = new SoapClient(null, array(
'location' => "http://108-168-196-91.mycitrixdemo.net/zdm/services/EveryWanDevice?wsdl",
'uri' => "http://zdemo2.zenprise.com",
'login' => "Admin",
'password'=> "XXXXX"));
$properties=$client->getDeviceProperties("XXXXXXXX",null);
for($i=0;$i<count($properties);$i++) {
printf ("name: %s, value: %s\n" , $properties[$i]->name, $properties[$i]->value);
}
}
catch (Exception $e)
{
print_r($e); exit;
}
?>
나는 C#에서 동일한 서비스에 액세스해야합니다. 나는 Service Reference
을 http://108-168-196-91.mycitrixdemo.net/zdm/services/EveryWanDevice?wsdl
에 추가하려고 시도했는데 이것은 내 app.config에 다음 섹션을 추가했습니다.
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="EveryWanDeviceSoapBinding" />
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://108-168-196-91.mycitrixdemo.net/zdm/services/EveryWanDevice"
binding="basicHttpBinding" bindingConfiguration="EveryWanDeviceSoapBinding"
contract="ServiceReference1.DeviceService" name="EveryWanDevice" />
</client>
</system.serviceModel>
이제 프록시 클래스가 제공되지만이 서비스를 호출 할 수 있도록 설정하는 방법을 알지 못합니다. 내가으로 그 일을하고
는 C#으로 다음과
DeviceService srv = new DeviceServiceClient();//
srv.authenticateUser(new authenticateUserRequest("Admin", "XXXXXX"));
var devices = srv.getDeviceProperties(new getDevicePropertiesRequest("99000067296308", null));
그러나 srv.authenticateUser
라인은 다음과 같은 예외가 발생합니다 :
RPC Message getDeploymentHistoRequest1 in operation getDeploymentHisto1 has an invalid body name getDeploymentHisto. It must be getDeploymentHisto1
나는이 오류가 의미합니까 무엇인지 전혀 모른다. 아무도 도와 줄 수 있니?