Professional Web Applications Themes

XML posting - PHP Development

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

  1. #1

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


    Lyn Hartley Guest

  2. #2

    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:

    [url]http://www.phpclasses.org/httpclient[/url]

    --

    Regards,
    Manuel Lemos

    Free ready to use OOP components written in PHP
    [url]http://www.phpclasses.org/[/url]

    Manuel Lemos Guest

Similar Threads

  1. Posting To A URL
    By AwesomeDigital3 in forum Macromedia Flex General Discussion
    Replies: 7
    Last Post: April 12th, 03:37 PM
  2. not posting
    By Nospam in forum PERL Modules
    Replies: 0
    Last Post: November 27th, 08:22 PM
  3. First posting ?
    By MaX in forum Photography
    Replies: 0
    Last Post: December 29th, 11:09 PM
  4. FS posting?
    By Chester in forum Macromedia Director Basics
    Replies: 0
    Last Post: November 1st, 02:29 AM
  5. Re Posting this Pls Help
    By brad anderson in forum FileMaker
    Replies: 3
    Last Post: September 16th, 10:46 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139