Send XML from PHP to C++ Server

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • worlin@hotmail.co.uk

    Send XML from PHP to C++ Server

    s it possible to send an XML request from PHP to a C++ XML Server. The
    server is listening on a port and I can connect and send xml via a
    simple C++ client, but I can't get it going with PHP.

    I connect to the port fine, but can't seam to send any information.

    Can anyone shed any light on how to do this.

    Thanks
    Jay

  • Johnny

    #2
    Re: Send XML from PHP to C++ Server


    <worlin@hotmail .co.ukwrote in message
    news:1160558424 .384796.315480@ e3g2000cwe.goog legroups.com...
    s it possible to send an XML request from PHP to a C++ XML Server. The
    server is listening on a port and I can connect and send xml via a
    simple C++ client, but I can't get it going with PHP.
    >
    I connect to the port fine, but can't seam to send any information.
    >
    Can anyone shed any light on how to do this.
    >
    Thanks
    Jay
    >
    Give us some idea of what you are already trying....



    Comment

    • worlin@hotmail.co.uk

      #3
      Re: Send XML from PHP to C++ Server

      Hi Jonny,

      This is what i am trying:

      $socket = pfsockopen("MyC omp", 10000);
      $xml = "XML2Send";

      $res = fwrite($socket, $xml);
      >From the servers point of view the text coming in is junk.
      The server is expecting unicode text, because of this do I have to
      encode what I want to send before sending it or anything?

      Thanks
      Jay

      Johnny wrote:
      <worlin@hotmail .co.ukwrote in message
      news:1160558424 .384796.315480@ e3g2000cwe.goog legroups.com...
      s it possible to send an XML request from PHP to a C++ XML Server. The
      server is listening on a port and I can connect and send xml via a
      simple C++ client, but I can't get it going with PHP.

      I connect to the port fine, but can't seam to send any information.

      Can anyone shed any light on how to do this.

      Thanks
      Jay
      >
      Give us some idea of what you are already trying....

      Comment

      • Johnny

        #4
        Re: Send XML from PHP to C++ Server


        <worlin@hotmail .co.ukwrote in message
        news:1160569645 .881570.279700@ k70g2000cwa.goo glegroups.com.. .
        >
        Johnny wrote:
        <worlin@hotmail .co.ukwrote in message
        news:1160558424 .384796.315480@ e3g2000cwe.goog legroups.com...
        s it possible to send an XML request from PHP to a C++ XML Server. The
        server is listening on a port and I can connect and send xml via a
        simple C++ client, but I can't get it going with PHP.
        >
        I connect to the port fine, but can't seam to send any information.
        >
        Can anyone shed any light on how to do this.
        >
        Thanks
        Jay
        >
        Give us some idea of what you are already trying....
        >
        top posting adjusted...
        Hi Jonny,
        >
        This is what i am trying:
        >
        $socket = pfsockopen("MyC omp", 10000);
        $xml = "XML2Send";
        >
        $res = fwrite($socket, $xml);
        >
        From the servers point of view the text coming in is junk.
        >
        The server is expecting unicode text, because of this do I have to
        encode what I want to send before sending it or anything?
        >
        Thanks
        Jay
        I've done this to a server but not when it requires unicode.
        you could try some of the functions mentioned here

        I see there's a http://us2.php.net/manual/en/function.utf8-encode.php
        mentioned, that might do the trick.
        Also as I recall you need to specify in the xml header what encoding is used
        to that the receiver knows how to interpret the stream. Here's a bit about
        encoding from w3.org http://www.w3.org/TR/2000/REC-xml-20001006#charencoding
        tel us how you get on so others can learn.


        Comment

        Working...