如何创建soap客户端?
我正在运行 SOAP 服务器。我需要为服务器编写一个 SOAP 客户端。你能建议 eclipse 中的插件或者给我与此相关的 URL 吗?
您能给我提供任何示例 SOAP 客户端代码吗?
我的 SOAP 客户端应该使用复杂对象作为 SOAP 服务器中公开的 SOAP 函数的参数/参数。
I have SOAP server running. I need to write a SOAP client for the server. Can you please suggest plugin in eclipse or give me the URL related to this?
can you please provide me it you have any sample SOAP Client code?
My SOAP client should use complex objects as parmeter/arguments for the SOAP function which is exposed in the SOAP server.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
假设 Java:
1.- 执行:
其中 myClient 将是包含生成的客户端工件的文件夹。 url_to_wsdl WSDL 的 URL。
2.- 使用包含以下代码的方法创建客户端类:
YourServiceClass 是生成的扩展 javax.xml.ws.Service 的工件。
YourEndpointClass 可以在调用 super.getPort() 的操作中的 YourServiceClass 中看到;
YourRequestClass 和 YourResponseClass 将取决于请求和响应消息的管理方式。
YourMessageClass 将是您的消息的包装类(取决于 WSDL)。
所有您的*类必须由
wsimport
生成并导入到您的客户端类。使用
wsimport
中的-keep
标志,您将能够查看.java
文件并确定完成此代码所需的类。Assuming Java:
1.- Execute:
Where myClient will be a folder with the generated client's artifacts. url_to_wsdl the url to your WSDL.
2.- Create a client class with a method with the following code:
YourServiceClass is the generated artifact the extends javax.xml.ws.Service.
YourEndpointClass can be seen in YourServiceClass in an operation that calls super.getPort();
YourRequestClass and YourResponseClass will depend on how is managed the Request and Response message.
YourMessageClass would be a wrapper class for your message (depending on WSDL).
All Your* classes must have been generated by
wsimport
and imported to your client class.With the flag
-keep
inwsimport
you'll be able to see the.java
files and determine which classes you require to complete this code.您的问题非常模糊,因此请使用 Apache CXF 并按照本教程进行操作:
另外,您也可以使用 Apache AXIS2。
Your question is very vague, so use Apache CXF and follow this tutorial:
Other wise, you can also use Apache AXIS2.
这里有一份关于如何创建一个的详细教程:Java 中的 SOAP 客户端
here's a detailed tutorial on how you can create one : SOAP Client in Java
将您的 eclipse 更新到最新版本(不过我也看到它与 Eclipse Europa 3.3.2 一起工作:))。转到新建项目向导,在Web 服务下选择Web 服务客户端,单击“下一步”,然后提供 Web 服务的 wsdl 文件位置。 Eclipse 将自动为您生成 Web 服务存根。
Update your eclipse to newest version (I have seen it working with Eclipse Europa 3.3.2 also though :) ). Go to new project wizard and under Web Service select Web Service Client, click next and then give wsdl file location of your web service. Eclipse will automatically generate web service stubs for you.
这是一个有点宽泛的问题。从我的角度来看,我建议使用 Apache CXF: http://cxf.apache.org/
有非常好的示例,您可以定义 WSDL 并生成服务器和客户端代码。还有 Maven 插件可以自动为你完成这项工作。嵌入由 WSDL 描述的现有 Web 服务也是可能的。
但这更多的是一个要求和品味的问题。
可以在这里找到替代方案: http://java-source.net/open-源/网络服务工具
Thats pretty much a little bit broad question. From my point of view i would suggest using Apache CXF: http://cxf.apache.org/
There are pretty good samples and you define a WSDL and generate the server as well as the client code. There are also maven plugins which do this JOB automatically for you. Embedding an existent web-service described by an WSDL is also possible.
But however this is more a matter of requirements and taste.
Alternatives may be found e.g. here: http://java-source.net/open-source/web-services-tools
你可以看看这个--> https://github.com/devashish234073/SOAP_GUI_PHP/blob/master/README。 MD
这是一个简单的 php SOAP 客户端。
使用与 php 相同的逻辑 [home.php],我还添加了 java版本
You can have a look at this --> https://github.com/devashish234073/SOAP_GUI_PHP/blob/master/README.md
This is a simple SOAP client in php.
Using same logic as the php one [home.php], I have also added the java version