aspose file tools*
The moose likes Web Services and the fly likes Exchange Web Service message between Desktop APP and Web App Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "Exchange Web Service message between Desktop APP and Web App" Watch "Exchange Web Service message between Desktop APP and Web App" New topic
Author

Exchange Web Service message between Desktop APP and Web App

Mario Razec
Greenhorn

Joined: Aug 01, 2008
Posts: 17
hi buddies,

I've built the web service/SOAP and worked. But I'm consuming separately.

How can I send message through Web Services/SOAP between Desktop APP and Web APP?

[DesktopApp] ----> Send the message --->[WebAPP] ---> Show the message

Desktop App

public class Main {
public static void main(String[] args) throws Exception {


String local = "http://localhost:8080/Buble/services/Message?wsdl";

Call call = (Call) new Service().createCall();

call.setTargetEndpointAddress(local);

call.setOperationName("sayHello");

Object[] param = new Object[] { new String("Baby")};
String ret = (String) call.invoke(param);

System.out.println("Name: " + ret);
}
}


Web App - index.jsp

<body>
<%
MessageService service = new MessageServiceLocator();
Message msg = (Message) service.getMessage();
out.println("Nome: " + msg.sayHello("Razec"));
%>
</body>

thanks in advance
Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
Hi!
Here is what I imagine could be a possible solution:
- The desktop application acts as a regular web service client and sends some data to a web service.
- The web service receives the data and updates the model of the web service + web application.
Alternatively, the web service can update a database.
- The update to the model or the database causes the web application to be notified that there is a change in the model data.
- The view of the web application request the new data and updates the view.

The problems with the above are:
- Does the web service and web application share a common model?
You don't say anything about the relation between the web service and web application - are they deployed in the same container, on the same machine or in different machines etc?
- How does the (web) view know, or get to know, that there has been an update to the data?
I don't know what plans you have for the UI - I guess you could use AJAX to push updates from the model to the web view.

Hope this is of any help!
Best wishes!
Mario Razec
Greenhorn

Joined: Aug 01, 2008
Posts: 17
Hi Ivan,

That is exactly what I thought. But I needed this answer.

you help me a lot.

Thanks so much...
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Exchange Web Service message between Desktop APP and Web App