SOAPFaultException: "None of the policy options can be satisfied" when starting the webservice client (ApacheCXF)

I use the webservice client through this third-party wsdl, I wanted to make sure that I can send the SOAP request directly, so I generated the request using soapUI, sent 2 parameters:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:alm="http://www.xxxxx.com/services/2011/10/Thirdparty" xmlns:ns="http://www.xxxxx.com/AlmedaDataDistribution/2011/10">
    <soapenv:Header>
        <wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
            <wsse:UsernameToken>
                <wsse:Username>dummyUsername</wsse:Username>
                <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">dummyPassword</wsse:Password> 
            </wsse:UsernameToken>
        </wsse:Security>
    </soapenv:Header>
    <soapenv:Body>
        <alm:method>
            <ns:param1>dummyParam1</ns:param1>
            <ns:param1>dummyParam2</ns:param2>
        </alm:method>
    </soapenv:Body>
</soapenv:Envelope>

got an answer like the following, it seems ok:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
    <soapenv:Body>
        <methodResponse xmlns="http://www.xxxxx.com/services/2011/10/Thirdparty">
            <theResponse xmlns="http://www.xxxxx.com/Thirdparty/2011/10">
                 <asdf>abc-1</asdf>
                 <qwer>123-1</qwer>
            </theResponse>
            <theResponse xmlns="http://www.xxxxx.com/Thirdparty/2011/10">
                 <asdf>abc-2</asdf>
                 <qwer>123-2</qwer>
            </theResponse>
        </methodResponse>
    </soapenv:Body>
</soapenv:Envelope>

Then I start generating the webservice client from WSDL (link like this: https://www.xxxxx.com/ThirdpartyService?wsdl ) Since eclipse does not support generating from HTTPS directly, so I downloaded .wsdl and dependent .xsd files and generated the client locally . After the generation, I modified the client, added the username and password using the apache-cxf API

ThirdpartyService ss = new ThirdpartyService();
ThirdpartyServicePortType port = ss.getThirdpartyServiceSOAP11PortHttps(); 

Client client = ClientProxy.getClient(port);
org.apache.cxf.endpoint.Endpoint cxfEndpoint = client.getEndpoint();

Map<String,Object> outProps = new HashMap<String,Object>();
outProps.put(WSHandlerConstants.ACTION, WSHandlerConstants.USERNAME_TOKEN);
outProps.put(WSHandlerConstants.USER, "dummyusername");
outProps.put(WSHandlerConstants.PASSWORD_TYPE, WSConstants.PASSWORD_TEXT);
outProps.put(WSHandlerConstants.PW_CALLBACK_CLASS, ClientPasswordCallback.class.getName());

WSS4JOutInterceptor wssOut = new WSS4JOutInterceptor(outProps);
cxfEndpoint.getOutInterceptors().add(wssOut);

ss.method(param1,param2);

, , ( WS-Security):

org.apache.cxf.ws.policy.AssertionBuilderRegistryImpl handleNoRegisteredBuilder
WARNING: No assertion builder for type {http://www.xxxxx.com/module/throttle}ServiceThrottleAssertion registered.
Exception in thread "main" javax.xml.ws.soap.SOAPFaultException: None of the policy alternatives can be satisfied.

, dev-env:

WinXP SP3
Java 1.6.0_027
Apache-CXF 2.6.0
Tomcat 6.0.35
eclipse Indigo SR1
Dynamic Web Module 2.5

.

+3
1

, , 1.4, , , . , - ().

+1

All Articles