By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,515 Members | 1,339 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,515 IT Pros & Developers. It's quick & easy.

Problems with xml and php

P: n/a
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***********


Jul 17 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Lyn Hartley wrote on Tuesday 09 December 2003 07:09:
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.
<snip>
$tx = "GET /$tx HTTP/1.0\x0D\x0A";


I think you should be doing a POST request, not GET; hence, the error.

--
Business Web Solutions
ActiveLink, LLC
www.active-link.com/intranet/
Jul 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.