0

我很难弄清楚如何使用 wsimport来使用这个Web 服务?

当我从http://www.mkyong.com/webservices/jax-ws/jax-ws-hello-world-example/查看 wsimport 时,应该直接使用端口对象,但似乎我缺少一些基本知识关于jax-ws?

编辑:没关系我想通了:D

4

1 回答 1

0
public static void main(String args[]) {
    try {
        URL url = new URL("http://ws.cdyne.com/emailverify/Emailvernotestemail.asmx?wsdl");
        QName qname = new QName("http://ws.cdyne.com/", "EmailVerNoTestEmail");
        Service service = Service.create(url, qname);
        EmailVerNoTestEmailSoap port = service.getPort(EmailVerNoTestEmailSoap.class);
        System.out.println(port.verifyEmail("example@gmail.com", "123").getResponseText());
    } catch (Exception e) {
        System.err.println("Error occurred while sending SOAP Request to Server");
        e.printStackTrace(System.err);
    }
}
于 2013-11-08T00:44:42.180 回答