473,383 Members | 1,815 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

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

Oct 11 '06 #1
3 2125

<wo****@hotmail.co.ukwrote in message
news:11**********************@e3g2000cwe.googlegro ups.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....

Oct 11 '06 #2
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

Johnny wrote:
<wo****@hotmail.co.ukwrote in message
news:11**********************@e3g2000cwe.googlegro ups.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....
Oct 11 '06 #3

<wo****@hotmail.co.ukwrote in message
news:11**********************@k70g2000cwa.googlegr oups.com...
>
Johnny wrote:
<wo****@hotmail.co.ukwrote in message
news:11**********************@e3g2000cwe.googlegro ups.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.
Oct 11 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Google Mike | last post by:
I've got RH9 Linux with default PHP. Is there a way to send email on Linux to an Exchange Server from PHP and/or other tools when there is *NOT* SMTP access? Has anyone figured out a way to...
4
by: zhimin | last post by:
Hi, I'm writing a program to send large file(100m) through dotnet using TCPListener & TCPClient, I'm sending the file with a ask and response loop: 1. Client send a flag 1 to server indicate it...
5
by: zorhel | last post by:
Hi. My clients will be IE, Mozilla and Opera in a Windows and *nix OS. So, my web app need to, from a server, send messages to a specific client (browser), send messages for all clients,...
3
by: RN | last post by:
I am tired of sending mail from the built-in SMTP service for so many reasons (errors are nondescriptive in the event log, it doesn't let me control which IP address it sends from, and it...
14
by: supz | last post by:
Hi, I use the standard code given below to send an email from an ASP.NET web form. The code executes fine but no Email is sent. All emails get queued in the Inetpub mail queue. I'm using my...
2
by: yvan | last post by:
Hi, Here is my client/server scenario: Step1: Client connects to server and sends data sucessfully (using Socket.Send()). Step2: Server gracefully exists (calls Socket.Shutdown() and...
14
by: eliss.carmine | last post by:
I'm using TCP/IP to send a Bitmap object over Sockets. This is my first time using C# at all so I don't know if this is the "right" way to do it. I've already found out several times the way I was...
4
by: Joseph Geretz | last post by:
We use a Soap Header to pass a token class (m_Token) back and forth with authenticated session information. Given the following implementation for our Logout method, I vastly prefer to simply code...
1
by: danfolkes | last post by:
Hey Everyone, I am trying to send repeated messages from a "Node" to a "Server". It works the first time I send the from the Node to Server, but after that it either errors, or does not do...
0
by: Xionbox | last post by:
Hello everybody, The error I have seems very easy to solve, but for some odd reason I can't seem to solve it. Anyways, here's my "setup". I created a server running on localhost:1200 (telnet...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.