So I got some problems using 'XMLDocAuthenticator'. The problem is described
below at the end of the post in the last quote.
Kurt wrote:
>
> 3. That said, on your client you should only be using the
> juddi-client.jar and the uddi-ws.jar, right now you seem to
> be using the persistence classes (any classes in org.apache.juddi.model)
> from the juddi-core.jar.
>
I were using only "org.apache.juddi.query.util.FindQualifiers" class for
getting valid abbreviations. So I replaced it with my own class and removed
it and also removed juddi-core.jar from buildpath.
But java still throws me this exception:
> javax.xml.ws.soap.SOAPFaultException:
> org.apache.juddi.model.UddiEntityPublisher cannot be cast to
> org.apache.juddi.model.Publisher
>
in
> public PublisherDetail savePublisher(SavePublisher savePublisher)
> throws Exception
> {
> return juddiApi.savePublisher(savePublisher);
> }
>
As far as I understand this exception appears from overlapping classes which
I import? So I checked my classes:
I have QueryBuilder class (builds various FindBusiness, SavePublisher,
DeleteService and similar objects in a static way) which imports:
> import org.apache.juddi.api_v3.*;
> import org.uddi.api_v3.*;
>
and Tools class (which works with UDDISecurityPortType, JUDDIApiPortType,
UDDIPublicationPortType and UDDIInquiryPortType) which imports:
> import org.apache.juddi.api_v3.*;
> import org.apache.juddi.v3.client.ClassUtil;
> import org.apache.juddi.v3.client.config.UDDIClientContainer;
> import org.apache.juddi.v3.client.transport.Transport;
> import org.apache.juddi.v3_service.JUDDIApiPortType;
> import org.uddi.api_v3.*;
> import org.uddi.v3_service.*;
>
These are the only two classes which involves into working with juddi.
Btw, my name is Martin :-)
#######################################################################
> Hi Chainerit,
>
> Glad you got that to work :).
>
> 1. As a rule, it is better to open a new thread (subject) for a new
> problem.
>
> 2. And usually it is also it is better to only bring up one problem at
> the time :)
>
> 3. That said, on your client you should only be using the
> juddi-client.jar and the uddi-ws.jar, right now you seem to
> be using the persistence classes (any classes in org.apache.juddi.model)
> from the juddi-core.jar.
>
> 4. Our mailing lists are listed here:
> http://juddi.apache.org/mail-lists.html. You can find the current thread
> here:
> http://mail-archives.apache.org/mod_mbox/juddi-user/201103.mbox/browser
>
> If you still have an issue I did not address then please start another
> thread for that.
>
> Good luck!
>
> --Kurt
>
>
> On 3/28/11 6:07 AM, chainerlt wrote:
>> Hi Kurt,
>>
>> thank you for your previous reply. Somehow I think I was trying the same
>> steps before, but they didn't work well. However now I'm able to
>> successfully set up my juddi in tomcat bundle for 'XMLDocAuthenticator'
>> or
>> 'CryptedXMLDocAuthenticator' authentications. Everything seems to be
>> working
>> except saving/deleting publishers. It throws me:
>>
>>
>> java wrote:
>>> javax.xml.ws.soap.SOAPFaultException:
>>> org.apache.juddi.model.UddiEntityPublisher cannot be cast to
>>> org.apache.juddi.model.Publisher
>>> at
>>> com.sun.xml.internal.ws.fault.SOAP11Fault.getProtocolException(SOAP11Fault.java:178)
>>> at
>>> com.sun.xml.internal.ws.fault.SOAPFaultBuilder.createException(SOAPFaultBuilder.java:111)
>>> at
>>> com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:108)
>>> at
>>> com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:78)
>>> at
>>> com.sun.xml.internal.ws.client.sei.SEIStub.invoke(SEIStub.java:107)
>>> at $Proxy40.savePublisher(Unknown Source)
>>>
>> I wrote such a method for getting authentication token:
>>
>> java wrote:
>>> public AuthToken getAuthToken(String userID, String cred) throws
>>> Exception
>>> {
>>> GetAuthToken getAuthToken = new GetAuthToken();
>>> getAuthToken.setUserID(userID);
>>> getAuthToken.setCred(cred);
>>> return security.getAuthToken(getAuthToken);
>>> }
>>>
>> And when I'm trying to save publisher, here is how I do it:
>>
>>
>>> public PublisherDetail savePublisher(SavePublisher
>>> savePublisher)
>>> throws Exception
>>> {
>>> return juddiApi.savePublisher(savePublisher);
>>> }
>>> ...
>>> public static SavePublisher GetSavePublisher(Publisher publisher,
>>> AuthToken authToken) throws Exception
>>> {
>>> List listPublisher = new ArrayList<Publisher>();
>>> listPublisher.add(publisher);
>>> return GetSavePublisher(listPublisher, authToken);
>>> }
>>> ...
>>> public static SavePublisher GetSavePublisher(List<Publisher>
>>> listPublisher, AuthToken authToken) throws Exception
>>> {
>>> SavePublisher sp = new SavePublisher();
>>> sp.setAuthInfo(authToken.getAuthInfo());
>>> sp.getPublisher().addAll(listPublisher);
>>> return sp;
>>> }
>>>
>> So I build SavePublisher object and pass it to the juddiApi, but it
>> throws
>> this exception somewhere in the middle of compiled libs in this line:
>> return juddiApi.savePublisher(savePublisher);
>> Maybe you are interested in what Publisher object I pass as the parameter
>> to
>> build SavePublisher. In the current situation I get PublisherDetail from:
>>
>>
>>> public PublisherDetail getAllPublisherDetail
>>> (GetAllPublisherDetail gapd) throws Exception
>>> {
>>> return juddiApi.getAllPublisherDetail(gapd);
>>> }
>>> ...
>>> public static GetAllPublisherDetail GetAllPublisherDetail(AuthToken
>>> authToken) throws Exception
>>> {
>>> GetAllPublisherDetail gapd = new GetAllPublisherDetail();
>>> gapd.setAuthInfo(authToken.getAuthInfo());
>>> return gapd;
>>> }
>>> ...
>>>
>> Next I can work with particular publisher getting it from PublisherDetail
>> object getPublisher() method getting List<Publisher>.
>>
>> And another question I was worried about. As far as I understand juddiv3
>> does not work with "juddi-users.xml"/"juddi-users-encrypted.xml". It
>> cares
>> only if there is a publisher by the given Authorized Name. So how can I
>> save/delete new/old users with their passwords? Maybe somehow with
>> CryptedXMLDocAuthentication or XMLDocAuthenticator objects in my java
>> code?
>> I've tried to create them but it throws me that mentioned exception:
>>
>> chainerlt wrote:
>>> CryptedXMLDocAuthenticator x = new CryptedXMLDocAuthenticator();
>>> But it throws me:
>>> java.util.concurrent.ExecutionException:
>>> org.apache.commons.configuration.ConfigurationException: Cannot locate
>>> configuration source juddiv3.properties
>>>
>> And finally, how can I get into this mailing list system? I've subscribed
>> here: http://old.nabble.com/mailing_list/MailingListOptions.jtp?forum=240
>> But I don't get emails when some of you guys reply to my posts. So I
>> manually check mailing list here:
>> http://mail-archives.apache.org/mod_mbox/juddi-user/201103.mbox/browser
>> And
>> these replies does not appear in the thread I've created
>> http://old.nabble.com/juddiv3-credentials-%28passwords-%29-tt31198695.html
>> .
>> I remember asking for how to get finding all services/businesses and
>> didn't
>> know you guys replied me quickly, and that took me for around a week to
>> figure it by myself :/
>>
>> Thank you for helping :-)
>
--
View this message in context:
http://old.nabble.com/juddiv3-%283.0.4%29-%22juddi.authenticator%22-%28XMLDocAuthenticator%29-problems-with-saving-deleting-Publishers-tp31259207p31259207.html
Sent from the jUDDI - User mailing list archive at Nabble.com.