Help forming a client side SOAP request

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
beagle804
Forum Newbie
Posts: 3
Joined: Wed Mar 18, 2009 7:27 am

Help forming a client side SOAP request

Post by beagle804 »

Hello all. Admittedly I am quite new to the world of SOAP. I've got the basics covered and am able to communicate with the Soap Server that my client has provided. But I'm having some trouble forming data into the required arrays so that the request shows up in proper format at the server. This is a portion of a good call being passed to the server:

Code: Select all

<PostAssessment xmlns="http://www.server.com">
  <ProjectKey>ABCDE</ProjectKey>
  <UserName>JohnDoe</UserName>
  <Password>JDPassword</Password>
  <AssessmentOrderRequest xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <ClientId idOwner="DDI" xmlns="http://ns.hr-xml.org/2006-02-28">
      <IdValue name="Company">9876</IdValue>
      <IdValue name="Location">54321</IdValue>
      <IdValue name="Client Key">A-Client-Key</IdValue>
    </ClientId>
    <ClientOrderId idOwner="DDI" xmlns="http://ns.hr-xml.org/2006-02-28">
      <IdValue name="Client Order Number">Name-of-the-order</IdValue>
    </ClientOrderId>
  </AssessmentOrderRequest>
</PostAssessment>

The following snippet shows what I have so far...

Code: Select all

 
<?php
//....... snip
 
$ClientId['IdValue'] = array( 'name' => 'Company' );
 
$Request['ClientId'] = $ClientId;
 
$param=array(
'ProjectKey' => 'ABCDE',
'UserName' => 'JohnDoe',
'Password' => 'JDPassword',
'AssessmentOrderRequest' => $Request );
 
$result = $client->PostAssessment( $param );
 
//....... snip
 

When checking the __getLastRequest(), everything looks good up to that point. I just can't get the value "9876" assigned to <IdValue name="company">. Everything I've tried gets a response from the server like this:

<IdValue name="Company"/>


instead of this:

<IdValue name="Company">9876</IdValue>


If anyone can help point me in the right direction, I would greatly appreciate it.

Thanks in advance.
beagle804
Forum Newbie
Posts: 3
Joined: Wed Mar 18, 2009 7:27 am

Re: Help forming a client side SOAP request

Post by beagle804 »

Anyone?
Post Reply