Communication between web services on different servers
I have 2 different webservices running on 2 different tomcat application servers (w/ axis2 web service engine) (Webservice A runs on Server A and Webservice B runs on Server B).
How can web service A on Server A pass Data A (file) to Web Service B on Server B? I am new to web services and would appreciate any help in this regard. The webservices 开发者_StackOverfloware in Java.
Thanks!
Service A needs to be a client of service B. Service B should expose some method service A will consume (and pass required data using it). The process is as follows:
- If suitable service method doesn't exist yet in service B then add new method to service B's WSDL file.
- Regenerate intefaces from extended WSDL file.
- Create functional test for new service method .
- Make service A a consumer of method of new (extended) service.
- Create acceptance tests for service A methods using service B's method :-)
- Implement new service method in service B.
- Implement conusmer logic in service A.
Expose a "send" web-service API on B and call it from A.
There are thousends of ways, but with HTTP Protocol you can use: POST or PUT methods. However, you'll need to write application on each side...
精彩评论