Pepe553156

Hello everyone.

I have a question about how to open a web asp.net vb 2005 application from a stand alone application, and return values that will be returned to the stand alone application.

Here is the request:

Application A is a stand alone in vb.net or oracle jdevelopper application

Application B is an Web asp.net, vb and MS 2005

Steps:
- From a form in application A, an user clicks on a button 'Get Total Amount'
- the button opens a web asp.net page that shows several selections
- the user makes selections
- the web page calculates a Total Amount
- the web page returns the total amount to the stand alone vb.net/jdeveloper application
- the stand alone vb.net or jdeveloper application saves the information on the database.


Questions:
- how do I pass the total amount calculated in the web Default.aspx page back to the stand alone vb.net or jdeveloper application form
- Do I need a web service for that
- Which one is the best forum to find an answer to that


Thanks



Re: ASMX Web Services and XML Serialization How to call a web applicatoin from a a stand alone application

John Saunders

Yes, I think that you should redesign your solution using web services.

Create a web service that performs the "get total amount" function.

If you still need a web application, the web application can "show several selections" and then call the web service to do the calculation. It can then display the results.

Your VB.NET application (presumably Windows Forms) can display its own user interface, then call the web service to do the calculation. It can then display the results.

Your JDeveloper application can display its own user interface, then call the web service ...

I'm sure you see the pattern by now. Refactor the common functionality (the calculation) into a shared piece of code. The best way to share such functionality across heterogeneous platforms is through a web service, so put the calculation into the web service, and everyone will be able to use it.

If you're just starting out with web services, then I'd suggest you consider starting with WCF. It provides the greatest amount of flexibility, power, and standards compliance. See the following, from http://msdn2.microsoft.com/en-us/library/ms735119.aspx:

Windows Communication Foundation

Windows Communication Foundation (WCF) is Microsoft¡¯s unified programming model for building service-oriented applications. It enables developers to build secure, reliable, transacted solutions that integrate across platforms and interoperate with existing investments.

Guide to the Documentation

A set of suggested topics to read, depending on your familiarity (novice to well-acquainted) and need.

Conceptual Overview

The larger concepts behind WCF.

Getting Started Tutorial

A set of walkthrough topics that introduces you to the experience of programming WCF applications.

Basic WCF Programming

A set of primer topics that you should understand to become a proficient WCF programmer.






Re: ASMX Web Services and XML Serialization How to call a web applicatoin from a a stand alone application

Pepe

John Saunders,

thank you very much for your answer it is very complete ad I am going to spend some time learning the WCF model.

Currently my
web application shows several selections and calculates a result. this part works fine. I have it in a Default.aspx page. The calculation is not a simple mathematical operation, but the result of a selection on a screen. for example my screen has a button "Select Stars" and like in the example below it will give the result 2, when drawing a rectangle with the mouse over the map;
http://edndoc.esri.com/arcobjects/9.2/Java/java/server/web_adf/ArcIMS/simple_ims_app.htm

the selection iside the maps works fine!!


My problem is:
  • how can I return the value calculated - the value 2 - obtained on the Default.aspx page to the stand alone application -windows form or Oracle forms (jdeveloper) - that needs to retrieve this total counter.
  • also how can I call the Default.aspx form the windows forms or jdeveloper application
  • can I call a web service to do that
    • open the Default.aspx web page for example using Default ID=12345
    • the web service waits for a value returned by the Default.aspx web page
    • the web service returns to the stand alone application the value returned by Default.aspx
thanks











Re: ASMX Web Services and XML Serialization How to call a web applicatoin from a a stand alone application

John Saunders

It reallly sounds like you have a great solution to part of your problem - how to calculate this value from user input, with a pleasing user interface.

If I understand you correctly, your problem is with the second part - how to get the calculated value to where it can be used - by either a Windows Forms or JDeveloper application.

The problem is that you should probably have thought about the second part before starting on the first part. But, let's do that now, together.

I'm not familiar with JDeveloper applications. What kinds of input can they accept For instance, I hope they can take input from a web service, but what else can they handle

Then, you have to ask the same question about the Windows Forms application, though in that case, the answer is that it can accept anything reasonable.

So, you need to find an input mechanism which is common to both JDeveloper and Windows Forms.

Another question: what is the technology of JDeveloper Is it pure Java JavaScript

If all three pieces were HTML and Browser-based, then one solution would be to have the two "standalone" applications launch the web application in a pop-up. When the web application had completed the calculation, it could store the value in a hidden field or something like that. The "standalone" applications could then grab the value of the hidden field from the DOM of the pop-up.

Windows Forms has the Web Browser control that you could use for a purpose like this. I don't know whether JDeveloper has an equivalent, or whether it has any good ways of interacting with web pages.

Does this have to work with both JDeveloper and Windows Forms, or only one of the two

A web service won't help you in either case (so you can stop learning WCF now ). The reason is that all the hard work is being done by your web application, and the calculated values exist only inside of a browser instance, and you have to get them out somehow!

Note that, for an instant, the caculated value may exist on the web server, if the calculation was done on the server. But the server then sends the value back to the browser, and the answer is now gone. There's nothing left on the server for a web service to query, unless you store the answer in a database and have a web service look in the database

I'm really not sure I'd have design it this way...






Re: ASMX Web Services and XML Serialization How to call a web applicatoin from a a stand alone application

Pepe

The stand alone application and the web aplicaiton are applicaitons evelopped by differnt tram with different featues and functionaltiies.

the stand alone application wa created for data entry purposes but now we realize that it needs a valua that can be obtained by the web application.

The web application is a GIS map application that allows to select features on the screen and count them.

I suppose that today there are plenty of needs to make heterogeneous applications communicate, this is one of the goals of SOA (Service Oriented Architecture ) architectures, to allow that.

I think that a solution exists, but I need to find the right forum

Thank you








Re: ASMX Web Services and XML Serialization How to call a web applicatoin from a a stand alone application

John Saunders

Is there one standalone application, or two Is the standalone application already written Is it written in JDeveloper






Re: ASMX Web Services and XML Serialization How to call a web applicatoin from a a stand alone application

Pepe

Yes both applications already exists:
  • the stand alone in jdevelopper
  • the web in asp.net vb 2005




Re: ASMX Web Services and XML Serialization How to call a web applicatoin from a a stand alone application

John Saunders

Ok, it seems that I misread your post. I thought that you had two standalone applications, one in JDeveloper and one in .NET. That didn't make any sense at all!

Since the application you need to integrate with is in JDeveloper, I suggest you ask your question on the JDeveloper site (http://www.oracle.com/technology/products/jdev/index.html). A quick look at their site shows that their new release has something that might help you (see http://www.oracle.com/technology/products/jdev/collateral/papers/10131/newfeatures/index.html#webclipping):

  • WebClipping Portlet: A browser-based declarative tool that empowers business users to create their own feeds with no programming required. In addition, users can use the WebClipping Portlet to clip some information to determine whether they need to ask IT to provide a supporting feed. Using the Web Clipping portlet, users can create Web 2.0 mashups from nearly any source.

Good Luck!






Re: ASMX Web Services and XML Serialization How to call a web applicatoin from a a stand alone application

Pepe

How will you do if the stand alone application was created with visual basic

let's say:

  • the stand alone is a .exe created in visual basic or visual basic.net
  • the web in asp.net Visual Studio 2005




Re: ASMX Web Services and XML Serialization How to call a web applicatoin from a a stand alone application

John Saunders

If the standalone application were written in any .NET language, then I would use the WebBrowser control to launch the web application.

If the web application were ASP.NET, then I'd set it to produce XHTML. That would make it possible to process the resutls as XML. This would also make it easier for non-.NET applications to process the output.

Using events on the WebBrowser control, I would listen for the return of the final result from the web application. When that happened, I'd grab the results from the control, and load them into an XPathDocument. I'd use an XPath expression to select the result. I would then close the Web Browser control and use the result.






Re: ASMX Web Services and XML Serialization How to call a web applicatoin from a a stand alone application

Pepe

John,

when you say "If the web application were ASP.NET, then I'd set it to produce XHTML. That would make it possible to process the resutls as XML".

actually will be able to do that, I can write the result as an XML in the web application. Where do I write it to be able to read it for the stand alone application


and when you said "
Using events on the WebBrowser control, I would listen for the return of the final result from the web application." do you mean the XML data

thanks










Re: ASMX Web Services and XML Serialization How to call a web applicatoin from a a stand alone application

John Saunders

A web application produces HTML (or XHTML in this case). The web browser control allows you to access the produced (X)HTML. If your web application simply outputs its result as XHTML, then you'll be able to grab it. You may not have to change the output of the application at all, just changing the site to be XHTML compliant should come close to doing the job for you.

If you're ok with changing the output, then just have the web page produce XML as its final output instead of HTML. Just create your XML in an XmlDocument, then just use:

Code Snippet

document.Save(Response.Output)

See the documentation on WebBrowser.DocumentText for one example of how to get information from the control.






Re: ASMX Web Services and XML Serialization How to call a web applicatoin from a a stand alone application

Pepe

What do you think about this answer
http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=1898921&SiteID=1





Re: ASMX Web Services and XML Serialization How to call a web applicatoin from a a stand alone application

John Saunders

That looks like a good solution. Just cause the value to be placed in a hidden field you create in the page, then read the value as the other post shows.

Good luck with this. Please let us know how it works.