Jump to content

WSDL, Web Service Client, ComplexType


SABmore

Recommended Posts

I'm able to consume a local WSDL into PHP, and pass/return basic data successfully, but when I attempt to pass in objects that correspond to a complextype in the WSDL, I get the following error:

 

SoapFault exception: [soapenv:Server] javax.xml.ws.WebServiceException: com.ibm.websphere.sca.ServiceRuntimeException: An error occurred while parsing native data: The error message is: java.lang.IllegalArgumentException: Mismatched parameter count: expecting 1 items, but got more.. Caused By: java.lang.IllegalArgumentException: Mismatched parameter count: expecting 1 items, but got more.: caused by: An error occurred while parsing native data: The error message is: java.lang.IllegalArgumentException: Mismatched parameter count: expecting 1 items, but got more.. Caused By: java.lang.IllegalArgumentException: Mismatched parameter count: expecting 1 items, but got more. in C:\wamp\www\SugarCE\testSOAPShawn.php:65 Stack trace: #0 [internal function]: SoapClient->__call('establishIdenti...', Array) #1 C:\wamp\www\SugarCE\testSOAPShawn.php(65): SoapClient->establishIdentity(Object(stdClass), Object(stdClass)) #2 {main}

 

Here is the snippets from the WSDL:

 

<xsd:element name="establishIdentity">
−
<xsd:complexType>
−
<xsd:sequence>
−
<xsd:element name="processId" nillable="true" type="xsd:string">
−
<xsd:annotation>
−
<xsd:documentation>
Identifies a specific instance of the dialogue process.  Returned from the start() operation.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
−
<xsd:element name="identityAttributes" nillable="true" type="bons1:IdentityAttributes">
−
<xsd:annotation>
−
<xsd:documentation>
Key identifying attributes of a program participant.
</xsd:documentation>
</xsd:annotation>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>

 

Here is my code with comments where the error occurs:

 

<?php
set_time_limit(0);
require_once('nusoap.php');

$client = new SoapClient('C:\wsdl\BenefitDeterminationProcess_BenefitDialogueServiceSOAP.wsdl', array('trace' => 1));

$start = $client->__soapCall('start', array(new SoapParam((string)'GenesisID', 'prefix')),
        array('soapaction' => 'C:\wsdl\BenefitDeterminationProcess_BenefitDialogueServiceSOAP\start'));

$processID = $start;

$exchange = $client->__soapCall('exchangeOptions', array(new SoapParam($processID, 'processId')),
        array('soapaction' => 'C:\wsdl\BenefitDeterminationProcess_BenefitDialogueServiceSOAP\exchangeOptions'));

$identityAttributes = new StdClass();
$identityAttributes->IdentityAttributes = new StdClass();
$identityAttributes->IdentityAttributes->ssn = 41441414;
$identityAttributes->IdentityAttributes->firstName = 'John2';
$identityAttributes->IdentityAttributes->lastName = 'Doe2';
$identityAttributes->IdentityAttributes->gender = 'MALE';
$identityAttributes->IdentityAttributes->birthDate = null;

try{
    $identity = $client->establishIdentity($processID, $identityAttributes); //ERROR


   } catch (SoapFault $f){
       echo "ERROR!";
   }

$end = $client->__soapCall('stop', array(new SoapParam($processID, 'processId')),
       array('soapaction' => 'C:\wsdl\BenefitDeterminationProcess_BenefitDialogueServiceSOAP\stop'));

?>

 

Any assistance is greatly appreciated! Thanks.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.