我用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"/>