Java 使用SAAJ消费经过身份验证的web服务?

Java 使用SAAJ消费经过身份验证的web服务?,java,web-services,wcf,ssl,saaj,Java,Web Services,Wcf,Ssl,Saaj,我正在尝试使用SAAJ使用经过身份验证的Web服务。这是我目前掌握的代码: import java.io.ByteArrayOutputStream; import javax.xml.soap.*; import biz.source_code.base64Coder.*; public class Client { private static String endpoint = "https://example.com/xxx.php", username = "xx

我正在尝试使用SAAJ使用经过身份验证的Web服务。这是我目前掌握的代码:

import java.io.ByteArrayOutputStream;

import javax.xml.soap.*;
import biz.source_code.base64Coder.*;


public class Client {
    private static String endpoint = "https://example.com/xxx.php",
    username = "xxx", password = "xxx";

    private static SOAPMessage getRequest() throws Exception{
        MessageFactory factory = MessageFactory.newInstance();
        SOAPMessage message = factory.createMessage();

        //set authorization as a HTTP header
        String authorization = Base64Coder.encodeString(username + ":" + password);
        MimeHeaders hd = message.getMimeHeaders();
        hd.addHeader("Authorization", "Basic " + authorization);

        //Call getReportList operation


        return message;
    }


    public static void main(String[] args) throws Exception {
        SOAPConnectionFactory connFactory = SOAPConnectionFactory.newInstance();
        SOAPConnection connection = connFactory.createConnection();

        // create request message and give it content
        SOAPMessage request = Client.getRequest();

        // call the API endpoint with the request
        SOAPMessage response = connection.call(request, endpoint);

        ByteArrayOutputStream out = new ByteArrayOutputStream();
        response.writeTo(out);
        String strMsg = new String(out.toByteArray());
        System.out.println(strMsg);
    }

}
当我运行此命令时,它会打印strMsg(来自web服务的响应),如下所示:

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>WSDL</faultcode><faultstring>SOAP-ERROR: Parsing WSDL: Couldn't load from '/www/example.wsdl' : failed to load external entity "/www/example.wsdl"
</faultstring></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>

WSDLSOAP-ERROR:解析WSDL:无法从“/www/example.WSDL”加载:未能加载外部实体“/www/example.WSDL”
我猜我已经对自己进行了身份验证,但是web服务出现了问题,而不是我的问题。但是,我不能完全肯定。这个错误消息似乎并不常见


这是否意味着我提供的身份验证不正确或不充分?或者我必须提供SSL证书,因为web服务使用SSL?如果是,是否有关于如何在SAAJ中使用SSL证书的教程?

问题是我使用的是“而不是”作为端点。这就是它无法加载任何wsdl文件的原因