NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
Problem receiving result from Microsoft Soap toolkit server


Joined: 30 Jun 2006
Posts: 10
Reply with quote
Hey all,
I am having a problem receiving the correct data from a server running Microsoft Soap toolkit
while i send request using the nusoap client service. It seems to not be understanding the parameters
that I am sending the other side. I continously receive and INvalid User error on there end
which just means it does not understand the parameters I am sending.

below is the nusoap client call I am using:
$parameters = array(
'name' => 'alex',
'state' => 'NJ',
'zip' => '03948',

);


// Define new object and specify location of wsdl file.
$soapclient = new soapclient('http://www.somsiete.com0?WSDL',true);


$err = $soapclient->getError();
if ($err) {
// Display the error
$answer = 'Constructor error ' . $err;
} else {
// call the method and get the result.
$result = $soapclient->call('GetPPDData',$parameters);


// Display the request and response
echo '<h2>Request</h2>';
echo '<pre>' . htmlspecialchars($proxy->request, ENT_QUOTES) . '</pre>';
echo '<h2>Response</h2>';
echo '<pre>' . htmlspecialchars($proxy->response, ENT_QUOTES) . '</pre>';
// Check for a fault
if ($soapclient->fault) {
$answer = 'Fault';
} else {
// Check for errors
$err = $soapclient->getError();
if ($err) {
// Display the error
$answer = 'Error ' . $err;
} else {
//concatenate all array elements into a variable to send out
while (list(,$item)=each($result)) {
$answer .= $item;
}
}
}
}


Again, is there an issue of sending nusoap messages to a server that is running the Microsoft Toolkit for soap? Any help
would be greatly appreciated. Thanks.
View user's profileFind all posts by DoubleAce3Send private message
Site Admin

Joined: 13 Jul 2003
Posts: 8334
Reply with quote
Check namespace for the arguments when you call the methods.
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 30 Jun 2006
Posts: 10
Reply with quote
i did check the namespace in the wsdl file and the parameters being passed in are correct. Not sure if on the server end since they are using the Microsoft toolkit if there are any interoperablity problems.
View user's profileFind all posts by DoubleAce3Send private message
Site Admin

Joined: 13 Jul 2003
Posts: 8334
Reply with quote
hmm, server side can be checked with the MS tools.
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 30 Jun 2006
Posts: 10
Reply with quote
yeah, wish it would be that easy..but the server side is not owned by me its by one of our clients!! So i would like to be able to remedy the issues on the client side without having to mess on the server side if necessary!! I tried a simple example creating a sample client using Microsoft Soap Toolkit 3.0 and I was able to retrieve the information that I wanted. However, using Nusoap to retrieve the data from the serverside has been an issue.
View user's profileFind all posts by DoubleAce3Send private message
Site Admin

Joined: 13 Jul 2003
Posts: 8334
Reply with quote
well.
finally, what's the trouble? Does it return a kind of fault or error message or whatever?
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 30 Jun 2006
Posts: 10
Reply with quote
It seems the server just sends back a string saying 'Invalid User'...which im assuming since the parameters require you to send username and password that the arguments are not being captured correctly by the server end.
View user's profileFind all posts by DoubleAce3Send private message
Site Admin

Joined: 13 Jul 2003
Posts: 8334
Reply with quote
huh, a soap server should never send anything like this. Check if you work with soap server at all.
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 30 Jun 2006
Posts: 10
Reply with quote
I am working with a soap server...the reason im receiving this string is because the parameters im sending including a username and password...it seems that the way there server is receiving the data is incorrect...so there's probably code on the server in to just send this string if unable to connect!
View user's profileFind all posts by DoubleAce3Send private message
Site Admin

Joined: 13 Jul 2003
Posts: 8334
Reply with quote
Do you know what authentication scheme is used on the server?
NuSoap supports only HTTP/Basic.
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 30 Jun 2006
Posts: 10
Reply with quote
I have resolved the issue on this thread by just using the getProxy function.
I have listed the code below.

// Define needed parameters and put them in an array..
$parameters = array(
'v_state' => 'NJ',
'v_city' => 'Haledon',

);


// Define new object and specify location of wsdl file.
$soapclient = new soapclient('http://myserver',true);

$proxy = $soapclient->getProxy();

$err = $soapclient->getError();
if ($err) {
// Display the error
$answer = 'Constructor error ' . $err;
} else {
// call the method and get the result.
/* $result = $soapclient->call('GetData',$parameters,'http://myserver');*/
$result = $proxy->GetData($parameters);


// Display the request and response
echo '<h2>Request</h2>';
echo '<pre>' . htmlspecialchars($proxy->request, ENT_QUOTES) . '</pre>';
echo '<h2>Response</h2>';
echo '<pre>' . htmlspecialchars($proxy->response, ENT_QUOTES) . '</pre>';


Using getProxy solved my issue, however this caused another issue. The above code works fine when I am running it from my home server. However, when I try to use the same code on my work machine server I am getting some weird error:

Parse error: parse error, unexpected T_STRING in /home/oracle/infr/lib/php/nusoap.php(6983) : eval()'d code on line 1

Fatal error: Cannot instantiate non-existent class: soap_proxy_484983192 in /home/oracle/infr/lib/php/nusoap.php(6985) : eval()'d code on line 1

im not sure why this error is occuring since i am using the same php classes as my server machine at home. I will repost this in a new thread. Has anyone run into any issues using the getProxy function?
View user's profileFind all posts by DoubleAce3Send private message
Site Admin

Joined: 13 Jul 2003
Posts: 8334
Reply with quote
it looks like you have quite a different php version.

BTW, did you try to wrap parameters into an additional array() when you worked without getProxy()?
As I remember it helped me in some cases.
View user's profileFind all posts by dmitriSend private messageVisit poster's website
Problem receiving result from Microsoft Soap toolkit server
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 2  

  
  
 Reply to topic