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]
I could obtain the data in the XML document by:
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!
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!