aspose file tools*
The moose likes Web Services and the fly likes JAX-ws client reporting my service is not a valid service! Help!! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "JAX-ws client reporting my service is not a valid service! Help!!" Watch "JAX-ws client reporting my service is not a valid service! Help!!" New topic
Author

JAX-ws client reporting my service is not a valid service! Help!!

Philippe Desrosiers
Ranch Hand

Joined: Mar 29, 2006
Posts: 138
I'm having some problems with a webservice stub generated by wsimport. Basically it's giving me this indecipherable (to me) error:



This is strange to me because I just generated the UserWS class withwsimport. Also because I have no idea what this cryptic error message means.

So what I'd like to do (barring one of you experts, like Peer, explaining what the hell this means), is to somehow log the SOAP request and response sent/received by the web service proxy (although it looks like it never gets that far...). Is there some way to do this?

One more tidbit: This error appears only on specific client machines. Running the same request using SoapUI, the request processes correctly. (no problems)

EDIT: In case a bit of code helps (and it always does), here is the offending line from com.foo.services.user.UserWS.java:

And here's the calling code:
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42600
    
  65
{http://www.foo.com/services/}UserWS is not a valid service.

This sounds like the code may be accessing the wrong URL.


Ping & DNS - my free Android networking tools app
Philippe Desrosiers
Ranch Hand

Joined: Mar 29, 2006
Posts: 138
Hi Ulf,

I thought that too, but this occurs in the constructor of the service proxy, before any URL is called (I think)...
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42600
    
  65
Well, it's incorrect no matter where it occurs, isn't it?
Peer Reynders
Bartender

Joined: Aug 19, 2005
Posts: 2922
    
    5
Philippe Desrosiers wrote:One more tidbit: This error appears only on specific client machines.

This strongly suggests that the problem is somewhere in the runtime environment.
  • Do they have the same version of Java or more importantly the same version of JAX-WS/JAXB
  • Are the various environment variables properly set? JAVA_HOME, CLASSPATH, possibly even the order of the jar archive files in the CLASSPATH variable(s)


  • log the SOAP request and response sent/received by the web service proxy (although it looks like it never gets that far...). Is there some way to do this?

    You can use Apache TCPMon (Tutorial) or java.net tcpmon to capture/view the HTTP request/response pairs. However I doubt that it will help in this case. Note that in the case of JAX-WS you will have to make a local copy of the WSDL and modify the endpoint address to point to tcpmon and then modify the web service proxy creation to use that local WSDL.



    This is peculiar - I've only ever seen it use the single String parameter on the URL. However you could easily bypass that by using:



    Philippe Desrosiers wrote:this occurs in the constructor of the service proxy, before any URL is called (I think)...

    This could very well happen after the proxy reads the WSDL to get the web service endpoint address. It is not complaining that it couldn't read the WSDL ... it is complaining that it can't find UserWS in the {http://schemas.xmlsoap.org/wsdl/}service element of the WSDL even though it clearly is there.

    So I'd also try the client using a local copy of the WSDL rather than the one over the network - just in case it makes a difference.
    Philippe Desrosiers
    Ranch Hand

    Joined: Mar 29, 2006
    Posts: 138
    Hi Peer,

    As usual, you are perfectly correct. This issue only occurs on a specific development machine, with a highly suspect Java installation. Basically, the developer (new to Windows Java), tried to clean out older JRE and JDK installations by simply deleting them, then re-installed JDK 1.6.0_11. So now there's a bunch of Registry issues, DLLs that can't be found, etc.

    Thanks!
    Philippe Desrosiers
    Ranch Hand

    Joined: Mar 29, 2006
    Posts: 138
    Ulf Dittmer wrote:Well, it's incorrect no matter where it occurs, isn't it?


    LOL. Yes. But in my experience, incorrect code won't often throw an exception if it's never called...
     
    I agree. Here's the link: http://aspose.com/file-tools
     
    subject: JAX-ws client reporting my service is not a valid service! Help!!