2017-10-10 11 views
0

다음 튜토리얼을 사용하여 wsdl에서 src를 생성하려고하지만 wsimport가 실행되는 동안 예외가 발생합니다. ?WSDL을 파싱하지 못했습니다.

C:\Program Files\Java\jdk1.8.0_102\bin>wsimport -keep -verbose http://localhost:7001/poc-war/ServerInfoService?wsdl 
parsing WSDL... 


[ERROR] Server returned HTTP response code: 504 for URL: http://localhost:7001/poc-war/ServerInfoService?wsdl 

Failed to read the WSDL document: http://localhost:7001/poc-war/ServerInfoService?wsdl, because 1) could not find the document; /2) the document could not be read; 3) the root element of the document is not <wsdl:definitions>. 


[ERROR] Could not find wsdl:service in the provided WSDL(s): 

At least one WSDL with at least one service definition needs to be provided. 


     Failed to parse the WSDL. 

ServerInfoService WSDL

<?xml version='1.0' encoding='UTF-8'?><wsdl:definitions xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://ws.mkyong.com/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:ns1="http://schemas.xmlsoap.org/soap/http" name="ServerInfoService" targetNamespace="http://ws.mkyong.com/"> 
    <wsdl:types> 
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns0="http://ws.mkyong.com/" targetNamespace="http://ws.mkyong.com/"> 
    <xsd:complexType name="getIpAddressResponse"> 
    <xsd:sequence> 
     <xsd:element minOccurs="0" name="return" type="xsd:string"/> 
    </xsd:sequence> 
    </xsd:complexType> 
    <xsd:complexType name="getIpAddress"/> 
    <xsd:element name="getIpAddressResponse" type="ns0:getIpAddressResponse"/> 
    <xsd:element name="getIpAddress" type="ns0:getIpAddress"/> 
</xsd:schema> 
    </wsdl:types> 
    <wsdl:message name="getIpAddress"> 
     <wsdl:part element="tns:getIpAddress" name="parameters"/> 
    </wsdl:message> 
    <wsdl:message name="getIpAddressResponse"> 
     <wsdl:part element="tns:getIpAddressResponse" name="parameters"/> 
    </wsdl:message> 
    <wsdl:portType name="ServerInfo"> 
     <wsdl:operation name="getIpAddress"> 
      <wsdl:input message="tns:getIpAddress" name="getIpAddress"/> 
      <wsdl:output message="tns:getIpAddressResponse" name="getIpAddressResponse"/> 
     </wsdl:operation> 
    </wsdl:portType> 
    <wsdl:binding name="ServerInfoServiceSoapBinding" type="tns:ServerInfo"> 
     <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/> 
     <wsdl:operation name="getIpAddress"> 
      <soap:operation soapAction="" style="document"/> 
      <wsdl:input name="getIpAddress"> 
       <soap:body use="literal"/> 
      </wsdl:input> 
      <wsdl:output name="getIpAddressResponse"> 
       <soap:body use="literal"/> 
      </wsdl:output> 
     </wsdl:operation> 
    </wsdl:binding> 
    <wsdl:service name="ServerInfoService"> 
     <wsdl:port binding="tns:ServerInfoServiceSoapBinding" name="ARMServicePortTypeImplPort"> 
      <soap:address location="http://10.19.9.92:7001/poc-war/ServerInfoService"/> 
     </wsdl:port> 
    </wsdl:service> 
</wsdl:definitions> 
: 오류 다음 http://localhost:7001/poc-war/ServerInfoService?wsdl

얻기를 -verbose -keep

http://www.mkyong.com/webservices/jax-ws/jax-ws-wsgen-tool-example/

wsimport의

+0

먼저 브라우저에서 wsdl에 액세스 할 수 있습니까? 시간 초과로 인해 URL을 호출하는 것처럼 실패한 것 같습니다. 로컬 호스트를 우회하지 않는 환경에 프록시가 설정되어있을 수 있습니까? – Optional

+0

예 브라우저에서 액세스 할 수 있습니다. URL : http : // localhost : 7001/poc-war/ServerInfoService? wsdl – ravi

+0

또한 wget이나 그런 것을 사용하는 promopt 명령에서? 내가 말하는 이유는 504가 명백한 통로 오류이기 때문입니다. 외부에서 스키마를 가져올 수 있습니까? – Optional

답변

0

이것은 네트워킹 문제입니다. 브라우저에서 wsdl을 열어 텍스트를 복사하여 새로운 .wsdl 파일에 붙여 넣은 다음 하드 드라이브 URL과 네트워크 URL에서 다시 생성 할 수 있습니다.

네트워크 보안으로 인해 일부 개발 도구를 사용하여 WSDL에 접근 할 수 없게되어 복사본을 로컬로 유지할 수있는 경우가있었습니다. 나는 그것이 최선책이지만 502는 많은 정보가 없으면 문제를 해결하기 쉽지 않다고 인정합니다.