This is a discussion on XML posting within the alt.comp.lang.php forums, part of the PHP Programming Forums category; I wan't to send a string containing XML to a Microsoft XML gateway. I'm using the include code ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
I wan't to send a string containing XML to a Microsoft XML gateway.
I'm using the include code below as an include and calling the function with somthing like the calling code. I have sent the streem to a port listener and all is fine but when its sent to the gateway I just get a Incorrect RequestType. I'm just wondering if anyone knows what I'm missing or doing wrong, I can find an abundance if info on parceing XML but idealy I just want a class to SEND an XML string. Any help would be appriciated.. Thanx Lyn *********Calling Code************* $server = "192.168.0.5"; $port = "80"; $req = stripslashes('<\?xml version = "1.0"\?><!DOCTYPE ScheduleRequest SYSTEM "ScheduleRequest.dtd"><ScheduleRequest version="1.2.4"><Site><SiteID>28</SiteID><StartDate>20031128</StartDate><End Date>20031128</EndDate></Site></ScheduleRequest>'); $tx = 'XMLGateway/xmlgateway.asp'; $rx = txrx($server, $port, $tx, $req); *******code end******************* **********Include Code************* <? function txrx($server, $port, $tx, $req){ $rx = ""; if ($server == ""){$rx = "Error - Missing Server";} if ($port == ""){$rx = "Error - Missing Port";} //if ($tx == "") {$rx = "Error - No data to send";} if ($rx == "") { $tx = "GET /$tx HTTP/1.0\x0D\x0A"; $length = strlen($encreq); $tx .= "\x0D\x0A"; // THE END $tx .= $req; } //echo $tx; $fp = fsockopen($server, $port); if($fp) { fputs($fp, $tx); while(!feof($fp)) { $rx .= fread($fp, 1000); } fclose($fp); } return $rx; } ?> **********Code End*********** |
|
|||
|
Hello,
On 12/09/2003 10:02 AM, Lyn Hartley wrote: > I wan't to send a string containing XML to a Microsoft XML gateway. > > I'm using the include code below as an include and calling the function with > somthing like the calling code. I have sent the streem to a port listener > and all is fine but when its sent to the gateway I just get a Incorrect > RequestType. > > I'm just wondering if anyone knows what I'm missing or doing wrong, I can > find an abundance if info on parceing XML but idealy I just want a class to > SEND an XML string. You may want to try this HTTP client class that even comes with an example for making a SOAP request by posting XML request data: http://www.phpclasses.org/httpclient -- Regards, Manuel Lemos Free ready to use OOP components written in PHP http://www.phpclasses.org/ |
![]() |
| Thread Tools | |
| Display Modes | |
|
|