无法设置Web服务端点连接到外部wsdl

时间:2019-04-04 23:21:41

标签: java intellij-idea wsdl qnames

我正在连接到外部wsdl,并试图获得响应。

此刻我的错误似乎是IDE正在使用必须自动生成的终结点地址,或者它是从某个位置的列表中获取的。 基本上,我需要找到一种方法来将端点设置为我选择的URL,而不是似乎自动生成的URL。 我的错误如下:

Exception in thread "main" javax.xml.ws.WebServiceException: 
Unsupported endpoint address: net.pipe://dvs-s-sta-1.dvs.local/Bus/VerificationServiceBus.svc

我的代码是:

public static void main(String[] args) throws MalformedURLException, ClassNotFoundException, IllegalAccessException, InstantiationException {


    URL UrlString = new URL("https://URL.com.au:19443/Bus/VerificationServiceBus.svc?wsdl");
    String url02 = "https://URL.com.au:19443/Bus/VerificationServiceBus.svc?wsdl";


    //Qname contains target namespace and name (port)
    QName qname = new QName("http://EXAMPLE/Service/Manager", "VerificationServiceBus", "Https");
    QName port = new QName("http:/EXAMPLE/Manager","DefaultNamedPipeBinding_IVerification","Https");
    QName portName = new QName("Https");
    Service service = Service.create(UrlString, qname);
    //String serviceName = "VerificationServiceBus";

    CertificateRequest Certificate = (new TestData()).CertificateTest();


    try {

        IVerification myProxy = service.getPort(port,IVerification.class);
        VerificationResponse response = myProxy.verifyDocument(Certificate);
        System.out.println(response.getVerificationResultCode());

    }
    catch (IVerificationVerifyDocumentUnauthorizedAccessExceptionFaultFaultMessage ex) {
        System.out.println(ex.getMessage());

    }
}

} (P.对于某些冗余代码感到抱歉,其唯一原因是由于尝试了多种解决问题的方法。)

谢谢

0 个答案:

没有答案