关于WebService的问题,都进来看看吧,不知道你们遇到过没有! 头都被它整大啦。

取与舍 2012-05-16 04:58:34
现在有这么一个WebService的地址:http://xxx.xxx.xxx.xxx:8080/OrderServerWS?wsdl
它里面提供了这么一个方法:PosMessage transact(PosMessage msg)
因为WebService里面方法参数是一个对象,那么我应该怎么调用?我没有此WebService对应的接口噢!
想了大半天,试了许多方法,都没有成功,不知道有大神知道不。
WebService的WSDL文件如下:

<?xml version="1.0" encoding="UTF-8"?>
<definitions name="OrderServerWS" targetNamespace="http://thirdpart.service.dnapay/" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://thirdpart.service.dnapay/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
<types>
<xsd:schema>
<xsd:import namespace="http://thirdpart.service.dnapay/" schemaLocation="OrderServerWS_schema1.xsd"/>
</xsd:schema>
</types>
<message name="transactResponse">
<part name="return" type="tns:posMessage">
</part>
</message>
<message name="transact">
<part name="arg0" type="tns:posMessage">
</part>
</message>
<portType name="IOrderServerWS">
<operation name="transact" parameterOrder="arg0">
<input message="tns:transact">
</input>
<output message="tns:transactResponse">
</output>
</operation>
</portType>
<binding name="OrderServerWSPortBinding" type="tns:IOrderServerWS">
<soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="transact">
<soap:operation soapAction=""/>
<input>
<soap:body use="literal" namespace="http://thirdpart.service.dnapay/"/>
</input>
<output>
<soap:body use="literal" namespace="http://thirdpart.service.dnapay/"/>
</output>
</operation>
</binding>
<service name="OrderServerWS">
<port name="OrderServerWSPort" binding="tns:OrderServerWSPortBinding">
<soap:address location="http://xxx.xxx.xxx.xxx:8080/OrderServerWS"/>
</port>
</service>
</definitions>




有大神知道吗?还请赐教啦。WebService我是第一次接触,麻烦各位大大多多指教噢。我应该用XFire还是Axis呢?

非常感谢回复的各位,以及进来看小弟问题的各位。
...全文
303 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
热烈的红颜 2012-05-18
  • 打赏
  • 举报
回复
这个简单啊
你找一个 CXF,AXIS生成以下客户端 WSDL2JAVA 就对了
或者 如果你是用的JDK1.6以上版本 你可以直接使用JDK 自带的JAX-WS的wsimport命令 一下就生成客户端了 就OK了
取与舍 2012-05-17
  • 打赏
  • 举报
回复
没有人知道吗?求大神。
龙四 2012-05-17
  • 打赏
  • 举报
回复
[Quote=引用 6 楼 的回复:]

如果真的可以直接调的话 java 还安全吗? 感觉不可以调用吧 ,
[/Quote]


。。。要么生成客户端,要么自己写客户端拼报文用java发送,接收报文自己解析,就这么两种做法
huage 2012-05-17
  • 打赏
  • 举报
回复
如果真的可以直接调的话 java 还安全吗? 感觉不可以调用吧 ,
龙四 2012-05-17
  • 打赏
  • 举报
回复
xfire就不要去用了,要么axis2要么cxf

他们都提供了wsdl2java工具,通过wsdl生成java客户端以方便调用
取与舍 2012-05-16
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 的回复:]

http://www.diybl.com/course/3_program/java/javajs/20090415/165030.html
[/Quote]
不是我想要的啦。不过还是谢谢。
hugo000002020 2012-05-16
  • 打赏
  • 举报
回复
http://www.diybl.com/course/3_program/java/javajs/20090415/165030.html
刚学WebService遇到一个问题,按视屏敲的代码,它生成的wsdl页面与自己的不一样,我的没有types,结构完全不同了 This XML file does not appear to have any style information associated with it. The document tree is shown below.

81,111

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧