0

Can someone please tell me what I'm doing wrong? I'm trying to put together a quick web service test just to see if I can get it to work for now. The problem I'm having is that, as shown below, it does not work, but if I change the URL and replace "myWebsite.com" with "localhost" it works. So, I know the server side is working (I've still checked and double checked it though). But I'll need this to work through remote clients, and I just cannot get it to work. Any help would be greatly appreciated.

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());

}

}

Edit: here's the error tracking...

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)
Richard Rhyan
  • 203
  • 1
  • 6
  • 17

3 Answers3

1

Could be a DNS problem? What IP address do you resolve myWebsite.com to?

cgull
  • 1,407
  • 1
  • 11
  • 18
1

Your exception indicates that the wsdl for the service is not accessible - not the service itself. Can you confirm that the wsdl for the service is available at this location - http://myWebsite.com:32768/home/rhyan/workspace/Stickman/bin/stickman/Server, and the url in the wsdl points to a proper working endpoint.

Biju Kunjummen
  • 49,138
  • 14
  • 112
  • 125
  • Yes, the URL points to a proper working endpoint, and the website is correct and is where the service is running. hmm... Come to think of it, is there some setting on a Linux machine (Ubuntu 11.04) that needs to be set to allow this? – Richard Rhyan Apr 12 '12 at 03:12
  • 1
    You can try and put a tool like nettool - http://sourceforge.net/projects/nettool/, in between your client program and the server to see what is going on back and forth, or even something like wireshark - http://www.wireshark.org/, to find all the request outbound from your machine to find out where exactly the request is going to. – Biju Kunjummen Apr 12 '12 at 11:19
1

It took 8 days of reading a plethora of stuff online before I finally found the answer to my problem through a random google search I came up with: Publishing a WS with Jax-WS Endpoint

"localhost" should be 0.0.0.0, and I totally should have known this. Thanks to the people who tried to help.

Community
  • 1
  • 1
Richard Rhyan
  • 203
  • 1
  • 6
  • 17