EDIT: Found the problem. You can't have a relationship to 'BasicUsers'. Just send over its elements.
If anyone can help me with this, I'll be eternally grateful.
I'm trying to test out this SOAP server with a complex type like so:
<complexType name="BasicUser">
<sequence>
<element name="firstName" nillable="true" type="xsd:string"/>
<element name="lastName" nillable="true" type="xsd:string"/>
<element name="password" nillable="true" type="xsd:string"/>
<element name="username" nillable="true" type="xsd:string"/>
</sequence>
</complexType>
|
Simple enough huh? There's a function that needs a 'BasicUser' type (the function is named 'save'). So, I do my PHP to test it out:
$client = new soapclient(http://osmani.dal.epals.net:8080/axis/services/WSUserManager?wsdl, true);
$params = array("in0"=>array("BasicUser"=>array("firstName"=>"test","lastName"=>"test","password"=>"test","username"=>"testing123")));
$result = $client->call("save",$params);
|
So, by this logic, you have in0 (that's the actual name) that sends out a BasicUser type with 4 elements with values. But when I check the request xml, this is what I get:
<?xml version="1.0" encoding="ISO-8859-1"?>
<SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:impl="webservices.epals.com" xmlns:tns1="http://users.epals.com">
<SOAP-ENV:Body>
<impl:save xmlns:impl="webservices.epals.com">
<in0 xsi:type="tns1:BasicUser">
<firstName xsi:nil="true" xsi:type="xsd:string"/>
<lastName xsi:nil="true" xsi:type="xsd:string"/>
<password xsi:nil="true" xsi:type="xsd:string"/>
<username xsi:nil="true" xsi:type="xsd:string"/>
</in0>
</impl:save>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
|
It seems all my elements are just returning null. This really baffled me. I looked through the debug_str and see this:
2007-04-27 14:15:21.639099 wsdl: in serializeType: name=firstName, type=http://www.w3.org/2001/XMLSchema:string, use=encoded, encodingStyle=, unqualified=unqualified
value=NULL
2007-04-27 14:15:21.639400 wsdl: in serializeType: got a prefixed type: string, http://www.w3.org/2001/XMLSchema
2007-04-27 14:15:21.639664 wsdl: in serializeType: type namespace indicates XML Schema or SOAP Encoding type
2007-04-27 14:15:21.639936 wsdl: in serializeType: returning: <firstName xsi:nil="true" xsi:type="xsd:string"/>
|
No clue why it's not getting any value out of it since just a few lines above it you see this:
value=array(1) {
["BasicUser"]=>
array(4) {
["firstName"]=>
string(4) "test"
["lastName"]=>
string(4) "test"
["password"]=>
string(4) "test"
["username"]=>
string(10) "testing123"
}
}
|
This really confuses me. PLEASE HELP!