我的 WSDL 有什么问题?
花了一整天尝试使用 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
一旦我将以下内容添加到操作定义中,就开始工作:
Started to work once I added the following to the operation definition:
可能是因为您有“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.