【问题标题】:Type {http://www.w3.org/2001/XMLSchema}xml is referenced but not defined类型 {http://www.w3.org/2001/XMLSchema}xml 被引用但未定义
【发布时间】:2011-12-01 07:59:23
【问题描述】:

我在我的GWT 服务器端使用AXIS 1.4 来访问SOAP

这是我的代码:

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 文件中做错了什么?请帮忙。

【问题讨论】:

    标签: gwt soap wsdl axis


    【解决方案1】:

    您的 WSDL 定义了两个消息部分,它们引用了一个名为 xsd:xml 的类型。但是,这种类型并不存在。请注意,您可以在此处查阅 XML 模式规范定义的类型列表:

    http://www.w3.org/TR/xmlschema-2/#built-in-primitive-datatypes

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-01-20
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-05-30
      • 2015-06-16
      • 2013-06-10
      • 1970-01-01
      相关资源
      最近更新 更多