使用Java中的SOAP Web服务,仅使用WSDL [英] Consume SOAP webservice in java, only WSDL in hand
问题描述
我需要使用Java/jsp代码使用Web服务.我只有WSDL可以启动.
I need to consume a web service in java/jsp code. Only the WSDL is available for me to start.
我了解我需要使用AXIS2/CXF将WSDL转换为Java客户端JAR文件,但是我无法在此基础上构建整个应用程序.
I understand I need to convert the WSDL into java client JAR file using AXIS2 / CXF but I cannot build the whole application on this.
有人可以为我提供一个简单的示例或基本步骤吗?
Can someone provide a simple example or basic steps for me to start on this?
我无法在这里加入点点滴滴. WSDL,Java客户端JAR,AXIS2....所有在线教程都指向创建" Web服务.
I am not able to join the dots here. WSDL, java client JAR, AXIS2.... All online tutorials point on 'creating' a web service.
推荐答案
WSDL只是Web服务的问题.您需要使用它生成客户端代码,稍后您可以实现代码以调用Web服务.就像@maerics指出的那样,您应该使用wsdl2java为AXIS2生成客户端代码,并使用客户端来使用Web服务.
WSDL is just the conract for the web service. You need to generate client code using it, later you can implement your code to call the web service. Like @maerics pointed out, you should use wsdl2java to generate your client code for AXIS2 and use your client to consume the web service.
您可以检查此链接有关为AXIS2生成客户端存根的示例.
You can check this link for an example of client stub generation for AXIS2.
这篇关于使用Java中的SOAP Web服务,仅使用WSDL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!