I trying to call a .Net webservice but get the following error:
Array ( [faultcode] => soap:Client [faultstring] => Value cannot be null. Parameter name: username [detail] => ) |
here is the wsdl file of the webservice I'm trying to call:
POST /WebSetup1/CAIRegister.asmx HTTP/1.1
Host: 172.18.22.181
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://tempuri.org/Execute"
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<Execute xmlns="http://tempuri.org/">
<userContext>
<Username>string</Username>
<UserPassword>string</UserPassword>
<ApplicationMnemonic>string</ApplicationMnemonic>
<ApplicationPassword>string</ApplicationPassword>
</userContext>
<registrationRequest>
<Identifiers xmlns="http://www.ampath.co.za/SOAPheaders">
<IdentifiersItem>string</IdentifiersItem>
<IdentifiersItem>string</IdentifiersItem>
</Identifiers>
<Type xmlns="http://www.ampath.co.za/SOAPheaders">string</Type>
<FirstName xmlns="http://www.ampath.co.za/SOAPheaders">string</FirstName>
<LastName xmlns="http://www.ampath.co.za/SOAPheaders">string</LastName>
<EmailAddress xmlns="http://www.ampath.co.za/SOAPheaders">string</EmailAddress>
<ContactNumber xmlns="http://www.ampath.co.za/SOAPheaders">string</ContactNumber>
<Status xmlns="http://www.ampath.co.za/SOAPheaders">string</Status>
</registrationRequest>
</Execute>
</soap:Body>
</soap:Envelope>
|
Here is my code to call the webservice:
$userContext=array('userContext'=>array('Username'=>'dieter', 'UserPassword'=>'11Linux', 'AplicationMnemonic'=>'EURES', 'ApplicationPassword'=>'P@ssword'));
$registrationRequest = array('registrationRequest'=>array('Identifiers'=>array('IdentifiersItem'=>'Id1'), 'Type'=> 'Doctor', 'FirstName'=>'Dieter', 'LastName'=>'Munnik', 'EmailAddress'=>'dieter@ampath.co.za', 'ContactNumber'=>'0823389194','Status'=>'Pending'));
try{
$c = new soapclient("http://172.18.22.181/WebSetup1/CAIRegister.asmx?wsdl",true);
$lv = $c->call('Execute',$userContext,$registrationRequest);
print_r($lv);
}catch(SoapFault $fault){ echo "SoapFault: ".$fault;} print_r($lv);
|