I am trying to use soapclient to connect to a web service.
Unfortunately, I'm having trouble figuring out how to get php to
understand the wsdl file and send back the correct message - particularly
on a function that wants an array that forms a complex type.
The wsdl file is located at
http://www.cisco.com/univercd/cc/td/doc/solution/sesm/sesm_33x/wsg/wsg_saif.htm
The function in particular that I am having trouble with right now is
authenticate and passing the ArrayOfCredentials back correctly.
I was able to snoop a packet from a client that came with the package,
that I don't have the source code to. From that I was able to determine
what a correct soap message should look like. The correct xlm message
that should be sent is below.
I am new to the list. Is this question something that is appropriate for
this list? If not, I apologize. Please let me know and if you have any
suggestions for an alternate list, would be great.
If this is OK, then does anyone have any suggestions for either fixing the
wsdl file or a workaround w/ php to get it to form the xml correctly?
The closest idea I've got so far is with the following.
$hostkey = "10.10.10.10"
$identity->type = "user";
$identity->principal = "myusername";
$credential->identity = $identity;
$credential->credential = "mypassword";
$login = $soap->authenticate($hostkey,$credential);
Which gives me the following fault.
org.xml.sax.SAXException: Deserializing parameter 'credentials': could
not find deserializer for type
{http://common.wsg.sesm.cisco.com}ArrayOfCredential
I've also tried numerous arrays, such as
$credential = array('identity' => array('type' => 'user', 'principal' =>
'myusername'), 'credential' => 'mypass');
Which gives me this error.
SOAP-ERROR: Encoding: object hasn't 'identity' property
The correct xml, should look like this:
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w
3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<ns1:authenticate
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns1="ht
tp://common.wsg.sesm.cisco.com">
<hostkey xsi:type="soapenc:string"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">10.
10.10.10</hostkey>
<credentials xsi:type="soapenc:Array"
soapenc:arrayType="ns1:Credential[1]" xmlns:soapenc="http:
//schemas.xmlsoap.org/soap/encoding/">
<item href="#id0"/>
</credentials>
</ns1:authenticate>
<multiRef id="id0" soapenc:root=
"0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xsi:type="ns2:Credential" xml
ns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns2="http://common.wsg.sesm.cisco.com"
<identity href="#id1"/>
<credential xsi:type="soapenc:string">mypassword</credential>
</multiRef>
<multiRef id="id1" soapenc:root="0"
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encodi
ng/" xsi:type="ns3:Identity" xmlns:
ns3="http://common.wsg.sesm.cisco.com"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
<type xsi:type="soapenc:string">user</type>
<principal xsi:type="soapenc:string">myusername</principal>
</multiRef>
</soapenv:Body>
</soapenv:Envelope>
Thanks for any help or suggestions you can provide.
-Dusty Doris
--
PHP Soap Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php