1
我在我的GWT
服務器端使用AXIS 1.4
來訪問SOAP
。類型{http://www.w3.org/2001/XMLSchema}xml被引用但未定義
這裏是我的代碼:
String result = "";
QName servQN = new QName("XYZService");
Service service = new Service(wsdlLocation, servQN);
Call call = (Call) service.createCall();
call.setOperationName("call");
call.setTargetEndpointAddress(endpointURL);
result += (String) call.invoke(new Object[] { "LOGIN", arr });
那麼,這裏的WSDL文件我已經創建了:
<?xml version ="1.0" encoding ="UTF-8" ?>
<definitions name="XYZ"
targetNamespace="http://xxx.yyyyy.com/xxxserv/soap/main.wdsl"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:tns="http://xxx.yyyyy.com/xxxserv/soap/main.wdsl"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<message name="getRequest">
<part name="action" type="xsd:string"/>
<part name="params" type="xsd:xml"/>
</message>
<message name="getResponse">
<part name="Result" type="xsd:xml"/>
</message>
<portType name="XYZPortType">
<operation name="get">
<input message="tns:getRequest"/>
<output message="tns:getResponse"/>
</operation>
</portType>
<binding name="XYZBinding" type="tns:XYZPortType">
<soap:binding style="rpc"
transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="get">
<soap:operation soapAction="urn:localhost-main#get"/>
<input>
<soap:body use="encoded" namespace="urn:localhost-main"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</input>
<output>
<soap:body use="encoded" namespace="urn:localhost-main"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</output>
</operation>
</binding>
<service name="XYZService">
<port name="XYZPort" binding="tns:XYZBinding">
<soap:address location="http://xxx.yyyyy.com/xxxserv/soap/server.php"/>
</port>
</service>
當我在開發模式運行這個,我有此錯誤:
javax.xml.rpc.ServiceException: Error processing WSDL document:
java.io.IOException: Type {http://www.w3.org/2001/XMLSchema}xml is referenced but not defined.
我在wsdl文件中做了什麼錯誤?請幫忙。