Hi Atousa,

Take a look at

http://svn.apache.org/repos/asf/webservices/juddi/trunk/docs/examples/simple-publish/

and

http://svn.apache.org/repos/asf/webservices/juddi/trunk/uddi-tck/src/test/java/org/apache/juddi/v3/tck/UDDI_040_BusinessServiceIntegrationTest.java

That should have all you need.

Good luck,

--Kurt


On 10/5/10 4:31 PM, Atousa Pahlevan wrote:
Hi,

Can anyone send me a sample of client code to get service publisher info. from juddi. I installed juddi and also able to get Authtoken information, however still could not get the service information (read services). I greatly appreciate any help.

Here is my code :

package testclient;

import java.rmi.RemoteException;

import api_v3.juddi_apache_org.Publisher;
import api_v3.uddi_org.AuthToken;
import api_v3.uddi_org.Get_authToken;
import v3_service.juddi_apache_org.JUDDI_Api_PortTypeProxy;
import v3_service.uddi_org.UDDI_Security_PortTypeProxy;

public class UDDIApiTestClient {

    public void getPublisher(){
UDDI_Security_PortTypeProxy proxy = new UDDI_Security_PortTypeProxy();
        Get_authToken authtoken = new Get_authToken();
        authtoken.setUserID("root");
        authtoken.setCred("root");
        AuthToken token=null;
        try {
            token = proxy.get_authToken(authtoken);
            System.out.println(":"+token.getAuthInfo());
        } catch (RemoteException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
            return;
        }
        JUDDI_Api_PortTypeProxy proxyapi = new JUDDI_Api_PortTypeProxy();

        try {
Publisher list[] = proxyapi.get_allPublisherDetail(token.getAuthInfo());
        } catch (RemoteException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }
    /**
     * @param args
     */
    public static void main(String[] args) {
        UDDIApiTestClient client = new UDDIApiTestClient();
        client.getPublisher();
    }

}

Console:

:authtoken:2f08a139-5cc4-4e7c-a9d6-311193253ca3
AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server <http://schemas.xmlsoap.org/soap/envelope/%7DServer>
 faultSubcode:
 faultString: Authentication is required for this API call
 faultActor:
 faultNode:
 faultDetail:
{urn:uddi-org:api_v3}dispositionReport:<ns3:result errno="10120"><ns3:errInfo errCode="E_authTokenRequired">Authentication token is missing or is invalid.</ns3:errInfo></ns3:result>

*I also can see "root" in the list if the publisher in juddi ?!!!*


Regards,
Atousa


Reply via email to