![]() |
Soap
The site I use has url wrappers and functions like fsockopen all disabled. However, the headers function is allowed. What I'd like to do is use SOAP in order to send information to the site so that I can do certain things from other sites. My confusion however lies in that is the message contained in the XML structure of SOAP part of the header, or is it the html page itself? I've been reading examples and such and went to the w3 page but this concept eludes me, so I'm asking here in the hope someone knows. If it is part of the header, could someone show me a brief php example of a simple SOAP request or perhaps a link to a tutorial they've used which they found helpful. I'd like to do so without implementing an external library.
|
Re: Soap
Sorry. I don't quite understand what you mean by one of the first things you said:
Quote:
Or are you just talking about the class "SoapHeader" in the SOAP extention? And is that the only class available for use with PHP on the server? |
Re: Soap
Sorry about that Sane, it's a typo I meant to say the header function. And yes I would like to retrieve info from another site by sending the request via the header function and then using the get_headers to retrieve the results. Assuming that is possible of course, that's why I'm saying I don't fully understand SOAP. Doesn't it solely involve HTTP headers?
|
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 :
http://website_server.com/server.php :
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... |
Re: Soap
Nope, that's actually perfect. I just thought that what you just did was actually what SOAP did, but I guess not lol. Are there any special rules regarding characters that I should omit from headers and such? Like no asterisks or something to that effect?
|
Re: Soap
SOAP probably does something different, but I think a simple hack like this is easier than concerning yourself with creating a SOAP client and server. I've never heard of SOAP before, but it seems like a hassle if you only need to do something really simple like transfer a few values back and forth.
You have a good question about the header. All I'd recommend is that you should experiment. I will hypothesize that you can put as much information as you want in the header, as long as the information does not contain CRLF ("\r\n"), which ends the current header attribute. Experiment and see. |
Re: Soap
Well this is what I ended up doing:
client.php (running wherever) :
<?phpremote.php (running elsewhere) :
<?php |
Re: Soap
As long as it works. ;)
|
Re: Soap
-_- my server doesn't support get_headers because it isn't a PHP 5 server lol that sucks. Any way to get the headers in PHP 4?
|
Re: Soap
Yikes. Always test first bud.
I'm not quite sure. So have you tried using cURL? And maybe someone else knows a hack you could use. If not, I could perhaps helps you decipher the SOAP documentation for PHP. |
| All times are GMT -5. The time now is 3:51 AM. |
Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC