tags:

views:

31

answers:

0

I'm trying to integrate with the Articulate Online SOAP API (https://www.articulate-online.com/Services/Api/1.0/Documentation/TOC.aspx) on a PHP4 server using the NuSOAP (http://sourceforge.net/projects/nusoap/) client.

I've done NuSOAP integrations in the past without much effort, but this one seems to be more troublesome due to the complex data types in the request.

For example, consider the CreateUsers call: https://www.articulate-online.com/Services/Api/1.0/Documentation/CreateUsers.aspx https://www.articulate-online.com/services/api/1.0/ArticulateOnline.asmx?wsdl

I have to send a complex data type for the Credentials, so I have to utilize the soapval class to generate them.

Here's what I'm doing so far... Please excuse the poor naming.

$e = new soapval( 'EmailAddress', 's:string', AO_EMAIL_ADDRESS );
$p = new soapval( 'Password', 's:string', AO_PASSWORD );
$u = new soapval( 'CustomerID', 's:string', AO_CUSTOMER_ID );
$c = new soapval( 'Credentials', 'tns:Credentials', array( $e, $p, $u ) );

$ems = new soapval( 'Emails', 'tns:ArrayOfString', array( new soapval( 'string', 's:string', $email ) ) );
$agp = new soapval( 'AutoGeneratePassword', 's:boolean', TRUE );
$sle = new soapval( 'SendLoginEmail', 's:boolean', TRUE );

$r = new soapval( 'CreateUsersRequest', 'tns:CreateUsersRequest', array( $c, $ems, $agp, $sle ) );

$result = $this->client->call(
  'CreateUsers',
  $r->serialize('literal')
);

That bit of code generates the XML available at: http://pastie.org/private/uju3vpn7j4ucq8zy85gqmw . The only thing I can really notice different there is vs. simply . However, that seems to matter, and I can't figure out how to get NuSOAP to generate it out the same way.

Totally at a loss here.