Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SOAP, XMLElement, and PHP

Status
Not open for further replies.

webslinga

Programmer
Jun 20, 2006
55
US
Hi all,
I wanted the greater knowledge of the PHP community on this. I am trying to write a web application that fetches a web service from another site. I can get the data back just fine. I can read it and even modify the data. I just don't know how to send back that modified data back to the web service.
I am using the SoapClient() class to fetch the webservice and SimpleXMLElement to read through the XML document. Here's a rough sketch of my code[actual links left out for privacy's sake]

Code:
    $sc = new SoapClient($wsdl);
    
    // places in parameters
    $params = array('Account' => 'xxxxx','Password' => 'xxxxxx','ResAccount' => '');
    $this->fred = $sc->unit($params);
    $xmlschema = $this->fred->unitResults->schema;    
    $xmldata = $this->fred->unitResult->any;
        
    // after getting the data dump, we parse(read: make sense of)
    // the XML data by dividing them up into objects - bgb
    $this->xml = new SimpleXMLElement($xmldata);
    $this->xml2= new SimpleXMLElement($xmlschema);

I could obtain the data in the XML document by:
Code:
foreach($this->xml->NewDataSet->BFIData as $unit){         
    echo $unit->getSomething() . '<BR>';
}

// generates an XML document
echo $xml->asXML();

// Now, how do I send this modified XML document...?

I just need to know how to send my newly generated XML document back out to the website(err... or webservice).

Also, as you can probably tell by my terminology, I am particularly new at the web service game and would love to hear an alternative BUT practical way of doing this using PHP >5.x. Please let me know if I can describe this better to you.

Finally, there seems to be a real short list of really helpful sites when trying to read up on how to tie in Simple XMLElement, SOAP, and PHP together. If anyone knows of such a site, please include them in your reply.

~ thanks all!
 
All,
I just had one of those eureka moments in the shower this morning about this thread(more than you needed to know I am sure). I am off to test out my theory.
Thanks for trying anyway.
 
It would be much appreciated by all who visit this forum (including myself), if you could share any insights for those who might bump into a similar problem as yourself in the future.

Clive
Runner_1Revised.gif

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"To err is human, but to really foul things up you need a computer." (Paul Ehrlich)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To get the best answers from this forum see: faq102-5096
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top