I updated the namespace in the wsdl file but I still get errors.
With the code :
Map ctx = ((BindingProvider)port).getRequestContext();
ctx.put("ws-security.username", "login");
ctx.put("ws-security.password", "password");
I get :
Exception in thread "main" javax.xml.ws.soap.SOAPFaultException: Only
executed ISearchQueryExecution can be checked.
at
org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:160)
at com.sun.proxy.$Proxy43.doQuery(Unknown Source)
at
eu.europa.eurlex.search.EURLexWebServiceProvider_EURLexWebServicePort_Client.main(EURLexWebServiceProvider_EURLexWebServicePort_Client.java:69)
Caused by: org.apache.cxf.binding.soap.SoapFault: Only executed
ISearchQueryExecution can be checked.
at
org.apache.cxf.binding.soap.interceptor.Soap12FaultInInterceptor.unmarshalFault(Soap12FaultInInterceptor.java:155)
I also tried :
Map<String, Object> props = new HashMap<String, Object>();
props.put(WSHandlerConstants.ACTION, WSHandlerConstants.USERNAME_TOKEN);
props.put(WSHandlerConstants.PASSWORD_TYPE, WSConstants.PW_TEXT);
props.put(WSHandlerConstants.USER, "login");
props.put(WSHandlerConstants.PW_CALLBACK_CLASS,
ClientPasswordCallback.class.getName());
WSS4JOutInterceptor wssOut = new WSS4JOutInterceptor(props);
Client client = ClientProxy.getClient(port);
client.getOutInterceptors().add(wssOut);
and this time I get:
AVERTISSEMENT: Interceptor for
{http://eur-lex.europa.eu/search}EURLexWebService#{http://eur-lex.europa.eu/search}doQuery
has thrown exception, unwinding now
org.apache.cxf.ws.policy.PolicyException: No username available
at
org.apache.cxf.ws.security.wss4j.AbstractTokenInterceptor.policyNotAsserted(AbstractTokenInterceptor.java:277)
I was wondering : is there also something related to the namespace to
change on the service side of the web service to make my client work?
Thanks for your help :)
Regards.
ps: sorry for the possible double post btw the mailing list and nabble.
It seems that my reply on nabble wasn't send to the mailing list...