调用web service报参数不存在
小弟在做调用web service的时候,总是报Parameter {http://com.primeton.sample/BookService}buyBookin does not exist!
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions
targetNamespace="http://com.primeton.sample/BookService"
xmlns:ns2="http://call.webservice.base.samples.primeton.com"
xmlns:ns1="http://www.w3.org/2001/XMLSchema"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:nns="http://com.primeton.sample/BookService"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:soap12="http://www.w3.org/2003/05/soap-envelope"
xmlns:soapenc11="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:soap11="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:soapenc12="http://www.w3.org/2003/05/soap-encoding">
<wsdl:types>
<xsd:schema elementFormDefault="qualified" targetNamespace="http://call.webservice.base.samples.primeton.com" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:complexType name="Book">
<xsd:sequence>
<xsd:element minOccurs="0" name="author" nillable="true" type="ns1:string"/>
<xsd:element minOccurs="0" name="isbn" nillable="true" type="ns1:string"/>
<xsd:element minOccurs="0" name="name" nillable="true" type="ns1:string"/>
<xsd:element minOccurs="0" name="price" type="ns1:int"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="ArrayOfBook">
<xsd:sequence>
<xsd:element maxOccurs="unbounded" minOccurs="0" name="Book" nillable="true" type="ns2:Book"/>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
<xsd:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://com.primeton.sample/BookService" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:element name="buyBookin" type="ns2:ArrayOfBook"/>
<xsd:element name="buyBookout" type="ns1:int"/>
</xsd:schema>
</wsdl:types>
<wsdl:message name="buyBookRequest">
<wsdl:part name="buyBookin" element="nns:buyBookin"></wsdl:part>
</wsdl:message>
<wsdl:message name="buyBookResponse">
<wsdl:part name="buyBookout" element="nns:buyBookout"></wsdl:part>
</wsdl:message>
<wsdl:portType name="BookServicePortType">
<wsdl:operation name="buyBook">
<wsdl:input message="nns:buyBookRequest" name="buyBookRequest"></wsdl:input>
<wsdl:output message="nns:buyBookResponse" name="buyBookResponse"></wsdl:output>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="BookServiceBinding" type="nns:BookServicePortType">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
<wsdl:operation name="buyBook">
<soap:operation/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="BookService">
<wsdl:port name="BookServiceHttpPort" binding="nns:BookServiceBinding">
<soap:address location="http://localhost:8080/xfire/services/BookService"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
services.xml
<beans xmlns="http://xfire.codehaus.org/config/1.0">
<service>
<name>BookService</name>
<namespace>http://com.primeton.sample/BookService</namespace>
<serviceClass>com.primeton.samples.base.webservice.call.BookService</serviceClass>
<implementationClass>com.primeton.samples.base.webservice.call.BookServiceImpl</implementationClass>
<style>document</style>
<use>literal</use>
</service>
</beans>
这个不是标准的document literal wrapper服务,可以正确发布,只是在调用的时候就报错!!! 还需要我把简单的java代码帖上来吗,求解答啊,各位大哥!!!!
[最优解释]
<xsd:element name="buyBookin" type="ns2:ArrayOfBook"/>这个参数你传了吗
[其他解释]
传了呀
我传的就是它!!! 其实多谢你了,已经解决了,我用的是普元的eos,不知道为什么它们设计的,参数后面要加一0也许是加一数字吧,我还没研究透,反正没有0就报参数不存在,有0就一切ok,刚刚发现 的 分给你了