Forum Moderators: coopster

Message Too Old, No Replies

NUsoap server

I want to develop a soap_server which recieves request and acknowledges

         

anisrehan

1:14 pm on Jul 24, 2008 (gmt 0)

10+ Year Member



This is my first ever soap assignment.
I am using nusoap and php 5.
The schema is,
I have been provided with a wsdl file.
1) The server will entertain a soap request
2) And will return a soap response.

well and good, completed that phase.
now,

3) the server will generate a soap request containing all the information I needed (which the server is doing, checked with the tech guys)
4) I have to reply with an acknowledgment receipt.

Now, I am stuck how to receive that soap request (which in real world is response).

I have written the following code.

/The WSDL file
$wsdlfile = 'inc/whatsoever.wsdl';

//Server object
$s = new soap_server($wsdlfile);

//Directing all the POST request to the server
$HTTP_RAW_POST_DATA = isset($HTTP_RAW_POST_DATA) ? $HTTP_RAW_POST_DATA : '';
$s->service($HTTP_RAW_POST_DATA);

According to the file, we must have CheckDeliverRequest function, so the implementation is given here

function CheckDeliver($input){
echo 'CheckDeliver function called';
echo $input;
foreach($input as $element){
echo 'Name :' .$element->getName() . ' Value :' . $element;
}
}

/* and just to make sure I am not doing it in-correctly I put another trap here.*/
function CheckDeliverRequest($input){
echo 'CheckDeliverRequest function called';
echo $input;
foreach($input as $element){
echo 'Name :' .$element->getName() . ' Value :' . $element;
}
}

The problem is none of the following function is called.

Can anyone help me how to deal with this trouble?

Sekka

7:06 pm on Jul 24, 2008 (gmt 0)

10+ Year Member



I don't know anything about NuSoap, so sorry I can't help you on that front.

However, may I ask, if you are on PHP5, why not use the built in Soap functionality [uk2.php.net] instead of third party code?

I have used it and it is incredibly easy to implement.

anisrehan

9:20 am on Jul 25, 2008 (gmt 0)

10+ Year Member



Thanks for the reply.
The problem is not what to use in implementation.
The real trouble is, I don't have a clear idea about what is happening around.

I don't even know that I am required to have a soap server implementation or I can get the server's response using any other (alien) method.

Sekka

4:44 pm on Jul 25, 2008 (gmt 0)

10+ Year Member



Ahhh.

This is the turtorial I followed when I was learning SOAP. It helped me a lot to understand and how to implement SOAP.

Shows you server, client, calls, Exceptions, etc.

[devzone.zend.com ]

anisrehan

6:24 am on Jul 26, 2008 (gmt 0)

10+ Year Member



@Sekka
Thanks for the reply.
The current position is, I am successfully made the soap_server and had started receiving the 3rd step message, but now the problem is content of the message.
The people at the other server showed me a full soap request message with at least 8 variables/values. I am receiving only one.
Thats frustrating.

Sekka

9:53 am on Jul 26, 2008 (gmt 0)

10+ Year Member



The request or the return had multiple requests?

anisrehan

5:52 am on Jul 28, 2008 (gmt 0)

10+ Year Member



No Sir, the 3rd request contains all the information, encapsulated in 7 variables in XML. However, the NuSoap Server just returns the first one. I don't know how to get all the other variables/values.

Sekka

8:21 am on Jul 28, 2008 (gmt 0)

10+ Year Member



To return multiple variables you have to return them within an array or an object.

anisrehan

10:35 am on Jul 28, 2008 (gmt 0)

10+ Year Member



Dear Sekka
The problem is not the sending part, in which I am successful. The problem is now receiving.
The data flow is quite complex.
We need to send a request, containing a mobile number.
The server will generate a message ref which contains randomly generated numbers + the mobile number.
This part is completed.

now the Server assumes my site to be a server and sends a soap request, containing all the information about that number and in return I have to respond with an acknowledgment.
The problem is, when I am using nuSoap implementation of server, I receives only the top variable of the server's request, and the rest is vanished!.
Just to solve it, we have used the HTTP_ROW_POST_DATA of pHP and checked the contents of the soap request and parsed it into our desired result, but the problem remains the same, why NuSoap does not show other details, when the request send by the server is complete.

The word "request" used in above paragraph will easily be understood if replaced with "second response".

Sekka

11:57 am on Jul 28, 2008 (gmt 0)

10+ Year Member



Ok... Seems a very strange way of doing what you want to do. Why can't they just return the data back through the call you made?

Anyway, so you have a webservice on your server which receives calls from this other web service?

Their webservice should pass all the variables as parameters, and yours should be ready it accept them. It should work ok, maybe the problem is their end?

If the other end is a .NET web service, they will often deal in objects. They might place all the parameters within an object and send that.

Sorry I can't be of more help but I havem't used NuSoap, only the Soap extension of PHP, and the setup sounds rather strange.