Hello!
I use axis for a secure web service but I keep getting 403 when i try to access it.
My Client looks like below. And when i run with user/pass like tomcat/tomcat I just get 403 all the time.
If I try other user/pass I get 401.
I guess I need to config
Tomcat for the axis app in some way.
If I try to access it with a browser i get a login-poup and the result is the same, 403, 401.
My Client:
import java.net.*;
import org.apache.axis.client.*;
import javax.xml.namespace.*;
import javax.net.ssl.*;
import java.security.*;
import localhost.axis.SSLSoapWsdlServer_jws.*;
import org.apache.ws.axis.security.*;
import org.apache.axis.*;
import org.apache.axis.configuration.*;
public class SSLSoapWsdlClient
{
public SSLSoapWsdlClient()
{
try
{
System.setProperty("javax.net.ssl.keyStore", "client.ks");
System.setProperty("javax.net.ssl.keyStorePassword", "changeit");
System.setProperty("javax.net.ssl.keyStoreType", "JKS");
System.setProperty("javax.net.ssl.trustStore", "client.ts");
System.setProperty("javax.net.ssl.trustStorePassword", "changeit");
System.setProperty( "java.protocol.handler.pkgs", "com.sun.net.ssl.internal.www.protocol" );
Security.addProvider( new com.sun.net.ssl.internal.ssl.Provider() );
SSLSoapWsdlServerServiceLocator sslSoapWsdlServerServiceLocator = new SSLSoapWsdlServerServiceLocator();
SSLSoapWsdlServerSoapBindingStub sslSoapWsdlServerSoapBindingStub = (SSLSoapWsdlServerSoapBindingStub) sslSoapWsdlServerServiceLocator.getSSLSoapWsdlServer(new URL("https://localhost:8443/axis/services/SSLSoapWsdlServer"));
sslSoapWsdlServerSoapBindingStub.setUsername("tomcat");
sslSoapWsdlServerSoapBindingStub.setPassword("tomcat");
String returned = (String)sslSoapWsdlServerSoapBindingStub.getPrime("2isAnOddPrime");
System.out.println( "Soap returned: " + returned );
}
catch (Exception e)
{
e.printStackTrace();
}
}
public static void main(String[] args)
{
SSLSoapWsdlClient sslSoapWsdlClient = new SSLSoapWsdlClient();
}
}