NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
how to specify port? soapclient(http://218.5.XX.XXX:20001...


Joined: 19 May 2006
Posts: 1
Reply with quote
Hello all.
First sorry but I'm newbie on XML, and also for my bad english.
I'm trying to connec to Onlinenic API using nusoap class for PHP (I don't even know if I can do this!)
All values I'm using here are test server/password/username given by Onlinenic to place tests, so I think there is no problem.

Here is my peace of code:
Quote:

include_once("nusoap.php");
$Client = new soapclient('http://mywebserver:20001/', 'WSDL', '');
$msg='<?xml version="1.0" encoding="UTF-8" standalone="no"?><epp><command><creds><clID>135617</clID><options><version>1.0</version><lang>en</lang></options></creds><clTRID>L147481028182940_0</clTRID><login><chksum>9c4175211a307ee384bc2a13fbe0e4af</chksum></login></command></epp>';
$Response = $Client->call('login', $msg);
echo ("RESPONSE: " . $Response);
echo "<br>ERROR: " . $Client->getError();


I have copied this from an example I have.
From onlinenic api manual I have the following information:

Quote:

OnlineNIC Registration API uses TCP/IP protocol in the way of Clients-Server.
(...)
Test Server: mywebserver Port: 20001 Login Info: 135610 Password: 654123
(...)

Format descriptoin of request

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<epp>
<command>
<creds>
<clID>135617</clID>
<options>
<version>1.0</version>
<lang>en</lang>
</options>
</creds>
<clTRID>L147481028182940_0</clTRID>
<login><chksum>9c4175211a307ee384bc2a13fbe0e4af</chksum></login>
</command>
</epp>

(...)

Response returned to you
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<epp xmlns="urn:iana:xml:ns:epp-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:iana:xml:ns:epp-1.0 epp-1.0.xsd">
<response>
<result code="2306">
<msg>Parameter value policy error</msg>
<value>--CLIENT_TRANSACTION_ID_MUST_BE_UNIQUE</value>
</result>
<unspec/>
<trID>
<clTRID>L147481028182940_0</clTRID>
<svTRID>L147481028182940_0-OLNIC-SRV</svTRID>
</trID>
<chksum>a7c3cba6463467f51e257bdd4fd2b3cc</chksum>
</response>
</epp>


Can I use nusoap fro comunicate with this server? What I'm doing wrong?
Errors are:
HTTP Error: server failed to send headers
HTTP Error: socket read of headers timed out
ERRO: Response not of type text/xml (if I use no port)

Note: if you try http://mywebserver:20001/ directly from the browser, you get a XML reply.

Any help will be appreciated. Thank you.
View user's profileFind all posts by pcsousaSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8344
Reply with quote
Take a look at the NuSoap samples provided on this forum first. You don't have to write/parse/transmit/receive any XMLs. It all is done by NuSoap.
View user's profileFind all posts by dmitriSend private messageVisit poster's website
Re: how to specify port? soapclient(http://218.5.XX.XXX:2000


Joined: 16 Oct 2006
Posts: 3
Reply with quote
just do following ..
if you have alerady WSDL then there is no need to apply whole soap xml message just call using paramters ,
here http://mywebserver:20001/xxxx?wsdl should be display......in newsoapclient(.............)

include_once("nusoap.php");

$Client = new soapclient('http://mywebserver:20001/', 'true');

$msg = array('epp' => array( 'command' => array (
'creads' => array('clID' => '135617','option' => array('version' => '1.0','lang' => 'en')),
'clTRID' => 'L147481028182940_0',
'login' => array('chksum' => '9c4175211a307ee384bc2a13fbe0e4af')
)));

$response = $Client->call('login', $msg);

$err = $Client->getError();

function error($err='',$response) {
if ($err) {
echo '<h2>Failed to access WSDL</h2><pre>' . $err . '</pre>';
exit();
} else {
/* call queryRcx */
if ($this->fault) {
echo '<h3>Fault</h3><pre>';
print_r($response);
echo '</pre>';
exit();

}
/* faults during call */
if($this->fault) {
echo "FAULT: <p>code: {$this->faultcode}<br />";
echo "String: {$this->faultstring}<br />";
echo '<pre>' . htmlspecialchars($this->request, ENT_QUOTES) . '</pre>';
echo '<pre>' . htmlspecialchars($this->response, ENT_QUOTES) . '</pre>';
//exit();
} else {
echo '<h2>Request</h2>';
echo '<pre>' . htmlspecialchars($this->request, ENT_QUOTES) . '</pre>';
echo '<h2>Response</h2>';
echo '<pre>' . htmlspecialchars($this->response, ENT_QUOTES) . '</pre>';
echo '<h2>Debug</h2><pre>' . htmlspecialchars($this->debug_str, ENT_QUOTES) . '</pre>';
echo '<h2>Result</h2><pre>';
print_r($response);
echo '</pre>';
}
View user's profileFind all posts by alex_wincetSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8344
Reply with quote
Check if url you supplied into the soapclient constructor returns a WSDL content.

_________________
The PHP IDE team
View user's profileFind all posts by dmitriSend private messageVisit poster's website
how to specify port? soapclient(http://218.5.XX.XXX:20001...
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic