SunQuest
           Java Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming LanguagesJava Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
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  
Old January 9th, 2002, 09:27 AM
sgaucho sgaucho is offline
Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2002
Posts: 26 sgaucho User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 m 28 sec
Reputation Power: 0
Question servlet output- urgent!!

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

Reply With Quote
  #2  
Old January 14th, 2002, 03:48 PM
oscagne oscagne is offline
Java Developer
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2001
Posts: 5 oscagne User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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

Reply With Quote
  #3  
Old January 15th, 2002, 04:29 AM
sgaucho sgaucho is offline
Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2002
Posts: 26 sgaucho User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 m 28 sec
Reputation Power: 0
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

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesJava Help > servlet output- urgent!!


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway