Re: [SOAP] Create function for soap call to godaddy ote using given libraries
| From: | Richard Quadling | Date: | Thu, 27 Jan 2011 17:30:30 +0000 |
| Subject: | Re: [SOAP] Create function for soap call to godaddy ote using given libraries | ||
| References: | 1 2 3 | Groups: | php.soap |
| Request: | Send a blank email to php-soap+get-3245@lists.php.net to get a copy of this message | ||
On 27 January 2011 17:26, Richard Quadling <rquadling@gmail.com> wrote:
> On 27 January 2011 17:02, ribe <ribeski.goce@gmail.com> wrote:
>>
>> Anather codde I tryed, but responca is again the same:
>
> Take a look at the following code ...
>
> 1 - http://pastebin.com/VfgrhzKy
>
> WAPI.php
>
> This is the script produced by wsdl2php which takes a wsdl file and
> turns it into a bunch of PHP classes, wrapping PHP's native SoapClient
> technology.
>
> 2 - http://pastebin.com/f8CBcLHc
>
> My code based upon a simple test bed allowing me to test soap services.
>
> If I don't enter the credentials, the script outputs (I'm using the
> command line) ...
>
> SimpleXMLElement Object
> (
> [@attributes] => Array
> (
> [clTRID] =>
> )
> [result] => SimpleXMLElement Object
> (
> [@attributes] => Array
> (
> [code] => 1001
> )
> [msg] => Server=P3OWCORPAPI001; Source=WsWWDAPI;
> Description=sCLTRID is a required parameter.
> )
> )
>
> If I enter just a sCLTRID, I get ...
>
> SimpleXMLElement Object
> (
> [@attributes] => Array
> (
> [clTRID] => abc123
> )
> [result] => SimpleXMLElement Object
> (
> [@attributes] => Array
> (
> [code] => 1001
> )
> [msg] => Login credentials failed.
> )
> )
>
>
> So, the code is working as best it can. If you can enter your
> credentials into the code and run it (don't need to edit anything else
> for the time being), then at least we can see what output we get.
>
> Obviously, if you are using ...
>
> $o_Describe->sCLTRID = '123213';
> $o_Describe->credential->account = 'acacac';
> $o_Describe->credential->password = 'pspsps';
>
> then I guess that these are NOT the real credentials.
>
> The code will use PHP5's SoapClient. I've no idea about nusoap. I
> think that it is a PHP4 class. PHP5 has native support for SoapClient.
>
> Richard.
>
> Richar
> --
> Richard Quadling
> Twitter : EE : Zend
> @RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY
>
If you use the code I've supplied, and copy the show trace code to the
main body of the script, you can see the request/response,
headers/body ...
Request Headers
---------------
POST /wswwdapi/wapi.asmx HTTP/1.1
Host: api.ote.wildwestdomains.com
Connection: Keep-Alive
User-Agent: PHP
Content-Type: text/xml; charset=utf-8
SOAPAction: "http://wildwestdomains.com/webservices/Describe"
Content-Length: 300
Request
-------
<?xml version="1.0" encoding="utf-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:ns1="http://wildwestdomains.com/webservices/">
<SOAP-ENV:Body>
<ns1:Describe>
<ns1:sCLTRID>123213</ns1:sCLTRID>
<ns1:credential />
</ns1:Describe>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Response Headers
----------------
HTTP/1.1 200 OK
Date: Thu, 27 Jan 2011 17:28:38 GMT
Server: Microsoft-IIS/6.0
X-Powered-By: ASP.NET
X-AspNet-Version: 2.0.50727
Cache-Control: private, max-age=0
Content-Type: text/xml; charset=utf-8
Content-Length: 518
Response
--------
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<DescribeResponse xmlns="http://wildwestdomains.com/webservices/">
<DescribeResult><response clTRID="123213"> <result
code="1001"> <msg>Login credentials failed.</msg>
</result> </response></DescribeResult>
</DescribeResponse>
</soap:Body>
</soap:Envelope>
Response interpreted
--------------------
SimpleXMLElement Object
(
[@attributes] => Array
(
[clTRID] => 123213
)
[result] => SimpleXMLElement Object
(
[@attributes] => Array
(
[code] => 1001
)
[msg] => Login credentials failed.
)
)
Richard.
--
Richard Quadling
Twitter : EE : Zend
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY