Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Linking Two Web Applications.

by artist (Parson)
on Sep 01, 2004 at 16:05 UTC ( [id://387574]=perlquestion: print w/replies, xml ) Need Help??

artist has asked for the wisdom of the Perl Monks concerning the following question:

I have following condition:
I have 2 web application running for our customers. Customers can choose to have accounts at either or both applications. Each application has different logins. Each application provide different types of data. I like to provide a functionality for the customers who have both accounts. I like to 'hyperlink' an item from account A to the corresponding item the account B. Application 'B' is not controlled by me and is written in ASP and uses ASP+Javascript to display the pages. I control application 'A'. The question is how do I architecture to have this possible. Can I use WWW::Mechanize (My guess.. NOT). What are the other options?

For simplification, assume that application 'A' is showing only book id numbers & book titles for search words. Application 'B' provides the related information about the book when given the book id. I like to hyperlink the 'booktitle' in application 'A' to book-information in application 'B' via book-id.

Thanks,
artist

Replies are listed 'Best First'.
Re: Linking Two Web Applications.
by NetWallah (Canon) on Sep 01, 2004 at 16:42 UTC
    Web-screen scraping is less desirable than SOAP (Ass suggested by fireartist.

    If you can get the cooperation of the "B" team, a better option would be for them to provide a web-service, that you can call from your server.

    If that is not possible, I suggest do some background downloading (probably using Mechanize or other LWP flavour), save the info into a local database on the A server, and use that to populate info into your app.

    This should make your app (A) more responsive and reliable, because you reduce real-time lookups on (B).

        Earth first! (We'll rob the other planets later)

Re: Linking Two Web Applications.
by fireartist (Chaplain) on Sep 01, 2004 at 16:10 UTC
    What exactly do you mean by 'hyperlink' an item from app A to app B?

    Is it an option to ask the developer of app B to agree an API for SOAP or even simple http FORM submissions?
      I am able to get the point that if customer has logged in there is no problem in getting hyperlink working. Now the question becomes: how I can log-in to application B (silently) while logging in application 'A'.

        You'd need to have their login information for application B available to you in application A. Which means that your users would have to tell you how to log in to application B for them ... which strikes me as a thing you're unlikely to get people to do. Even if you could, that's a really bad solution. For one, can you guarantee that user "artist" on your application is the same individual as "artist" on their application?

        Assuming you can't just unify the user databases and authentication mechanisms for applications A and B (this is a "single sign-on" scheme), you could to try to work something out with the maintainers of the other application that involves them trusting your application that when your application says this is user X, it really is who they'd call user X. But that seems unlikely, since (for example) you won't be able to guarantee that user names are the same across the application. Even if you found a way around that, can you guarantee that your users can't spoof their names on the other application?

        Changing protocols to SOAP (assuming you can get the maintainers of B to expose those services) is a good idea in the abstract, but it doesn't solve this fundamental problem. There is no purely programmatic solution to this problem that you can implement by yourself. Well, none that's ethical, anyhow.

        If not P, what? Q maybe?
        "Sidney Morgenbesser"

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://387574]
Approved by fireartist
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (7)
As of 2024-03-29 13:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found