如何从java中的wsdl文件生成soap请求xml
我正在寻找一些 java 开源 api,通过将 wsdl_URL 和操作名称作为参数传递来生成soap请求xml文件。实际上,soapUI 正在执行此操作,我尝试查看soapUI 源代码,但我无法理解整个代码来完成我的任务。
有没有可用的 java api 来执行此操作(apache 或其他)?
我在网上花了几天时间,没有看到任何结果。
如果有人有任何想法请帮助我。
提前致谢。
I am looking for some java opensource api for generating soap request xml file by passing wsdl_URL and operation name as parameters. Actually soapUI is doing this and I tried to go through the soapUI source code, but I am not able to understand the whole code to get my task done.
Is there any java api available to do this (apache or something)?
I spent couple of days in the net and didn't see any result.
If any body has any idea please help me.
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
您可以使用开源 Membrane SOA 库 ([http://www.membrane-soa.org/soa-model-doc/1.4/java-api/create-soap-request-template.htm]) 为中定义的每个操作生成 XML WSDL:
You can use the open-source Membrane SOA library ([http://www.membrane-soa.org/soa-model-doc/1.4/java-api/create-soap-request-template.htm ]) to generate XMLs for each operation defined in the WSDL:
Soap UI 还提供 Java Api 用于从 WSDL 创建请求和响应 xml。
Soap UI 的开发者角提供了与soap集成的很好的指导用户界面 API。
Soap UI also provide Java Api for creating request and response xml from WSDL.
Developer's corner of Soap UI has nice pointers for integrating with soap UI Api.
看看 AXIS
http://axis.apache.org/axis2/java/core/< /a>
Have a look at AXIS
http://axis.apache.org/axis2/java/core/
如果您有
SOAPHandler
用于请求,您可以像这样打印您的xml:并在
handleMessage
和handleFault
中调用此方法。换句话说,如果你不使用apache或其他库来调用soap服务,可以使用手动查看jdk中的
MessageWrapper
类构造函数,并在packet
变量上添加断点并查看调试模式下的p.toString()
:)if you have
SOAPHandler
for request, you can print your xml like this:and call this method in
handleMessage
andhandleFault
.in another way if you don't use apache or another library for calling soap service, use can see
MessageWrapper
class constructor in jdk manually and add break point onpacket
variable and seep.toString()
in debug mode :)