XML posting

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 ...


Go Back   Usenet Forums > PHP Programming Forums > alt.comp.lang.php

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 12-09-2003
Lyn Hartley
 
Posts: n/a
Default XML posting

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***********


Reply With Quote
  #2 (permalink)  
Old 12-09-2003
Manuel Lemos
 
Posts: n/a
Default Re: XML posting

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/

Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 11:07 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0