axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Johnson, Michael1 [IT]" <michael1.john...@citigroup.com>
Subject RE: web service client over ssl
Date Thu, 29 Aug 2002 12:57:04 GMT
All,
	Thanks for your help with this. Somehow my keystore became corrupt
and that caused the errors that I was getting. Thanks for all your help, and
the great references.

-MJ

-----Original Message-----
From: Ballard, Margaret [mailto:Margaret.Ballard@planethome.com]
Sent: Thursday, August 29, 2002 8:24 AM
To: axis-user@xml.apache.org
Subject: AW: web service client over ssl


Hi Michael,

There was a link to an article about JSSE Security posted here within
the last month.  It was quite helpful.  I don't have the link anymore
(and apologies for loss of credit to the poster/author), but I do have a
copy, which is attached to this email.  It was quite helpful to me.

It looks like java can't find your security jars.  This article tells
you where to put them and (very helpful) how to test whether or not it's
set up correctly.

Good luck,

Margaret Ballard



-----Urspr√ľngliche Nachricht-----
Von: Johnson, Michael1 [IT] [mailto:michael1.johnson@citigroup.com]
Gesendet: Donnerstag, 29. August 2002 14:09
An: 'axis-user@xml.apache.org'
Betreff: web service client over ssl


Hi all ive been having problems getting this client to work over ssl. I
keep
getting an error java.net.SocketException: SSL implementation not
available.
Here is the source for my client. My c:\jdk1.3\bin\client.keystore
exists
but is null. I was exception this to return untrusted certificate.
Thanks in
advance for any help.

-MJ



import org.apache.axis.client.Call;
import org.apache.axis.client.Service;

import java.rmi.RemoteException;
import java.net.MalformedURLException;
//import javax.xml.rpc.namespace.QName;
import javax.xml.rpc.ServiceException;

import javax.xml.namespace.QName;
import javax.net.ssl.SSLSocketFactory;
import java.security.Security;
import javax.security.*;
import java.net.*;

public class TestClient {
	public static void main(String [] args) {
       try {

           // specify the location of where to find key material for the
default TrustManager (this overrides jssecacerts and cacerts)
 
System.setProperty("javax.net.ssl.trustStore","C:\\jdk1.3\\bin\\client.k
eyst
ore");
           // use Sun's reference implementation of a URL handler for
the
"https" URL protocol type. 
 
System.setProperty("java.protocol.handler.pkgs","com.sun.net.ssl.interna
l.ww
w.protocol");       
      	   // dynamically register sun's ssl provider
           Security.addProvider(new
com.sun.net.ssl.internal.ssl.Provider());      	
           
        

           
           String endpoint =
"https://127.0.0.1/service-bin/testapp/servlets/AxisServlet/";
		   String outstr = "Test output";
		   Service  service = new Service();
           Call     call    = (Call) service.createCall();
		   call.setUsername("CCGdemo1");
		   call.setPassword("Parsley");
           call.setTargetEndpointAddress( new java.net.URL(endpoint) );
           call.setMaintainSession (true);
           call.setOperationName(new QName("BAWSRequest",
"generalInquiry"));
           

           QName p0QName = new javax.xml.namespace.QName("", "in0");
           call.addParameter(p0QName, new
QName("http://schemas.xmlsoap.org/soap/encoding/", "string"),
java.lang.String.class, javax.xml.rpc.ParameterMode.IN);
           
           call.setReturnType(org.apache.axis.Constants.XSD_STRING);

           String ret = (String) call.invoke( new Object[] { outstr } );

           System.out.println(".... back from server\n" + ret);
       } catch (Exception e) {
       		e.printStackTrace();
           System.err.println(e.toString());
       } 
   }
}

Mime
View raw message