NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
Need help with client call to webservice


Joined: 03 May 2010
Posts: 1
Reply with quote
I trying to call a .Net webservice but get the following error:
Code:
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:
Code:

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:
Code:

$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);

View user's profileFind all posts by dietermSend private message


Joined: 07 Jun 2007
Posts: 62
Location: Albuquerque, NM, USA
Reply with quote
I'm not sure if this will help, but perhaps the parameters are case sensitive?

I see the error message states "username", where as you are sending "Username".

Hope this helps.
View user's profileFind all posts by skalirSend private messageVisit poster's websiteAIM AddressYahoo MessengerICQ Number
Need help with client call to webservice
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic