For Programmers: Free Programming Magazines  


Home > Archive > PHP Language > July 2004 > object transportation and exchange









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author object transportation and exchange
wolfgang wagner

2004-07-26, 3:56 am

hi all!

i'd like to write an application which is able to transport an object
from a php site to a locally on the machine installed application.
what kind of transportation mechanism should i use? webservices? rpc?
sockets? or is there another way??
what would you propose??

thx for your help in advance

wolfgang w.
Setec Astronomy

2004-07-26, 8:57 am

wolfgang wagner wrote:

> i'd like to write an application which is able to transport an object
> from a php site to a locally on the machine installed application.
> what kind of transportation mechanism should i use? webservices? rpc?
> sockets? or is there another way?? what would you propose??


Hi,
using serialization you can use any type of transportation mechanism
that allows to "move" strings. Depending on the application
requirements you can chose one or another.

--
I am what I am, I do what I can
L'uomo, conscio di sbagliare, persevera.
wolfgang wagner

2004-07-26, 8:57 am

Setec Astronomy wrote:

> wolfgang wagner wrote:
>
>
>
>
> Hi,
> using serialization you can use any type of transportation mechanism
> that allows to "move" strings. Depending on the application
> requirements you can chose one or another.
>


ok, the problem for me is to find a way how a c#-written application
installed on a machine is able to exchange data(objects) with a php
script (on a webserver) and vice versa. the structures of the object are
known on both sides.
Ike

2004-07-26, 3:56 pm

Wolfgang,

I'm trying the very same thing, in Java however. It seems a function in the
application language to unserialize a php-serialized object is necessary. To
make my case further complicate, I have to pass N objects over at once (from
an SQL query), which I am trying to pass in an Array. Further, I am not so
sure the data must be serialized to send back, or if I can merely send it
back as Strings in an Array, and cast it to the appropriate type in my
Application.

I hope you keep us/me informed of any progress you make here (mostly on the
application side - the c# side in your case) as that is where I am
struggling. Thanks, Ike

p.s. here is how I am sending back to my application

<?php
include("ggconn.inc"); //get $database, username, password &connect
$sql = stripslashes($_POST['sqlField']); //the query sent as an http
post
//echo $sql."\n";
$dbi = mysql_select_db($database);
$qid = mysql_query($sql);

echo "{";
for ($i = 0; $i < mysql_num_fields($qid); $i++) {
$hdr = mysql_field_name($qid, $i);
if (!$hdr) {
// print ("No Information available<br>\n");
continue;
}
if($i>0)
echo ",";
echo htmlspecialchars($hdr);
}
echo "}{";
$u=0;
while ($row = mysql_fetch_row($qid)) {
if($u>0)
echo ",";
$u++;
echo "{";
for ($i = 0; $i < mysql_num_fields($qid); $i++) {
if (mysql_field_name($qid, $i)) {
if($i>0)
echo ",";
echo htmlspecialchars($row[$i]);
}
}
echo "}";
}
echo "}";

mysql_free_result($qid);
mysql_close($dblink);
?>

"wolfgang wagner" <longbow@gmx.de> wrote in message
news:vw3Nc.436$Mg2.39229@newsread.de.ignite.net...
> Setec Astronomy wrote:
>
>
> ok, the problem for me is to find a way how a c#-written application
> installed on a machine is able to exchange data(objects) with a php
> script (on a webserver) and vice versa. the structures of the object are
> known on both sides.



Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com