UDDI_Security_Port не найден в WSDL http://localhost:8080/juddiv3/services/security?wsdl - PullRequest
0 голосов
/ 21 декабря 2011

Я пытаюсь создать Java-программу, которая будет взаимодействовать с JUDDI для публикации и запроса веб-сервисов. Я использую JUDDI Client API. Я постоянно получаю эту ошибку, и поиск в Google не помогает. Может кто-нибудь, пожалуйста, скажите мне, как решить эту проблему.

Ошибка:

org.apache.juddi.v3.client.transport.TransportException: Cannot create Service instance, service {urn:uddi-org:v3_service}UDDI_Security_Port not found in the WSDL http://localhost:8080/juddiv3/services/security?wsdl
A aparut o eroare :Cannot create Service instance, service {urn:uddi-org:v3_service}UDDI_Security_Port not found in the WSDL http://localhost:8080/juddiv3/services/security?wsdl
----------------------------------------------------------------

        at org.apache.juddi.v3.client.transport.JAXWSTransport.getUDDISecurityService(JAXWSTransport.java:104)
        at org.apache.juddi.v3.client.transport.Transport.getUDDISecurityService(Transport.java:43)
        at javaapplication22.JuddiPublish.publish(JuddiPublish.java:56)
        at javaapplication22.JuddiPublish.main(JuddiPublish.java:40)
Caused by: Cannot create Service instance, service {urn:uddi-org:v3_service}UDDI_Security_Port not found in the WSDL http://localhost:8080/juddiv3/services/security?wsdl
        at com.sun.xml.internal.ws.client.ServiceContextBuilder.build(ServiceContextBuilder.java:66)
        at com.sun.xml.internal.ws.client.WSServiceDelegate.<init>(WSServiceDelegate.java:125)
        at com.sun.xml.internal.ws.spi.ProviderImpl.createServiceDelegate(ProviderImpl.java:52)
        at javax.xml.ws.Service.<init>(Service.java:57)
        at javax.xml.ws.Service.create(Service.java:302)
        at org.apache.juddi.v3.client.transport.JAXWSTransport.getUDDISecurityService(JAXWSTransport.java:101)
        ... 3 more

JuddiPublish.java

import org.apache.juddi.api_v3.Publisher;
import org.apache.juddi.api_v3.SavePublisher;
import org.apache.juddi.v3.client.ClassUtil;
import org.apache.juddi.v3.client.config.UDDIClientContainer;
import org.apache.juddi.v3.client.transport.JAXWSTransport;
import org.apache.juddi.v3.client.transport.Transport;
import org.apache.juddi.v3_service.JUDDIApiPortType;
import org.uddi.api_v3.BindingDetail;
import org.uddi.api_v3.BusinessDetail;
import org.uddi.api_v3.BusinessEntity;
import org.uddi.api_v3.BusinessService;
import org.uddi.api_v3.CategoryBag;
import org.uddi.api_v3.Description;
import org.uddi.api_v3.GetAuthToken;
import org.uddi.api_v3.GetServiceDetail;
import org.uddi.api_v3.KeyedReference;
import org.uddi.api_v3.Name;
import org.uddi.api_v3.SaveBinding;
import org.uddi.api_v3.SaveBusiness;
import org.uddi.api_v3.SaveService;
import org.uddi.api_v3.ServiceDetail;
import org.uddi.v3_service.UDDIPublicationPortType;
import org.uddi.v3_service.UDDISecurityPortType;
import org.uddi.v3_service.UDDIInquiryPortType;
import org.uddi.api_v3.BindingTemplates;
//import org.apache.juddi.model.BindingTemplate;
import org.uddi.api_v3.BindingTemplate;
import org.uddi.api_v3.AccessPoint;
import org.uddi.api_v3.FindQualifiers;
import org.uddi.api_v3.FindService;
import org.uddi.api_v3.ServiceList;
import org.uddi.api_v3.ServiceInfo;
import org.uddi.api_v3.FindTModel;

public class JuddiPublish {

public static void main(String[] args) {
    publish("service name", "Calculare cmmdc", "wsdl locatie");
}

public static void publish(String serviceNameStr, String serviceDescriptionStr, String wsdlLocation) {

    try {

        String clazz = UDDIClientContainer.getUDDIClerkManager(null).
                getClientConfig().getUDDINode("default").getProxyTransport();

        Class<?> transportClass = ClassUtil.forName(clazz, Transport.class);

        if (transportClass != null) {

            Transport transport = (Transport) transportClass.getConstructor(String.class).newInstance("default");

            UDDISecurityPortType security = transport.getUDDISecurityService();
            JUDDIApiPortType juddiApi = transport.getJUDDIApiService();
            UDDIPublicationPortType publish = transport.getUDDIPublishService();
            UDDIInquiryPortType inquiry = transport.getUDDIInquiryService();

            // Setting up the values to get an authentication token for the 'root' user ('root' user
            // has admin privileges and can save other publishers).

            GetAuthToken getAuthTokenRoot = new GetAuthToken();
            getAuthTokenRoot.setUserID("root");
            getAuthTokenRoot.setCred("");

            // Making API call that retrieves the authentication token for the 'root' user.
            org.uddi.api_v3.AuthToken rootAuthToken = security.getAuthToken(getAuthTokenRoot);
            System.out.println("root AUTHTOKEN = " + rootAuthToken.getAuthInfo());
       } catch (Exception e) {

        System.out.println(
                "\n----------------------------------------------------------------");

        System.out.println(
                "A aparut o eroare :" + e.getMessage()
                + "\n----------------------------------------------------------------\n");

        e.printStackTrace();

    }

}

}

1 Ответ

0 голосов
/ 24 января 2012

Разобрался с проблемой

Я использовал juddi-tomcat-bundle-3.0.4 и juddi-client-3.1.0.jar.Из-за разных версий клиентскому коду не удалось найти UDDI_Security_Port.

Решено с помощью версий 3.0.4 как сервера juddi, так и API-интерфейса juddi-client.

...