0

created a very basic WS. i have LoggingHandler, Test, TestImpl, & TestPublisher. my publisher creates my endpoint below:

import javax.xml.ws.Endpoint;
public class TestPublisher {
public static void main(String[] args) {
LoggingHandler handle = new LoggingHandler();
Endpoint ep = Endpoint.publish( "http://localhost:8060/message/hello",
    new TestImpl() );
ep.getBindings().getHandlerChain().add( new LoggingHandler() );
System.out.print( handle.toString() );
}
}

my Test interface uses @WebService & @WebMethod and only does "String getHello( String str );" my TestImpl implements Test and uses @WebService(endpointInterface="my package location") and only has a method "public String getHelloWorld( String str ){ return "Hello " + str; } my handler has handleMessage, handleFault, & close. i can put this code up too but i don't think that would help.

when i head over to localhost:port/message/hello on the same (dev) RH6 pc, it works great! i get "Hello my name". i even can get a wsdl file at localhost:port/message/hello?wsdl

when i try accessing from any other pc, linux or windows, i get a timeout or "cannot display the webpage" error. so i setup in tcp/ip monitor in eclipse to monitor and route traffic from port 8061 (new port) to my WS port [here][link3] without changing any code.

results: i still can't access 8060 from any other pc except the one running the service (dev). so i point my browser to on the other pc's to port 8061 (tcp/ip monitor) and it successfully returns my message! do i need to run a monitor to forward to my java webservice?

on my RH6 box, i am not running a firewall or a web server & i am on my work network. i can successfully start tomcat6 and get to 8080 from the other pc's without using tcp/ip monitor.

Snake
  • 785
  • 1
  • 5
  • 13
  • Have you tried connecting to the port using telnet to confirm that is really is open (in case there's a firewall you don't know about)? e.g. telnet xx.xx.xx.xx 8060 Would be strange though as 8061 works. – Martin Wilson May 30 '12 at 19:49
  • 8060 - could not open connection to host – Snake May 30 '12 at 20:04
  • 8061 - successfully sends a 400 bad request to web service – Snake May 30 '12 at 20:05

1 Answers1

1

Try Endpoint.publish with the ip address of your machine,

ex: Endpoint.publish("http://192.168.0.1:8060/message/hello")

  • **Doh!** i was not binding the ip and tcp/ip monitor was binding... that is why that worked. thanks gustav! – Snake May 30 '12 at 21:27
  • or try publishing it on 0.0.0.0 http://stackoverflow.com/questions/3680600/publishing-a-ws-with-jax-ws-endpoint – gustavogabr May 31 '12 at 12:50