1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
| package sample;
import java.net.MalformedURLException;
import java.util.Vector;
import org.uddi4j.UDDIException;
import org.uddi4j.client.UDDIProxy;
import org.uddi4j.datatype.business.BusinessEntity;
import org.uddi4j.response.AuthToken;
import org.uddi4j.transport.TransportException;
public class FirstSample {
/**
* @param args
*/
public static void main(String[] args) {
UDDIProxy proxy = new UDDIProxy();
AuthToken authToken = new AuthToken();
try {
// Creating a UDDIProxy
proxy.setInquiryURL("http://www-3.ibm.com/services/uddi/testregistry/inquiryapi");
proxy.setPublishURL("https://www-3.ibm.com/services/uddi/testregistry/protect/publishapi");
// get the proxy authentication...
authToken = proxy.get_authToken("userid", "password");
// Publish a business Listing...
Vector entities = new Vector();
BusinessEntity be = new BusinessEntity("", null);
be.setName("Sample business");
entities.addElement(be);
}catch (MalformedURLException e) {
e.printStackTrace();
}catch (TransportException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}catch(UDDIException e){
e.printStackTrace();
}
}
} |
Partager