Thread: Soap
View Single Post
Old Jan 2nd, 2008, 9:43 PM   #4
Sane
Programming Guru
 
Sane's Avatar
 
Join Date: Apr 2005
Location: Waterloo, Ontario
Posts: 1,886
Rep Power: 5 Sane will become famous soon enough
Send a message via MSN to Sane
Re: Soap

You can't use the header function to send data. The header function changes the header that the client gets from the request. But if you had two servers that you both had control over, you might be able to fake communication by using get_headers to send a request, and header to send a reply. This is just a thought of mine.

http://website_client.com/client.php
php Syntax (Toggle Plain Text)
  1. // Make A Request With get_headers to http://website_server.com
  2. $response = get_headers('http://website_server.com/server.php', 1);
  3.  
  4. // Show Result
  5. echo $response['Result'];

http://website_server.com/server.php
php Syntax (Toggle Plain Text)
  1. // Fake A Response With header Back To The Client
  2. header('Result: Hello World');
  3.  
  4. // The message that will be seen if viewed by a web browser.
  5. echo 'This Page Is Not To Be Accessed Directly. Bye.';

I'm not entirely sure if that would work, but it looks like it should...

And of course, none of this has anything to do with SOAP...

Edit: Okay. I just tried it out for fun. It works perfectly. So you could use that for a cheap way to get around the lack of the socket function. If your hosting actually allows you to use "get_headers". Here it is if you want to see: Client Page | Server Page. And I apologize in advance if I've gone off on a wild tangent that's completely irrelevant to your requirements...

Last edited by Sane; Jan 2nd, 2008 at 10:02 PM.
Sane is offline   Reply With Quote