I have working PHP code which calls a SOAP service and it works. Its as follows:
<?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;
}
?>
I need to access the same service from C#. I have tried adding Service Reference
to http://108-168-196-91.mycitrixdemo.net/zdm/services/EveryWanDevice?wsdl
and this added the following section in my 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>
I am now provided with the proxy classes but I dont know how to set them up so I could call this service.
I am doing it as follows in C#:
DeviceService srv = new DeviceServiceClient();//
srv.authenticateUser(new authenticateUserRequest("Admin", "XXXXXX"));
var devices = srv.getDeviceProperties(new getDevicePropertiesRequest("99000067296308", null));
But the srv.authenticateUser
line throws the following exception:
RPC Message getDeploymentHistoRequest1 in operation getDeploymentHisto1 has an invalid body name getDeploymentHisto. It must be getDeploymentHisto1
I have no idea what does this error mean. Can anybody help?