This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Web Services and the fly likes Need help with 403 error accessing webservice. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Need help with 403 error accessing webservice." Watch "Need help with 403 error accessing webservice." New topic
Author

Need help with 403 error accessing webservice.

alex jamison
Greenhorn

Joined: Jun 10, 2009
Posts: 7
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

Joined: Jun 10, 2009
Posts: 7
any takers?
alex jamison
Greenhorn

Joined: Jun 10, 2009
Posts: 7
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
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Need help with 403 error accessing webservice.