2013-12-11 1 views
0

내 wsdl에 SOAP11, SOAP12 및 HTTP 바인딩이 포함되어 있습니다. HTTPBinding에서 주소 위치를 검색하려고하면 샘플 코드 블록에서 오류가 발생합니다.wsdl4J는 HTTP 바인딩을 해결할 수 있습니까?

"지원되지 않는 wsdl 오류!"

(나는 WSDL을 읽어 wsdl4j 사용)

다음 AddressLocation를 검색 내 샘플 코드이고;

private String getAddressUrl(ExtensibilityElement exElement) throws APIManagementException { 

     if (exElement instanceof SOAP12AddressImpl) { 
      return ((SOAP12AddressImpl) exElement).getLocationURI(); 
     } else if (exElement instanceof SOAPAddressImpl) { 
      return ((SOAPAddressImpl) exElement).getLocationURI(); 
     } else { 
      String msg = "Unsupported WSDL errors!"; 
      log.error(msg); 
      throw new APIManagementException(msg); 
     } 
    } 

여기 난 단지 "SOAP12AddressImpl"와 "SOAPAddressImpl"를 참조 WSDL4J에서 사용할 수 있습니다. 그래서, 위의 코드를 HTTPbinding 데이터를 전달할 때 오류가 throw됩니다. 내 샘플 HTTP 바인딩 확장 요소는 다음과 같습니다.

HTTPAddress ({http://schemas.xmlsoap.org/wsdl/http/}address): 
required=null 
locationURI=http://10.100.1.35:9000/services/SimpleStockQuoteService.SimpleStockQuoteServiceHttpEndpoint. 

어떻게하면 HTTP 바인딩에서 주소 위치를 읽을 수 있습니까? 구현이 wsdl4j에서 사용 가능합니까?

답변

0

죄송합니다. wsdl4j에서도 HTTP 주소 구현이 가능합니다. 내 코드를 다음과 같이 수정했습니다.

if (exElement instanceof SOAP12AddressImpl) { 
      return ((SOAP12AddressImpl) exElement).getLocationURI(); 
     } else if (exElement instanceof SOAPAddressImpl) { 
      return ((SOAPAddressImpl) exElement).getLocationURI(); 
     } else if (exElement instanceof HTTPAddressImpl) { 
      return ((HTTPAddressImpl) exElement).getLocationURI(); 
     } else { 
      String msg = "Unsupported WSDL errors!"; 
      log.error(msg); 
      throw new APIManagementException(msg); 
     }