类型 {http://www.w3.org/2001/XMLSchema}xml 被引用但未定义

发布于 2024-12-19 02:55:03 字数 2376 浏览 1 评论 0原文

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

i'm using AXIS 1.4 in my GWT server-side to access SOAP.

here's my code:

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 } );

then, here's the wsdl file i've created:

<?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>

when i run this on the development mode, i've got this error:

javax.xml.rpc.ServiceException: Error processing WSDL document:  
java.io.IOException: Type {http://www.w3.org/2001/XMLSchema}xml is referenced but not defined.

what have i done wrong in my wsdl file? please help.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

乞讨 2024-12-26 02:55:03

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

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

Your WSDL defines two message parts that refer to a type called xsd:xml. However, such a type doesn't exist. Note that you can consult the list of types defined by the XML schema spec here:

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文