NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
Site Admin

Joined: 13 Jul 2003
Posts: 8334
Reply with quote
maybe __call() is depricated, but there is no relation to nusoap library we're there about. Aren't we?
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 09 Aug 2006
Posts: 10
Reply with quote
I'm not sure i understand what you're saying. Aren't they using nusoap.php?
View user's profileFind all posts by CTSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8334
Reply with quote
you posted references to something else, not nusoap.
To make it clear, I repeat in the other words - there is no __call() in nusoap Smile
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 09 Aug 2006
Posts: 10
Reply with quote
Ok, so the only way to work around the caching errors is to mess up all my soap calls?

$result = $client->call('hello', array('name' => 'Scott'));

is a whole lot uglier than

$result = $proxy->hello('Scott');
View user's profileFind all posts by CTSend private message


Joined: 09 Aug 2006
Posts: 10
Reply with quote
Using NuSOAP's call() syntax, i now get this error:

Charset from HTTP Content-Type 'UTF-8' does not match encoding from XML declaration 'ISO-8859-1'
View user's profileFind all posts by CTSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8334
Reply with quote
Why don't you correct the encoding then?

$soapclient->soap_defencoding can be set to 'UTF-8' or 'ISO-8859-1'
decode_utf8 property can be true or false
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 09 Aug 2006
Posts: 10
Reply with quote
I didn't know how and figured it should work. It worked with the proxy. (The proxy only generates the methods, right?)

Changing those variables doesn't help, the server still appears to send an incorrect response:

[request] => POST [...]
User-Agent: NuSOAP/0.7.2 (1.2)
Content-Type: text/xml; charset=ISO-8859-1
SOAPAction: ""
Content-Length: 469

<?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/"><SOAP-ENV:Body><getUserByUsername><bla xsi:type="xsd:int">841</bla></getUserByUsername></SOAP-ENV:Body></SOAP-ENV:Envelope>
[response] => HTTP/1.1 200 OK
Date: Tue, 15 Aug 2006 15:38:59 GMT
Server: Apache/2.0.54 (Debian GNU/Linux) mod_jk/1.2.15 mod_python/3.1.3 Python/2.3.5 PHP/5.0.5 mod_perl/1.999.21 Perl/v5.8.4
X-Powered-By: PHP/5.0.5
Connection: close
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0" encoding="ISO-8859-1"?>



[request] => POST [...]
User-Agent: NuSOAP/0.7.2 (1.2)
Content-Type: text/xml; charset=UTF-8
SOAPAction: ""
Content-Length: 464

<?xml version="1.0" encoding="UTF-8"?><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/"><SOAP-ENV:Body><getUserByUsername><bla xsi:type="xsd:int">841</bla></getUserByUsername></SOAP-ENV:Body></SOAP-ENV:Envelope>
[response] => HTTP/1.1 200 OK
Date: Tue, 15 Aug 2006 15:54:42 GMT
Server: Apache/2.0.54 (Debian GNU/Linux) mod_jk/1.2.15 mod_python/3.1.3 Python/2.3.5 PHP/5.0.5 mod_perl/1.999.21 Perl/v5.8.4
X-Powered-By: PHP/5.0.5
Connection: close
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0" encoding="ISO-8859-1"?>
View user's profileFind all posts by CTSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8334
Reply with quote
Quote:
Changing those variables doesn't help, the server still appears to send an incorrect response

Sure, client has no influence on the server. Did you develop the server yourself? If it is based on nusoap.php, you may want to change enconding for the server too.
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 09 Aug 2006
Posts: 10
Reply with quote
I didn't work on the server. It turns out we use a hacked up NuSOAP server with "better error handling".. I'll try the hacked up client that i'm supposed to use.

Thanks for the help.


Last edited by CT on Wed Aug 16, 2006 2:49 am; edited 1 time in total
View user's profileFind all posts by CTSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8334
Reply with quote
if your server outputs in ISO-8859-1 and client supports ISO-8859-1, what's the problem then?
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 09 Aug 2006
Posts: 10
Reply with quote
The server uses, i assume, NuSOAP 0.6.8 which may have been modified here. It always uses HTTP charset UTF-8 and XML encoding ISO-8859-1. That's a combo NuSOAP 0.7.2 and NuSOAP 0.6.8's call functions don't like.

I've copied the possibly modified 0.6.8 client and reverted to using proxy. If it also stops working sometime then it's not my fault.
View user's profileFind all posts by CTSend private message


Joined: 09 Aug 2006
Posts: 10
Reply with quote
The eval error is caused by the getProxy() function choking on a client object with error message.

Check the server result before using getProxy();

Code:
      $client = new soapclient( $wsdl , true ); // nusoap function soapclient($endpoint,$wsdl = false,$proxyhost = false,$proxyport = false,$proxyusername = false, $proxypassword = false, $timeout = 0, $response_timeout = 30)
      //print_r($client);
      // Display the debug messages only
      //echo '<h2>Debug</h2>';
      //echo '<pre>' . htmlspecialchars($client->debug_str, ENT_QUOTES) . '</pre>';
      if ($err = $client->error_str || ($err = $client->getError()) || ($err = $client->faultstring)) {
         die("SOAP client failed to connect with server.<br>\n");
      }
      //Create new proxy.
      $proxy = $client->getProxy();
View user's profileFind all posts by CTSend private message
getProxy For Nusoap not working
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 2 of 3  

  
  
 Reply to topic