aspose file tools*
The moose likes Servlets and the fly likes Passing info between J2EE and DOTNET web-apps. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Passing info between J2EE and DOTNET web-apps." Watch "Passing info between J2EE and DOTNET web-apps." New topic
Author

Passing info between J2EE and DOTNET web-apps.

Lance Clinton
Greenhorn

Joined: Sep 14, 2004
Posts: 5
Hi,

I have J2EE Websphere based secure web application. I am using IBM LDAP server for initial user authentication. On successful login, I have list different J2EE web apps available for user. User can access by pressing any buttons on main screen.

I have an existing .Net based application available. I also have web-url for this application. I wanted to add this entry point in our J2EE based main screen.

My question is I wanted to pass some secure information to DOT NET application so that they can utilise this information in their app.

I have one solution for this:
I can call sendRedirect(DOTNETAPPURL) and append some additional info to URL. Dotnet app can decode this URL to get passed information. problem with this method is, secured information being appended as browser URL. I know cookies is not useful.

Let me know if gurus have any other idea of passing info between different applications or any other leads ....


Thanks,
Lance
Jeroen Wenting
Ranch Hand

Joined: Oct 12, 2000
Posts: 5093
You can only use request parameters (in case you use POST requests) and URL parameters.
Your best bet is to use HTTPS for communications and (if this is possible) have the servers set up to accept only requests from trusted sources.

As the IP addresses of the current users and their credentials are known on the J2EE server (after all, they logged in through it in the first place) any request from elsewhere can be blocked and if user credentials are sent with the requests originating through .NET they can be checked against logged in users as well, eliminating the possibility of one user requesting information only another is allowed to see.

Always use POST requests when dealing with situations like this, it eliminates the request parameters from the URL.
And remember that only strings can be passed this way.


42
Lance Clinton
Greenhorn

Joined: Sep 14, 2004
Posts: 5
Jeroen,

Thanks for your quick valuable reply. I have one more quick question:

When I use sendRedirect(DOTNETURL) --> It is going as HTTP Get but not as post. Is there any settings I can make to send it as HHTP POST action instead of get.

Thanks a lot
rahul V kumar
Ranch Hand

Joined: May 20, 2003
Posts: 82
you could use database to share the secured information or maybe xml serialize the data and have the dotnet read it.

You might have additional overhead of cleaning up the info in database or deleting the data from file system.
[ March 04, 2005: Message edited by: rahul V kumar ]
Lance Clinton
Greenhorn

Joined: Sep 14, 2004
Posts: 5
Hi Rahul,

DOTNET application is completely developed and matained by different group which is located different city and we do not have any shared database access between J2EE apps and dotnet apps. And we wanted to leave like that if possible.

So only left option for me is to utilise the options avaible in HTTP/HTTPS and Servlet APIs. Can you further explain me how can I pass serialized XML object to dotnet app.

Thanks

rahul V kumar
Ranch Hand

Joined: May 20, 2003
Posts: 82
Can't use open a HttpConnection or a HttpsConnection and post the data to their url and have a response (Some token) from their server. Now you could redirect the user to their Application and send that token.

.Net Application could use the token you have supplied and pull out the data that you have sent through using HttpConnection or HttpsConnection.

By doing so you are not embedding your data in the URL.

I am not sure if this is the best way around ..but just throwing some ideas.

I have some questions for you. Maybe it will help find the best solution to address your issue.

1) But how often you need to send data from J2EE to .Net ?
2) Is it always one way communication. Does .Net send information to J2EE?
3) How do you make sure that sure that your sessions are active on J2EE & .Net as I guess its possible for the users to go back and forth between the applications.
[ March 04, 2005: Message edited by: rahul V kumar ]
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Originally posted by Lance Clinton:
Hi Rahul,

DOTNET application is completely developed and matained by different group which is located different city and we do not have any shared database access between J2EE apps and dotnet apps. And we wanted to leave like that if possible.

So only left option for me is to utilise the options avaible in HTTP/HTTPS and Servlet APIs. Can you further explain me how can I pass serialized XML object to dotnet app.

Thanks





I've had pretty good luck using Apache Axis (the web service engine) with .NET. Both have tools to autogenerate code for you from the other's WSDL.
Http://xml.apache.org/axis


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Passing info between J2EE and DOTNET web-apps.
 
Similar Threads
Legacy Connectivity ....thanx John and Amanda
Interlinking two seperate applications
Best implementation
Supporting multiple companies in a web application
Passing username from Java Application using httpHeader to OBIEE server