Hi Navneeth,
You will have to sign up for the juddi user mailing list
(http://juddi.apache.org/mail-lists.html) to keep getting replies. I
cc'd you this time.
I just:
1. fired up a juddi-tomcat
2. on the client side code made sure my META-INF/uddi.xml was pointing
to that instance
and
3. ran the simple-publish example, which I think it where your code is
based on. And this ran just fine. The 'root' user has admin privileges,
so it can add publishers.
I would say, start with the exact Simple-Publish example and make sure
that works before modifying things.
Cheers,
--Kurt
On 3/5/12 11:53 PM, Navneeth Baliga wrote:
Hi,
Here is a piece of code , when I try to run this code in my Eclipse ,
I get this error message saying that Administrator privileges are
required. How do I get round this problem ? Please suggest a solution .
*public**class*MainClient {
*public**void*SimplePublish()
{
*try*{
String clazz =
UDDIClientContainer./getUDDIClerkManager/(*null*).getClientConfig().getUDDINode("default").getProxyTransport();
Class<?> transportClass =
Loader./loadClass/(clazz);
*if*(transportClass!=*null*) {
Transport transport = (Transport)
transportClass.newInstance();
UDDISecurityPortType securityService =
transport.getUDDISecurityService();
JUDDIApiPortType juddiApi =
transport.getJUDDIApiService();
UDDIPublicationPortType _publish_=
transport.getUDDIPublishService();
UDDISubscriptionPortType
_subscribe_=transport.getUDDISubscriptionService();
GetAuthToken getAuthToken =
*new*GetAuthToken();
getAuthToken.setUserID("root");
getAuthToken.setCred("root");
AuthToken rootAuthToken =
securityService.getAuthToken(getAuthToken);
System./out/.println(rootAuthToken.getAuthInfo());
Publisher p = *new*Publisher();
p.setAuthorizedName("my-publisher");
p.setPublisherName("Navneet B");
SavePublisher sp = *new*SavePublisher();
sp.getPublisher().add(p);
sp.setAuthInfo(rootAuthToken.getAuthInfo());
juddiApi.savePublisher(sp);
GetAuthToken getAuthTokenMyPub =
*new*GetAuthToken();
getAuthTokenMyPub.setUserID("my-publisher");
getAuthTokenMyPub.setCred("");
AuthToken myPubAuthToken =
securityService.getAuthToken(getAuthTokenMyPub);
System./out/.println ("myPub AUTHTOKEN
= "+ myPubAuthToken.getAuthInfo());
}
}
*catch*(Exception e)
{
e.printStackTrace();
}
}
/**
* *@param*args
*/
*public**static**void*main(String[] args) {
// *TODO*Auto-generated method stub
MainClient m=*new*MainClient();
m.SimplePublish();
}
}