NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
Archiving Server Responses


Joined: 12 Feb 2004
Posts: 3
Reply with quote
Hello World,

We currently have a NuSoap Web Services running. My task is to create an auditing/archival system that will archive (in a database) both requests (from client) and responses (from server) and store them in a database.

I can figure out how to handle the request, but what is giving me a hard time, is trying to "capture" the server reponse. So, instead of asking for help, I go digging around in the NuSoap.php class. What I found isn't really what I was hoping for, so, I am hoping that by posing my question on these forums, I might get an answer on how am to tackle my task.

In the service function of the nusoap soap_server class, the following lines appear:

Code:

            header("Content-Type: text/xml; charset=ISO-8859-1\r\n");
            print $this->wsdl->serialize();
            exit();



The way that the author has created these services, is that once the call to the service function is made in the actual php script (e.g. webservice.php), any other php after the call to the service function is just ignored.

So, with that in mind, I have to try and figure out how to obtain the entire soap envelope that the server is going to send back to the client, when I'm in my called procedure. The problem is, I can't figure out how to do this.

So, after all this, my question is, how can I obtain the full server response and send that to a file or database or something for some other processing, on the server side?

I realize that on the client side, I'm offered the soapclient->response and soapclient->request variables that allow me access to this information, however, I'm wanting these available on the server itself.

So, that's why I'm posting here. I hope that I have explained myself well enough that everyone knows the concept of what I'm trying to do, without any more information. I am also hoping that someone will be able to tell me how to do it, or a better way to do it, or even to shove off.

Regardless the content of the response to this post, any and all responses are appreciate in advance, and I look forward to hearing something back.

Have a wonderful day, and thank you for your time!

-Vapok
View user's profileFind all posts by VapokSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8344
Reply with quote
You showed the part of nusoap that outputs wsdl file.
As any other soap server, a server built with nusoap must generate wsdl and send it to the requestor. It's just fine. But has no relation to any soap evelopes Smile) Wsdl a description of what methods can be called and what their arguments are.
If you need a working soap server or soap client created using nusoap see samples posted at this forum.
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 12 Feb 2004
Posts: 3
Reply with quote
Clearly... I have miscommunicated something.. So, I shall try again.

First off... I have a completely working and functioning soap server. Our comapny uses it in it's current state.

Now second off, if the part of the code that I put above is to create the wsdl, then, ok.. I've misread something in the code. No biggie.

What I'm trying to accomplish is this:

I have a Soap Server that has a function call. Let's call it, "Wang"

Now, the purpose of the function "Wang" is to return to the client, "Hello $inputName"

Now, $inputName is a paramter passed in from the client in the Soap Request.

My process "Wang" accepts the request from our Client named "Tang" Now.. Tang sends a request to our soap server calling the function Wang with an inputerName parameter of "Bob".

Wang returns back to the client the string of "Hello Bob".

What I have just described, in simple pseudo code, is a fully functioning, simple soap server.

Now.. I want to modify the function "Wang" to output both the request from the client, and the response from the server.

On the client side, I can do that via the variables: soapclient->request and soapclient->response.

I want to know how to do this on the Server Side.

Does this make more sense?

--Vapok
View user's profileFind all posts by VapokSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8344
Reply with quote
in your function you can access $server global variable and see its $request property which contains XML envelope received from the client.
Server responce can't be gotten at the time when your procedure is called because the responce itself is generated later after the server processed all the incoming envelopes. You'll probably just want to walk through your server in debugger step-by-step and see how it work.
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 12 Feb 2004
Posts: 3
Reply with quote
Pardon my ignorance...

How do I use the debugger?
View user's profileFind all posts by VapokSend private message
Site Admin

Joined: 13 Jul 2003
Posts: 8344
Reply with quote
you need phped and debugger module installed on the server.
Read phped FAQ on how to run a debug session out of the IDE (p.3) howto-run-debug-session-t585.html
View user's profileFind all posts by dmitriSend private messageVisit poster's website
Archiving Server Responses
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