//IRegistry registry = new RegistryProxy();
// Option #2 (import proxy property values from a specified properties file)
Properties props = new Properties();
props.load(new FileInputStream(args[0]));
IRegistry registry = new RegistryProxy(props);
// Option #3 (explicitly set the proxy property values)
//Properties props = new Properties();
//props.setProperty(RegistryProxy.ADMIN_ENDPOINT_PROPERTY_NAME,"http://localhost:8080/juddi/admin");
//props.setProperty(RegistryProxy.INQUIRY_ENDPOINT_PROPERTY_NAME,"http://localhost:8080/juddi/inquiry");
//props.setProperty(RegistryProxy.PUBLISH_ENDPOINT_PROPERTY_NAME,"http://localhost:8080/juddi/publish");
//props.setProperty(RegistryProxy.TRANSPORT_CLASS_PROPERTY_NAME,"org.apache.juddi.proxy.AxisTransport");
//props.setProperty(RegistryProxy.SECURITY_PROVIDER_PROPERTY_NAME,"com.sun.net.ssl.internal.ssl.Provider");
//props.setProperty(RegistryProxy.PROTOCOL_HANDLER_PROPERTY_NAME,"com.sun.net.ssl.internal.www.protocol");
//IRegistry registry = new RegistryProxy(props);
// Option #4 (Microsoft Test Site)
//Properties props = new Properties();
//props.setProperty(RegistryProxy.INQUIRY_ENDPOINT_PROPERTY_NAME,"http://test.uddi.microsoft.com/inquire");
//props.setProperty(RegistryProxy.PUBLISH_ENDPOINT_PROPERTY_NAME,"https://test.uddi.microsoft.com/publish");
//props.setProperty(RegistryProxy.TRANSPORT_CLASS_PROPERTY_NAME,"org.apache.juddi.proxy.AxisTransport");
//props.setProperty(RegistryProxy.SECURITY_PROVIDER_PROPERTY_NAME,"com.sun.net.ssl.internal.ssl.Provider");
//props.setProperty(RegistryProxy.PROTOCOL_HANDLER_PROPERTY_NAME,"com.sun.net.ssl.internal.www.protocol");
//props.setProperty(RegistryProxy.HTTP_PROXY_HOST_PROPERTY_NAME,"na6v13a01.fmr.com");
//props.setProperty(RegistryProxy.HTTP_PROXY_PORT_PROPERTY_NAME,"8000");
//IRegistry registry = new RegistryProxy(props);
String userID = "sviens";
String password = "password";
try
{
System.out.println("discard_authToken Sample");
System.out.println("------------------------");
System.out.println("userID: "+userID);
System.out.println("password: "+password);
System.out.println("");
AuthToken authToken = registry.getAuthToken(userID,password);
AuthInfo authInfo = authToken.getAuthInfo();
System.out.println("AuthToken: "+authInfo.getValue());
DispositionReport dispReport = registry.discardAuthToken(authInfo);
Vector resultVector = dispReport.getResultVector();
if (resultVector != null)
{
System.out.println("Discard: "+authInfo.getValue());
Result result = (Result)resultVector.elementAt(0);
ErrInfo errInfo = result.getErrInfo();
int errNo = result.getErrno();
System.out.println("Errno: "+errNo);
}
System.out.println("Discard: "+authInfo.getValue());
registry.discardAuthToken(authInfo);
// the line above should throw a RegistryException
}
catch (RegistryException regex)
{
DispositionReport dispReport = regex.getDispositionReport();