有人可以告诉我我做错了什么吗?我正在尝试组织一个快速的 Web 服务测试,看看我现在是否可以让它工作。我遇到的问题是,如下所示,它不起作用,但如果我更改 URL 并将“ myWebsite.com
”替换为“”,localhost
它会起作用。所以,我知道服务器端正在工作(我仍然检查并仔细检查了它)。但是我需要它来通过远程客户端工作,我就是无法让它工作。任何帮助将不胜感激。
package stickman.Server;
import java.net.*;
import javax.xml.namespace.*;
import javax.xml.ws.*;
import stickman.Combined.*;
public class TestApp {
public static void main(String[] args) throws Exception {
// --------------------------------------------
// changing "myWebite.com" to "localhost" works
URL url = new URL(
"http://myWebsite.com:32768/home/rhyan/workspace/Stickman/bin/stickman/Server");
// --------------------------------------------
QName qname = new QName("http://Server.stickman/","StickmanServerService");
Service service = Service.create(url, qname);
StickmanServerInterface ssi = service.getPort(StickmanServerInterface.class);
Account a = ssi.getAccount("This is a test");
System.out.println(a.getUserId());
}
}
编辑:这是错误跟踪...
Exception in thread "main" com.sun.xml.internal.ws.wsdl.parser.InaccessibleWSDLException: 2 counts of InaccessibleWSDLException.
java.net.ConnectException: Connection refused
java.net.ConnectException: Connection refused
at com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser.tryWithMex(RuntimeWSDLParser.java:161)
at com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser.parse(RuntimeWSDLParser.java:133)
at com.sun.xml.internal.ws.client.WSServiceDelegate.parseWSDL(WSServiceDelegate.java:254)
at com.sun.xml.internal.ws.client.WSServiceDelegate.<init>(WSServiceDelegate.java:217)
at com.sun.xml.internal.ws.client.WSServiceDelegate.<init>(WSServiceDelegate.java:165)
at com.sun.xml.internal.ws.spi.ProviderImpl.createServiceDelegate(ProviderImpl.java:93)
at javax.xml.ws.Service.<init>(Service.java:76)
at javax.xml.ws.Service.create(Service.java:700)
at stickman.Server.ServerTestApp.main(ServerTestApp.java:17)