Jump to content

SOAP vs XML-RPC

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
5 replies to this topic

#1
DEViANT

DEViANT

    Programming Expert

  • Members
  • PipPipPipPipPipPip
  • 358 posts
My dilemma :
Client server needs to send data to main server and receive data back. Data that needs to be sent is an array of id numbers and a member key. The server then needs to send back certain data based on the data it receives.

I've visited the php.net website and saw that there are built in classes for both SOAP and XMLRPC, however there seems to be more documentation on SOAP.

Would it be better for me to use SOAP in this case? This question might seem dwarf to more advance developers however I've never before worked with Data being sent from one server's database to another server... Which Is why I'm asking. Which one would be better to spend time on researching?

:D You should rep+ me so that I can win :D

My Blog | Ask me!
Error : Satan did it

#2
PETTE

PETTE

    Learning Programmer

  • Members
  • PipPipPip
  • 50 posts
Just use REST.

The learn how to get data from the XML file by using the XMLreader class

#3
Alexander

Alexander

    It's Science!

  • Moderators
  • 4,124 posts
REST was designed to transport objects, XML-RPC was designed to call objects, SOAP was designed to exchange structured data with an RPC over HTTP (successor to XML-RPC).

A RESTful implementation as mentioned before would be a good choice.
Be sure to read the updated FAQ! || Health is achieved through the same 10,000 steps.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.

#4
DEViANT

DEViANT

    Programming Expert

  • Members
  • PipPipPipPipPipPip
  • 358 posts
Cool. I'm going to look into that. I played arround with nusoap last night, Ran into some complications. Just one thing though, Can REST post back variables like arrays?

:D You should rep+ me so that I can win :D

My Blog | Ask me!
Error : Satan did it

#5
Alexander

Alexander

    It's Science!

  • Moderators
  • 4,124 posts
REST can post back XML. But you could return a JSON encoded result to handle the arrays or object variables to be parsed with PHP. You can look at json_encode() serialization.

Also, nusoap conflicts with PHP's native soapclient since 5.3.0, nusoap has not been maintained since then so you will need to modify things to make it work out of the box.
Be sure to read the updated FAQ! || Health is achieved through the same 10,000 steps.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.

#6
DEViANT

DEViANT

    Programming Expert

  • Members
  • PipPipPipPipPipPip
  • 358 posts
Yeah realised that as I went allong.

Thanks for the support, sounds like REST is the way to go. Time to do some reading :)

:D You should rep+ me so that I can win :D

My Blog | Ask me!
Error : Satan did it