Что не так с моим WSDL? - PullRequest
       87

Что не так с моим WSDL?

1 голос
/ 08 апреля 2011

Потратил весь день, пытаясь сгенерировать привязку xmlbeans с помощью wsdl2java (Axis2 1.5.4).Вот моя командная строка:

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-привязка ... если она не поддерживается, было бы неплохо получить сообщение об ошибке.

UPDATE0 Я должен добавить, что wsdl2java завершается, и я получаю несколько классов Java.AtlasServiceStub есть, но когда я пытаюсь его использовать, метод входа в систему отсутствует.

Ответы [ 2 ]

1 голос
/ 05 мая 2011

Начал работать, как только я добавил следующее в определение операции:

whttp:inputSerialization="application/x-www-form-urlencoded" 
0 голосов
/ 03 мая 2011

Возможно, это потому, что у вас есть префикс "wsdl2", а конвертер wsdl2java неправильно его понимает?Кстати, Eclipse WSDL Editor показывает пустую панель, когда я пытаюсь открыть ваш файл.

...