简体   繁体   中英

Consume .NET web services in Java

I have created .NET web services. I want to run it on a remote server and have the Java Applications (clients) contact the server for data. How should I implement the Server such that the Clients can make use of the org.apache.xmlrpc.client.XmlRpcClient package?

I just want the clients to generate a request for data and does not want to have any other dependencies.

Here is a good material on using eclipse for this purpose: http://wso2.org/library/tutorials/creating-web-service-client-3-steps-using-eclipse

Thanks.

如果您在.NET端具有Web服务,则必须具有Web服务描述语言(WSDL)(如果您不是在谈论REST),则可以轻松创建客户端类以使用IDE来使用此Web服务,请检查此链接在这里: http : //netbeans.org/kb/docs/websvc/client.html

If you are using Eclipse I suggest you this tutorial to build a simple WS client.

You can adapt this example application to your real needs.

NOTE the example uses an old version of Eclipse, but the wizard is very similar also in newer versions.

Although both are rightfully called "web services" the SOAP based web services usually created in .net are incompatible with web services following the older XML-RPC standard .

In my opinion you can follow 2 routes to solve your problem:

  • either you go the SOAP route under Java, one of the most common API's for that purpose would be jax-ws - some excellent pointers to tutorials here, in Pascal Thivent's answer
  • or you transform your .net webservices to XMl-RPC by using xml-rpc.net

Both routes have advantages and disadvantages, it's hard to make that choice for you without knowing more about your project. A priori choosing the SOAP route might look "safer" as there the entire communication will be based on standard components.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM