1

I'm trying to make a simple request. It works in SoapUI now trying to transfer to php.

SoapUI generated envelope(this works):

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:HPD_IncidentInterface_WS">
   <soapenv:Header>
      <urn:AuthenticationInfo>
         <urn:userName>USERNAME</urn:userName>
         <urn:password>PASSWORD</urn:password>
         <!--Optional:-->
         <urn:authentication>?</urn:authentication>
         <!--Optional:-->
         <urn:locale>?</urn:locale>
         <!--Optional:-->
         <urn:timeZone>?</urn:timeZone>
      </urn:AuthenticationInfo>
   </soapenv:Header>
   <soapenv:Body>
      <urn:HelpDesk_QueryList_Service>
         <urn:Qualification></urn:Qualification>
         <urn:startRecord></urn:startRecord>
         <urn:maxLimit>10</urn:maxLimit>
      </urn:HelpDesk_QueryList_Service>
   </soapenv:Body>
</soapenv:Envelope>

The php:( I can run $fcs = $client->__getFunctions(); and get the functions but the $result function wont run. Getting no error messages)

$client = new SoapClient($url,array("userName" => $username, "password" => $password));
$result = $client->HelpDesk_QueryList_Service(array('Qualification' => '', 'startRecord' => '','maxLimit' => '10'));
1
  • Dumb me didnt think of looking at php log. [08-Sep-2014 17:28:04 America/Denver] PHP Fatal error: Uncaught SoapFault exception: [soapenv:Server.userException] ARERR [149] A user name must be supplied in the control record in D:\LeprinoNetDev\serviceDesk\webServiceTest\index.php:16 Stack trace: #0 D:\LeprinoNetDev\serviceDesk\webServiceTest\index.php(16): SoapClient->__call('HelpDesk_Query_...', Array) #1 D:\LeprinoNetDev\serviceDesk\webServiceTest\index.php(16): SoapClient->HelpDesk_Query_Service(Array) #2 {main} thrown in D:\LeprinoNetDev\serviceDesk\webServiceTest\index.php on line 16 Commented Sep 9, 2014 at 14:23

1 Answer 1

1

Did alot more search and testing and got the write code for the connection.

$client = new SoapClient($url);
$headerbody = array('userName' => $username, 
                    'password' => $password,
                    'authentication'=>'',
                    'locale'=>'',
                    'timeZone'=>'');     
$header = new SOAPHeader($ns, 'AuthenticationInfo', $headerbody);        
$client->__setSoapHeaders($header)
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.