Hi,
I am able to read a WSDL with Basic Authentication, but not Digest.
The code is the same except for the authorizationType.
I create a Bus and setup a ConduitConfigurer which sets the AuthorizationPolicy.
When his didn't work, I added an authSupplier to the conduit so I could set a
breakpoint, I can see the authSupplier returning a token which I get from CXFs
DigestAuthSupplier. I can successfully use the same AuthorizationPolicy and
authSupplier when invoking an operation on the service, but not when the WSDL
needs digest authentication. I can see the WSDL in a browser with Digest, but
not with my code.
Bus bus = CXFBusFactory.newInstance ().createBus ()
ConduitConfigurer conduitConfig = new ConduitConfigurer(connection)
bus.setExtension(conduitConfig, HTTPConduitConfigurer.class)
JaxWsDynamicClientFactory factory = JaxWsDynamicClientFactory.newInstance
(bus)
Client client = factory.createClient (url)
ConduitConfigurer--------
public class ConduitConfigurer implements HTTPConduitConfigurer
{
private Map connection;
public ConduitConfigurer (Map connection)
{
this.connection = connection;
}
/* (non-Javadoc)
* @see
org.apache.cxf.transport.http.HTTPConduitConfigurer#configure(java.lang.String,
java.lang.String, org.apache.cxf.transport.http.HTTPConduit)
*/
@Override
public void configure(String name, String address, HTTPConduit conduit)
{
AuthorizationPolicy authorizationPolicy = new AuthorizationPolicy();
authorizationPolicy.setUserName(connection.user)
authorizationPolicy.setPassword(connection.password)
authorizationPolicy.setAuthorizationType(connection.authMethod)
conduit.setAuthorization(authorizationPolicy);
conduit.setAuthSupplier (new BasicDigestAuthSupplier
(connection.authMethod, false, null, 0, null))
}
Thanks,
Roger
This email (including any attachments) may contain information which is
privileged, confidential, or protected. If you are not the intended recipient,
note that any disclosure, copying, distribution, or use of the contents of this
message and attached files is prohibited. If you have received this email in
error, please notify the sender and delete this email and any attached files.