Jump to content

Recommended Posts

hw.php

<?php
echo "<?xml version=\"1.0\" ?> 
<title>Hello World</title>";
?>

 

On the remote site call:

<?php
$hw = simplexml("http://www.othersite.com/hw.php");
echo $hw->title;
?>

 

I am unsure if that works, but that is the basic gist of what I know of a webservice. simplexml is how you would read it out, and I do not know if I setup my XML right or echo'd the object property right. So yea. The above is a real rough example that is untested.

 

What's a PHP webservice?

 

WebService on Wikipedia

 

EDIT:

For a more (much more) advanced webservice look into soap.

 

The method I have shown, is not really a "webservice" per say. But for something simple, that would work. If you are looking for a real-world solution SOAP is definitely what you are going to need to use/look into.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.