2013-03-18 2 views
8

Я получаю это сообщение при попытке создать новый проект SoapUI и импортирую WSDL для моделирования веб-сервисов. Сообщение об ошибке кажется неполным, так как на самом деле не сказано, какой тег не закрывается.Ошибка импорта WSDL в SoapUI

Error loading [file:\C:\chad.wsdl]: org.apache.xmlbeans.XmlException: org.apache.xmlbeans.XmlException: error: does not close tag

Вот WSDL:

<wsdl:definitions name="Chad" targetNamespace="http://www.examples.com/wsdl/Chad.wsdl" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://www.examples.com/wsdl/Chad.wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> 

     <wsdl:message name="SayHiRequest"> 
      <wsdl:part name="text" type="xsd:string"/> 
     </wsdl:message> 
     <wsdl:message name="SayHiResponse"> 
      <wsdl:part name="text" type="xsd:string"/> 
     </wsdl:message> 

     <wsdl:portType name="Hello_PortType"> 
      <wsdl:operation name="sayHi"> 
      <wsdl:input message="tns:SayHiRequest"/> 
      <wsdl:output message="tns:SayHiResponse"/> 
      </wsdl:operation> 
     </wsdl:portType> 

     <wsdl:binding name="Hello_Binding" type="tns:Hello_PortType"> 
      <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/> 
      <wsdl:operation name="sayHi"> 
       <soap:operation soapAction="sayHi"/> 
       <wsdl:input> 
       <soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:examples:chadservice" use="encoded"/> 
       </wsdl:input> 
       <wsdl:output> 
       <soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:examples:chadservice" use="encoded"/> 
       </wsdl:output> 
      </wsdl:operation> 
     </wsdl:binding> 

     <wsdl:service name="Hello_Service"> 
      <wsdl:documentation>WSDL File for HelloService</documentation> 
      <wsdl:port binding="tns:Hello_Binding" name="Hello_Port"> 
      <soap:address location="http://www.examples.com/chad/"/> 
      </wsdl:port> 
     </wsdl:service> 
    </wsdl:definitions> 

Мой WSDL кажется проверить.

Я нашел некоторые аналогичные проблемы в Интернете, где wsdl импортируется из URL-адреса http, а результаты импорта приводят к этой же ошибке, но я импортирую прямо из своего диска C (не через http), поэтому предлагаемые решения имеют не работает.

ответ

2

Был вопрос имен в следующей строке

Оригинальная линия

<wsdl:documentation>WSDL File for HelloService</documentation> 

Изменен

<wsdl:documentation>WSDL File for HelloService</wsdl:documentation> 

Вот обновленный WSDL

<?xml version='1.0' encoding="UTF-8"?> 
<wsdl:definitions name="Chad" targetNamespace="http://www.examples.com/wsdl/Chad.wsdl" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://www.examples.com/wsdl/Chad.wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> 
     <wsdl:message name="SayHiRequest"> 
      <wsdl:part name="text" type="xsd:string"/> 
     </wsdl:message> 
     <wsdl:message name="SayHiResponse"> 
      <wsdl:part name="text" type="xsd:string"/> 
     </wsdl:message> 

     <wsdl:portType name="Hello_PortType"> 
      <wsdl:operation name="sayHi"> 
      <wsdl:input message="tns:SayHiRequest"/> 
      <wsdl:output message="tns:SayHiResponse"/> 
      </wsdl:operation> 
     </wsdl:portType> 

     <wsdl:binding name="Hello_Binding" type="tns:Hello_PortType"> 
      <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/> 
      <wsdl:operation name="sayHi"> 
       <soap:operation soapAction="sayHi"/> 
       <wsdl:input> 
       <soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:examples:chadservice" use="encoded"/> 
       </wsdl:input> 
       <wsdl:output> 
       <soap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:examples:chadservice" use="encoded"/> 
       </wsdl:output> 
      </wsdl:operation> 
     </wsdl:binding> 

     <wsdl:service name="Hello_Service"> 
      <wsdl:documentation>WSDL File for HelloService</wsdl:documentation> 
      <wsdl:port binding="tns:Hello_Binding" name="Hello_Port"> 
      <soap:address location="http://www.examples.com/chad/"/> 
      </wsdl:port> 
     </wsdl:service> 
    </wsdl:definitions> 
+1

Используется онлайн-инструмент проверки [http://www.xmlvalidation.com] (http://www.xmlvalidation.com), который сразу же указал на ту же ошибку. – kabeleced

0

Я смог загрузить WSDL в soapUI 4.5.2 без получения полученной вами ошибки. Хотя, я получил ошибку ниже.

Tue Aug 20 11:30:21 ADT 2013:ERROR:Could not find element [{https://something.com/service/types}IsAvailableRequest] specified in part [parameters] 
0

я имел ту же ошибку, но другую причину:

Instead of: 
https://sitename.com/prefix/app/services.asxm 

Use: 
https://sitename.com/prefix/app/services.asxm?WSDL 

я не использовал SOAP раньше, и это было не сразу видно, что я пропускал WSDL из URL?. Проводка на всякий случай, если кто-то другой имеет такую ​​же проблему.

Смежные вопросы