//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
{
// create & execute the GetAuthToken1 request
GetAuthToken authTokenRequest1 = new GetAuthToken(userID,password);
AuthToken authToken1 = (AuthToken)registry.execute(authTokenRequest1);
AuthInfo authInfo1 = authToken1.getAuthInfo();
// create a couple of business entities
BusinessEntity business1 = new BusinessEntity();
business1.addName(new Name("Blockbuster","en"));
// BusinessEntity Vector
Vector businessVector1 = new Vector(1);
businessVector1.addElement(business1);
// create & execute the SaveBusiness request
SaveBusiness sbReq1 = new SaveBusiness();
sbReq1.setAuthInfo(authInfo1);
sbReq1.setBusinessEntityVector(businessVector1);
BusinessDetail detail1 = (BusinessDetail)registry.execute(sbReq1);
Vector detailVector1 = detail1.getBusinessEntityVector();
BusinessEntity b1 = (BusinessEntity)detailVector1.elementAt(0);
// create & execute the GetAuthToken2 request
GetAuthToken authTokenRequest2 = new GetAuthToken(userID,password);
AuthToken authToken2 = (AuthToken)registry.execute(authTokenRequest2);
AuthInfo authInfo2 = authToken2.getAuthInfo();
// create a BusinessEntity
BusinessEntity business2 = new BusinessEntity();
business2.addName(new Name("PopSecret","en"));
// create a BusinessEntity Vector
Vector businessVector2 = new Vector(1);
businessVector2.addElement(business2);
// create & execute the SaveBusiness request
SaveBusiness sbReq2 = new SaveBusiness();
sbReq2.setAuthInfo(authInfo2);
sbReq2.setBusinessEntityVector(businessVector2);
BusinessDetail detail2 = (BusinessDetail)registry.execute(sbReq2);
Vector detailVector2 = detail2.getBusinessEntityVector();
BusinessEntity b2 = (BusinessEntity)detailVector2.elementAt(0);
// create a new PublisherAssertion
String fromKey = b1.getBusinessKey();
String toKey = b2.getBusinessKey();
KeyedReference keyedReference = new KeyedReference ("Partner Company","peer-peer");
keyedReference.setTModelKey(TModel.RELATIONSHIPS_TMODEL_KEY);
PublisherAssertion assertion = new PublisherAssertion(fromKey,toKey,keyedReference);
// create a PublisherAssertion Vector
Vector assertionVector = new Vector();
assertionVector.addElement(assertion);
// create an AddPublisherAssertions request & invoke the server
AddPublisherAssertions apaReq = new AddPublisherAssertions();
apaReq.setAuthInfo(authInfo1);
apaReq.setPublisherAssertionVector(assertionVector);
DispositionReport dspRpt1 = (DispositionReport)registry.execute(apaReq);
System.out.println("errno: "+dspRpt1.toString());
System.out.println();
DispositionReport dspRpt2 = (DispositionReport)registry.execute(apaReq);
System.out.println("errno: "+dspRpt2.toString());
}
catch (RegistryException regex)
{
DispositionReport dispReport = regex.getDispositionReport();