Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Regular Coder
    Join Date
    Feb 2006
    Posts
    138
    Thanks
    11
    Thanked 0 Times in 0 Posts

    Using PHP to consume web services/parse XML

    I'm having a little trouble understanding this from a theoretical perspective, wondering if anyone could provide some insight. I have little experience with web services, but have a set of them I need to make operational..

    Here's the scenario (this is all theoretical for now):

    1. Simple HTML form feeds form data to webservice.asmx via http POST for processing

    2. webservice.asmx returns an XML data set

    I'm questioning when I get the chance parse the XML, instead of having it directly displayed upon execution of the webservice. I'm assuming the webservice will return a simple XML page...

    How can I get the webservice to return the xml to a page that can parse the xml (with php), as opposed to just displaying the xml (which is what it looks like happens currently)?

    I figure I can get it done with AJAX, because the asynchronous nature of the requests makes more sense to me in this circumstance, but I suck at the syntax, so here I am looking for a PHP solution...

    Help is appreciated!
    Last edited by chornbeck; 02-28-2008 at 01:08 AM.

  • #2
    Master Coder
    Join Date
    Dec 2007
    Posts
    6,682
    Thanks
    436
    Thanked 890 Times in 879 Posts
    WS is not for presentation.

    A Web service is a software system designed to support interoperable machine-to-machine interaction over a network
    This is probably what you need:

    http://www.w3.org/TR/ws-arch/#whatis

    xml is for data exchange between service provider and agent using soap.

    look also to this:

    http://www.w3.org/TR/2004/NOTE-ws-ar...0040211/#Cases

    I hope this help.

    best regards
    Last edited by oesxyl; 02-28-2008 at 01:34 AM.

  • #3
    Regular Coder
    Join Date
    Feb 2006
    Posts
    138
    Thanks
    11
    Thanked 0 Times in 0 Posts
    I guess what I'm asking then is, can I build an agent to send requests and process the xml that is returned from the web service?

    I can obviously send a simple HTTP POST request to the web service with my script, I'm just trying to figure out how to process what the service gives back to me...

    Or am I just completely confused?

  • #4
    Master Coder
    Join Date
    Dec 2007
    Posts
    6,682
    Thanks
    436
    Thanked 890 Times in 879 Posts
    Quote Originally Posted by chornbeck View Post
    I guess what I'm asking then is, can I build an agent to send requests and process the xml that is returned from the web service?

    I can obviously send a simple HTTP POST request to the web service with my script, I'm just trying to figure out how to process what the service gives back to me...

    Or am I just completely confused?
    you can use soap php extension:

    http://www.php.net/manual/en/ref.soap.php

    I guess you must dig a little into the soap and wsdl recomandation and make some experiments. You have two links to soap 1.2 and wsdl 1.1 on the page with php soap extension.
    Also you could find very good articles about both on the

    http://xml.com/

    left column, look for web services

    best regards
    Last edited by oesxyl; 02-28-2008 at 02:04 AM.

  • Users who have thanked oesxyl for this post:

    chornbeck (03-15-2008)


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •