-
求教:CXF 实现的web service,VFP调用出错10
我用cxf实现了web service,用java客户端测试成功,但客户的生产系统是用VFP开发的,客户通过VFP访问我的web service时却报错,我自己用VFP进行测试,确认会报如下错误:
OLE IDispatch exception code 0 from Client: Client:Incorrect number of parameters supplied for SOAP request HRESULT=0x80070057: 参数不正确。
- Client:Unspecified client error. HRESULT=0x80070057: 参数不正确。
我将接口简化为只有一个test方法,该方法只传入一个字符串变量,返回一个字符串结果,但报错依旧。wsdl内容如下:
<wsdl:definitions xmlns:ns1="http://schemas.xmlsoap.org/soap/http" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://ws.fitcolg.bepanda/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="StudentServiceImplService" targetNamespace="http://ws.fitcolg.bepanda/">
<wsdl:types>
<xsd:schema xmlns:tns="http://ws.fitcolg.bepanda/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http://ws.fitcolg.bepanda/">
<xsd:element name="test" type="tns:test"/>
<xsd:complexType name="test">
<xsd:sequence>
<xsd:element minOccurs="0" name="username" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
<xsd:element name="testResponse" type="tns:testResponse"/>
<xsd:complexType name="testResponse">
<xsd:sequence>
<xsd:element minOccurs="0" name="testResult" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
</wsdl:types>
<wsdl:message name="testResponse">
<wsdl: part element="tns:testResponse" name="parameters"></wsdl: part>
</wsdl:message>
<wsdl:message name="test">
<wsdl: part element="tns:test" name="parameters"></wsdl: part>
</wsdl:message>
<wsdl: portType name="StudentService">
<wsdl: operation name="test">
<wsdl:input message="tns:test" name="test"></wsdl:input>
<wsdl: output message="tns:testResponse" name="testResponse"></wsdl: output>
</wsdl: operation>
</wsdl: portType>
<wsdl:binding name="StudentServiceImplServiceSoapBinding" type="tns:StudentService">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl: operation name="test">
<soap: operation soapAction="http://ws.fitcolg.bepanda/" style="document"/>
<wsdl:input name="test">
<soap:body use="literal"/>
</wsdl:input>
<wsdl: output name="testResponse">
<soap:body use="literal"/>
</wsdl: output>
</wsdl: operation>
</wsdl:binding>
<wsdl:service name="StudentServiceImplService">
<wsdl: port binding="tns:StudentServiceImplServiceSoapBinding" name="StudentServiceImplPort">
<soap:address location="http://localhost:8080/stu/ws"/>
</wsdl: port>
</wsdl:service>
</wsdl:definitions>
我测试的VFP代码如下:
local loSoap
loSoap.MSSoapInit('http://localhost:8080/stu/ws?wsdl')
loSoap.test("tom" ) ----- 这一行报错,且调试得知未正常请求进入到webservice的后台方法
如果将loSoap.test("tom" )这一句的参数去掉,即变为:
loSoap.test() ---- 则能进入到webservice的后台方法,且客户端没有报错
如果将loSoap.test()这一句的结果输出,即变为:
messagebox(loSoap.test()) ---- 则客户端又报同样的错,但也能请求进入到webservice的后台方法
出错情况总结:
1、loSoap.test() --- 既不传入参,也不接收返回值,则没有报错,能正常调webservice方法
2、loSoap.test("tom" ) --- 传入参,则客户端报错,且没有调webservice方法
3、messagebox(loSoap.test()) --- 不传入参,但接收返回值,则能正常调webservice方法,但客户端报错
综上,只要没有参数传递,就正常,一有参数传入或接收,就客户端报错。
求教各位大侠了,先谢了!
2013年5月08日 10:00
目前还没有答案
相关推荐
Springboot整合CXF发布Web service和客户端调用(用户和密码验证)打开及用
CXF源码:CXF_Spring源码 CXF源码:CXF_Spring源码
电子书:Apache cxf web service development
Apache CXF Web Service Development
早先用java做web service找的一个教程,排版清晰且详细,适合没开发过web servcie的新手。
Web Service学习-CXF开发Web Service实例demo(一)
CXF Spring Web Service 程序,希望对大家有用!!
Maven坐标:org.apache.cxf:cxf-rt-frontend-simple:3.0.1; 标签:cxf、rt、apache、simple、frontend、jar包、java、API文档、中文版; 使用方法:解压翻译后的API文档,用浏览器打开“index.html”文件,即可纵览...
Spring MVC、CXF、Web Service
Apache CXF Web Service Development 源码
Maven坐标:org.apache.cxf:cxf-core:3.0.1; 标签:cxf、core、apache、jar包、java、API文档、中文版; 使用方法:解压翻译后的API文档,用浏览器打开“index.html”文件,即可纵览文档内容。 人性化翻译,文档中...
使用CXF开发Web Service,包含服务器端和客户端
Maven坐标:org.apache.cxf:cxf-rt-databinding-jaxb:3.0.1; 标签:cxf、databinding、rt、apache、jar包、java、API文档、中文版; 使用方法:解压翻译后的API文档,用浏览器打开“index.html”文件,即可纵览文档...
springboot整合CXF发布webservice和客户端调用 项目中每个类都有详细的注释,保证都能看懂,不失为一个学习springboot整合cxf来学习webservice发布调用的好例子
Maven坐标:org.apache.cxf:cxf-rt-transports-http:3.0.1; 标签:cxf、transports、rt、apache、http、jar包、java、API文档、中文版; 使用方法:解压翻译后的API文档,用浏览器打开“index.html”文件,即可纵览...
Maven坐标:org.apache.cxf:cxf-rt-bindings-soap:3.0.1; 标签:cxf、rt、apache、bindings、jar包、java、API文档、中文版; 使用方法:解压翻译后的API文档,用浏览器打开“index.html”文件,即可纵览文档内容。...
Maven坐标:org.apache.cxf:cxf-rt-frontend-jaxws:3.0.1; 标签:cxf、rt、apache、frontend、jaxws、jar包、java、API文档、中文版; 使用方法:解压翻译后的API文档,用浏览器打开“index.html”文件,即可纵览...
Maven坐标:org.apache.cxf:cxf-rt-ws-policy:3.0.1; 标签:cxf、rt、apache、policy、jar包、java、API文档、中文版; 使用方法:解压翻译后的API文档,用浏览器打开“index.html”文件,即可纵览文档内容。 人性...