Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Exchange Web Service message between Desktop APP and Web App

 
Mario Razec
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2198
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ivan,

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

you help me a lot.

Thanks so much...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic