0

I have used a plugin in Intellij to import a WSDL and generate the many of the client files needed to connect the endpoint.

The end point requires WS-Addressing to be true.

My current code:

/**
 * 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;
    }

}

Stack Message when I try to connect:

 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".

My attempts to fix so far have been to add:

@Addressing(required=true)

On the class. Also tried:

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

On both the web endpoints - but the errors persist. SOAPUI Fails also if WS-Addressing is not set to true.

Ray Bond
  • 427
  • 3
  • 11
  • This is a WARNING. Not an error – ACV Dec 21 '17 at 20:25
  • https://stackoverflow.com/questions/25676235/wsp0075-policy-assertion-transportbinding-was-evaluated-as-unknown-why – ACV Dec 21 '17 at 20:26
  • https://stackoverflow.com/questions/4427650/how-to-hide-warning-in-jax-ws-client-which-maybe-caused-by-jax-ws-library – ACV Dec 21 '17 at 20:26

1 Answers1

0

It appears that initally I had a type and was actually getting a Exception

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

I correctly added:

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

And as ACV pointed out the other messages are warnings.

Ray Bond
  • 427
  • 3
  • 11