2017-12-21 32 views
0

Intellij에서 플러그인을 사용하여 WSDL을 가져오고 끝점 연결에 필요한 많은 클라이언트 파일을 생성했습니다.Java의 SOAP 클라이언트 - WSA 주소 지정

엔드 포인트는 WS-Addressing이 참이어야합니다.

내 현재 코드 :

/** 
* This class was generated by the JAX-WS RI. 
* JAX-WS RI 2.2.9-b130926.1035 
* Generated source version: 2.2 
* 
*/ 
@Addressing(required=true) // ADDED TO TRY TO FIX WS-ADDRESSING 
@WebServiceClient(name = "MYService", targetNamespace = "http://tempuri.org/", wsdlLocation = "http://mybasicvanilla.com/MYService.svc?wsdl") 
public class MYService 
    extends Service 
{ 

    private final static URL MYSERVICE_WSDL_LOCATION; 
    private final static WebServiceException MYSERVICE_EXCEPTION; 
    private final static QName MYSERVICE_QNAME = new QName("http://tempuri.org/", "MYService"); 

    static { 
     URL url = null; 
     WebServiceException e = null; 
     try { 
      url = new URL("http://mybasicvanilla.com/MYService.svc?wsdl"); 
     } catch (MalformedURLException ex) { 
      e = new WebServiceException(ex); 
     } 
     MYSERVICE_WSDL_LOCATION = url; 
     MYSERVICE_EXCEPTION = e; 
    } 



    @WebEndpoint(name = "WSHttpBinding_IMYService") 
    public IMYService getWSHttpBindingIMYService() { 
     return super.getPort(new QName("http://tempuri.org/", "WSHttpBinding_IMYService"), IMYService.class,new javax.xml.ws.soap.AddressingFeature(true,true)); 
    } 

    @WebEndpoint(name = "WSHttpBinding_IMYService") 
    public IMYService getWSHttpBindingIMYService(WebServiceFeature... features) { 
     return super.getPort(new QName("http://tempuri.org/", "WSHttpBinding_IMYService"), IMYService.class, new javax.xml.ws.soap.AddressingFeature(true,true)); 
    } 

    private static URL __getWsdlLocation() { 
     if (MYSERVICE_EXCEPTION!= null) { 
      throw MYSERVICE_EXCEPTION; 
     } 
     return MYSERVICE_WSDL_LOCATION; 
    } 

} 

스택 메시지 내가 연결을 시도 :

@Addressing(required=true) 

을에 :

Dec 22, 2017 9:04:05 AM [com.sun.xml.internal.ws.policy.EffectiveAlternativeSelector] selectAlternatives 
WARNING: WSP0075: Policy assertion "{http://www.w3.org/2006/05/addressing/wsdl}UsingAddressing" was evaluated as "UNKNOWN". 
Dec 22, 2017 9:04:05 AM [com.sun.xml.internal.ws.policy.EffectiveAlternativeSelector] selectAlternatives 
WARNING: WSP0019: Suboptimal policy alternative selected on the client side with fitness "UNKNOWN". 

내 시도를 해결하기 위해 지금까지 추가되었습니다 수업. 또한 시도 :

javax.xml.ws.soap.AddressingFeature(true,true) 

웹 엔드 포인트에서 -하지만 오류가 지속됩니다. SOAPUI는 WS-Addressing이 true로 설정되지 않은 경우에도 실패합니다.

+0

경고입니다. 오류 아님 – ACV

+0

https://stackoverflow.com/questions/25676235/wsp0075-policy-assertion-transportbinding-was-evaluated-as-unknown-why – ACV

+0

https://stackoverflow.com/questions/4427650/how-to- jax-ws-client-by-maybe-by-jax-ws-library의 hide-warning-in-jax-ws-client – ACV

답변

0

초기에는 더 내가 유형을했고, 실제로 예외 내가 올바르게 추가

Exception in thread "Thread-2" javax.xml.ws.soap.SOAPFaultException: MustUnderstand headers:[{http://www.w3.org/2005/08/addressing}Action] are not understood 

을 얻는 것을 나타납니다

new javax.xml.ws.soap.AddressingFeature(true,true) 

그리고 ACV가 지적한대로 다른 메시지는 경고는

.