• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Can't connect to my web service remotely (very basic example)

 
Greenhorn
Posts: 20
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

I've been using Netbeans 6 to get to grips with Java Web Services, and I've developed them exclusively using this IDE including a client program to consume them.

Everything has been working fine when running my server and client on the same machine, but I've recently been trying to get my client to talk to the web service when it's deployed somewhere remote and I must be missing a huge step somewhere because I simply can't get this to work.

I can view the WSDL file through a web browser fine, so I know the correct port is open and the web services should be there - but when my client tries to call the very first method on the web service, it says "Connection Refused" - I've made sure everything that used to previously reference "localhost" now references the external IP address in all the classes on the client, but I must be missing something else, or there is a configuration issue.

It may be worth noting that this link:
http://localhost:8080/Evaluator/EvaluatorService?Tester
...works fine on the server machine, but if I try to call it remotely by replacing "localhost" with an IP address, I get displayed on the page...

"Exceptions details : null
java.lang.NullPointerException at java.io.File.(File.java:222)
at com.sun.enterprise.webservice.monitoring.WebServiceTesterServlet.initializePort(WebServiceTesterServlet.java:524) at..."


...which seems a bit meaningless :-( I don't understand why this wouldn't return the same page as it does on the local machine?

I realise this is probably a very basic question, I still have absolutely heaps to learn about Web Services but I hoped to have this simple system working fairly quickly as a starting point. I've tried looking up some resources, but I either find examples too basic, or far too complicated for me to understand yet. If anyone could give me some pointers as to what to check I would be very grateful...

Thanks!
 
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I notice that something is trying to use a File object. That doesn't seem like a reasonable thing for a web service to do.

And given that you say your code works when the client and server are the same machine but not when they aren't, it very much makes me suspect that it's your code which is trying to access a file. Naturally code on the server won't be able to access files on the client machine -- at least, not via a File object.
 
Will Farquharson
Greenhorn
Posts: 20
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That link is just to a Web Service testing page that usually appears if you click "Test Web Service" from the right click menu in Netbeans - I'm not sure what it does behind the scenes with files etc, but it usually just displays a list of all the methods you have and lets you invoke them to see if they are work. I thought the fact that this page didn't work remotely might be a good indicator as to why my client can't consume the web service either.... I could be wrong though.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic