Does it mean the following ?
1. There is an application running on a server that is not written in Java, let's say in C#.
2. The solution is to expose this C# application to EJB as a web service.
3. With this solution, any new clients can connect to this C# application via this EJB web service.
Here may be the code that describe this question.
Code: Select all
//psudo code
@WebService
@Stateless
public class Compute
//This is the endpoint where the C# application is published.
String endpoint = "http://www.CSharpApplication.com/compute"
public int compute(){
QName serviceName = new QName("myService","");
QName portName = new QName("myPort","");
Service service = Service.create(serviceName);
service.addPort(portName, HTTPBinding.HTTP_BINDING, endpoint);
//suppose createXMLSource creates an XML request
DOMSource xmlRequest = createXMLSource();
Dispatch<DOMSource> dispatch = service.createDispatch(port, DOMSource.class, Service.Mode.PAYLOAD);
return dispatch.invoke(xmlRequest);
}