我的 WSDL 有什么问题?

发布于 2024-10-30 23:38:07 字数 2795 浏览 2 评论 0原文

花了一整天尝试使用 wsdl2java (Axis2 1.5.4) 生成 xmlbeans 绑定 完全困惑。这是我的命令行:

wsdl2java.bat -uri http://localhost:3000/api/wsdl -d xmlbeans -a -or -o build/client

这是 WSDL:

<?xml version="1.0" encoding="UTF-8"?>
<wsdl2:description xmlns:wsdlx="http://www.w3.org/ns/wsdl-extensions" xmlns:whttp="http://www.w3.org/ns/wsdl/http" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:wsdl2="http://www.w3.org/ns/wsdl" xmlns:tns="http://localhost:3000/api/wsdl" targetNamespace="http://localhost:3000/api/wsdl">
  <wsdl2:documentation>
  </wsdl2:documentation>
  <wsdl2:types>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="unqualified" targetNamespace="http://localhost:3000/api/wsdl">
      <xs:element type="tns:loginType" name="login">
    <xs:annotation>
      <xs:documentation>
      </xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element type="tns:idType" name="id">
    <xs:annotation>
      <xs:documentation>
      </xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="loginType">
    <xs:sequence>
      <xs:element type="xs:string" minOccurs="1" maxOccurs="1" name="email"/>
      <xs:element type="xs:string" minOccurs="1" maxOccurs="1" name="password"/>
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="idType">
    <xs:attribute type="xs:int" name="id"/>
  </xs:complexType>
</xs:schema>
  </wsdl2:types>
  <wsdl2:interface name="AtlasServiceInterface">
    <wsdl2:operation style="http://www.w3.org/ns/wsdl/style/iri" name="login" pattern="http://www.w3.org/ns/wsdl/in-out">
      <wsdl2:documentation>
      </wsdl2:documentation>
      <wsdl2:input messageLabel="In" element="tns:login"/>
      <wsdl2:output messageLabel="Out" element="tns:id"/>
    </wsdl2:operation>
  </wsdl2:interface>
  <wsdl2:binding type="https://www.w3.org/ns/wsdl/http" interface="tns:AtlasServiceInterface" name="AtlasServiceHTTPBinding">
    <wsdl2:documentation>
    </wsdl2:documentation>
    <wsdl2:operation ref="tns:login" whttp:method="POST" whttp:location="login"/>
  </wsdl2:binding>
  <wsdl2:service interface="tns:AtlasServiceInterface" name="AtlasService">
    <wsdl2:endpoint binding="tns:AtlasServiceHTTPBinding" name="AtlasServiceHTTPEndpoint" address="http://localhost:3000/api/"/>
  </wsdl2:service>
</wsdl2:description>

我知道这是一个 HTTP 绑定...如果不支持,错误消息会很好。

更新0 我应该补充一点,wsdl2java 已完成,并且我得到了一些 java 类。 AtlasServiceStub是有的,但是当我尝试使用它时,我的登录操作没有方法。

Spent all day trying to generate an xmlbeans binding using wsdl2java (Axis2 1.5.4) Completely befuddled. Here's my command line:

wsdl2java.bat -uri http://localhost:3000/api/wsdl -d xmlbeans -a -or -o build/client

Here's the WSDL:

<?xml version="1.0" encoding="UTF-8"?>
<wsdl2:description xmlns:wsdlx="http://www.w3.org/ns/wsdl-extensions" xmlns:whttp="http://www.w3.org/ns/wsdl/http" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:wsdl2="http://www.w3.org/ns/wsdl" xmlns:tns="http://localhost:3000/api/wsdl" targetNamespace="http://localhost:3000/api/wsdl">
  <wsdl2:documentation>
  </wsdl2:documentation>
  <wsdl2:types>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="unqualified" targetNamespace="http://localhost:3000/api/wsdl">
      <xs:element type="tns:loginType" name="login">
    <xs:annotation>
      <xs:documentation>
      </xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:element type="tns:idType" name="id">
    <xs:annotation>
      <xs:documentation>
      </xs:documentation>
    </xs:annotation>
  </xs:element>
  <xs:complexType name="loginType">
    <xs:sequence>
      <xs:element type="xs:string" minOccurs="1" maxOccurs="1" name="email"/>
      <xs:element type="xs:string" minOccurs="1" maxOccurs="1" name="password"/>
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="idType">
    <xs:attribute type="xs:int" name="id"/>
  </xs:complexType>
</xs:schema>
  </wsdl2:types>
  <wsdl2:interface name="AtlasServiceInterface">
    <wsdl2:operation style="http://www.w3.org/ns/wsdl/style/iri" name="login" pattern="http://www.w3.org/ns/wsdl/in-out">
      <wsdl2:documentation>
      </wsdl2:documentation>
      <wsdl2:input messageLabel="In" element="tns:login"/>
      <wsdl2:output messageLabel="Out" element="tns:id"/>
    </wsdl2:operation>
  </wsdl2:interface>
  <wsdl2:binding type="https://www.w3.org/ns/wsdl/http" interface="tns:AtlasServiceInterface" name="AtlasServiceHTTPBinding">
    <wsdl2:documentation>
    </wsdl2:documentation>
    <wsdl2:operation ref="tns:login" whttp:method="POST" whttp:location="login"/>
  </wsdl2:binding>
  <wsdl2:service interface="tns:AtlasServiceInterface" name="AtlasService">
    <wsdl2:endpoint binding="tns:AtlasServiceHTTPBinding" name="AtlasServiceHTTPEndpoint" address="http://localhost:3000/api/"/>
  </wsdl2:service>
</wsdl2:description>

I know this is a HTTP binding... if it's not supported, an error message would be nice.

UPDATE0
I should add that wsdl2java completes, and I get some java classes. AtlasServiceStub is there, but when I try to use it, there is no method for my login operation.

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

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

发布评论

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

评论(2

独享拥抱 2024-11-06 23:38:07

一旦我将以下内容添加到操作定义中,就开始工作:

whttp:inputSerialization="application/x-www-form-urlencoded" 

Started to work once I added the following to the operation definition:

whttp:inputSerialization="application/x-www-form-urlencoded" 
叹倦 2024-11-06 23:38:07

可能是因为您有“wsdl2”前缀并且 wsdl2java 转换器无法正确理解它?顺便说一句,当我尝试打开您的文件时,Eclipse WSDL 编辑器显示空窗格。

Probably it's because you have "wsdl2" prefix and the wsdl2java converter doesn't understand it correctly? BTW The Eclipse WSDL Editor shows empty pane when I try to open your file.

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