Kurt,
Your tips are absolutely awesome. I studied the code from the trunk.
The errors have gone away -- I had to program differently. Cheers!
From: Kurt T Stam
Subject: Re: UDDIClerk.findBusiness fine, but UDDIClerk.findService runs into
Exception
To: "Computer Learning Inst"
Date: Wednesday, June 29, 2011, 9:38 PM
1. Can you try it with the code from the trunk?
2. It be helpful if you can write it as a unit test in the jUDDI
source code, that way everyone can run it w/o having to guess how
your code is to run.
Cheers,
--Kurt
On 6/29/11 2:48 PM, Computer Learning Inst wrote:
Hi,
UDDIClerk.findBusiness works fine.
However, very similar code that uses UDDIClerk.findService
throws exception:
[org.apache.juddi.v3.client.transport.TransportException:
unknown protocol: authtoken]. Please see below for
details, and please suggest a solution!
Environment:
=========
jUDDI v3.0.4
Java(TM) SE Runtime Environment (build 1.6.0_16-b01)
Windows XP Pro x64
In juddiv3.properties: juddi.authenticate.Inquiry=true
Code:
====
...
objClerks =
UDDIClientContainer.getUDDIClerkManager(JUDDIv3Communication.CLERK_MANAGER_NAME).getClientConfig().getUDDIClerks();
...
Node n = new Node();
n.setName(JUDDIv3Communication.MYORG_UDDI_NODE_NAME);
// "default" node
try {
AuthToken myPubAuthToken = null;
myPubAuthToken =
this.getAuthToken(JUDDIv3Communication.PUBLISHER_AUTHORIZED_NAME);
n.setSecurityUrl(myPubAuthToken.getAuthInfo());
objTheOnlyServiceInUDDI =
objUDDIClerk.findService(pstrSvcKey, n);
}
catch (Exception e) {
e.printStackTrace();
}
...
Exception:
========
JUDDIv3Communication.findServiceByKeyAsString():
pstrSvcKey=~uddi:juddi.apache.org:5c5d1518-bfa5-4aff-83c8-92c8e582758f~
- INFO
JUDDIv3Communication.getAuthToken():
PUBLISHER=~myorg-publisher~ and
AUTHTOKEN=~authtoken:caaa8d27-64de-418e-951e-6ce370f75ef8~
- INFO
org.apache.juddi.v3.client.transport.TransportException:
unknown protocol: authtoken
at
org.apache.juddi.v3.client.transport.JAXWSTransport.getUDDISecurityService(JAXWSTransport.java:104)
at
org.apache.juddi.v3.client.config.UDDIClerk.getAuthToken(UDDIClerk.java:375)
at
org.apache.juddi.v3.client.config.UDDIClerk.findService(UDDIClerk.java:252)
at
net.myorg.uddiv3.util.JUDDIv3Communication.findServiceByKeyAsString(JUDDIv3Communication.java:861)
at
net.myorg.uddiv3.util.JUDDIv3Communication.main(JUDDIv3Communication.java:1305)
Caused by: java.net.MalformedURLException: unknown
protocol: authtoken
at java.net.URL.<init>(URL.java:574)
at java.net.URL.<init>(URL.java:464)
at java.net.URL.<init>(URL.java:413)
at
org.apache.juddi.v3.client.transport.JAXWSTransport.getUDDISecurityService(JAXWSTransport.java:101)
... 4 more
Note:
====
Again, note that a very similar code that uses
UDDIClerk.findBusiness works just fine.
Any help is much appreciated!