Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Need help with 403 error accessing webservice.

 
alex jamison
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok, I have a wsdl2java generated package and I am trying to run it. I call the methods like:

URL endpoint = new java.net.URL("https://foobar/ingest");
service = new org.apache.axis.client.Service();
IngestSoapBindingStub ingest = new ingestSoapBindingStub(endpoint,service);
ingest.ingest(header);

ingest(Header header) {
org.apache.axis.client.Call _call = createCall();
_call.setOperation(_operations[0]);
_call.setUseSOAPAction(true);
_call.setSOAPActionURI("ingest");
_call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
_call.setOperationName(new javax.xml.namespace.QName("http://ingest.fooservice.foo.bar.com", "ingest"));
setRequestHeaders(_call);
setAttachments(_call);
java.lang.Object _resp = _call.invoke(new java.lang.Object[] {header}); //this call is causing error

the last call is where it seems to cause the error from my logs.

the error displayed is:
faultCode: {http://xml.apache.org/axis/}HTTP
faultSubcode:
faultString: (403)Forbidden
faultActor:
faultNode:
faultDetail:
{}:return code: 403
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<HTML><HEAD><TITLE>The page requires a client certificate</TITLE>
<META HTTP-EQUIV="Content-Type" Content="text/html; charset=Windows-1252">
<STYLE type="text/css">


The page requires a client certificate
The page you are attempting to access requires your browser to have a Secure Sockets Layer (SSL) client certificate that the Web server will recognize. The client certificate is used for identifying you as a valid user of the resource.
etc...

Basically looks like the error one would get from firefox when accessing a link without cert. I have the personal cert and loaded them into my IE/FF and they work fine. I used keytool to import it into my jdk directory as well. I am not sure how to get pass this step... the java code generated "seems" to work as it is trying to access the https site thus giving me the error... any help please? should i put the cert in code or send it during the calls? thanks

 
alex jamison
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
any takers?
 
alex jamison
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok, i got the certs in and setup and i dont get those errors anymore but i got new one:
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
faultSubcode:
faultString: java.net.SocketException: java.security.NoSuchAlgorithmException: Error constructing implementation
{http://xml.apache.org/axis/}stackTrace:java.net.SocketException: java.security.NoSuchAlgorithmException: Error constructing implementation (algorithm: Default, provider: SunJSSE, class: com.sun.net.ssl.internal.ssl.DefaultSSLContextImpl)

Caused by: java.security.NoSuchAlgorithmException: Error constructing implementation (algorithm: Default, provider: SunJSSE, class: com.sun.net.ssl.internal.ssl.DefaultSSLContextImpl)

Caused by: java.security.UnrecoverableKeyException: Cannot recover key
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic