|
Posted by Johnny on 10/11/06 12:57
<worlin@hotmail.co.uk> wrote in message
news:1160569645.881570.279700@k70g2000cwa.googlegroups.com...
>
> Johnny wrote:
> > <worlin@hotmail.co.uk> wrote in message
> > news:1160558424.384796.315480@e3g2000cwe.googlegroups.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("MyComp", 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
http://us2.php.net/manual/en/ref.xml.php
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.
Navigation:
[Reply to this message]
|