|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
SlickEdit: Code in over 40 languages across 7 platforms. SlickEdit’s unmatched power, speed, and flexibility allows even the most accomplished developers to write better code faster. Download a free trial today! |
|
#1
|
|||
|
|||
|
Hi,
I am sending a username and password to a servlet for authentification. The servlet authentifies and outputs the response as: <?xml version="1.0" ?> - <palm_resp> - <palm_prof> <sess_id>123</sess_id> - <user> <code>123</code> <name>manuel</name> </user> - <app_info> <app_id>APP_1</app_id> <app_name>aplicacao 1</app_name> </app_info> </palm_prof> </palm_resp> I need to obtain this response in my PHP code in a variable so that I can parse it later.. Can anyone pl tell me as to how I can send this info from my servlet to my PHP?? TIA, sandeep |
|
#2
|
|||
|
|||
|
I've probably read this wrong, but it sound like one of the following
1) http response such as PrintWriter out = res.getWriter(); out.println("<authourised>true</authourised>"); out.flush(); out.close(); 2) you want the servlet to send and HTTP request to the PHP (which sound like a weird way of doing something, as it completely negate the transactional approach of servlets), but I don't know your reasoning, so you probably want to do it as below... HttpURLConnection con = (HttpURLConnection)new URL("http://www.phpserveraddress/phpscript.php?authourise=true"); con.setRequestMethod("GET"); con.getResponseCode(); Is that any help? Oscagne |
|
#3
|
|||
|
|||
|
diff problem
I do get the data now but hv a diff problem of that of parsing the data..
Hv posted the query on the PHP forum.. thnx, gaucho |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Java Help > servlet output- urgent!! |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|