wood burning stoves 2.0*
The moose likes JBoss/WildFly and the fly likes JBoss shows my WebService in /jbossws/services but I get 404 when click on the link Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "JBoss shows my WebService in /jbossws/services but I get 404 when click on the link" Watch "JBoss shows my WebService in /jbossws/services but I get 404 when click on the link" New topic
Author

JBoss shows my WebService in /jbossws/services but I get 404 when click on the link

Chris Johnz
Greenhorn

Joined: Oct 22, 2012
Posts: 5
I have used JBoss and WebServices on projects, but I want to learn to set it up myself so I am trying a "Hello World" for starters. I have this class:

And I have added these lines to my web.xml:

When I save in Eclipse the project builds and deploys to my local JBoss server.

When I browse to localhost:8080/jbossws/services I can see the service listed as the only Registered Service Endpoints as follows:

But when I click on the link (Athena is my own computer, of course), I get "404: The requested resource (/MyDynamicWebProjectEAR-MyDynamicWebProject/MyWebServicesBean) is not available."

I can still run the servlet that I had already placed in this project before trying to generate this webservice, so JBoss is running all right. And my EAR file must surely have been rebuilt since I added my "HelloWorld" class to the project, since the webservice appears in the listing. But somehow the resource itself is not available. Nor can I access it in SoapUI.

Can someone help me, please? I can supply any more info you request.

Chris Johnz
Greenhorn

Joined: Oct 22, 2012
Posts: 5
Yes - I have seen this JRebel intro before, and I think it's great. But it doesn't solve my problem. I need to know how to set up a webservices Java Bean of the pattern I posted and run it in JBoss.
Siitesh Hind
Ranch Hand

Joined: Sep 06, 2012
Posts: 51
Try again by commenting out the @SOAPBinding( style = SOAPBinding.Style.RPC )

Redeploy the WS again
Siitesh Hind
Ranch Hand

Joined: Sep 06, 2012
Posts: 51
@WebService(name="MyWebService" , portName="MyWebServicePort",targetNamespace="http://www.abc.com")

This too works
Siitesh Hind
Ranch Hand

Joined: Sep 06, 2012
Posts: 51
Just one question for you

How did you specify the Endpoint Address to map to Athena in your code?

Default it is 127.0.0.1

http://127.0.0.1:8080/xxxxxxx?wsdl
Chris Johnz
Greenhorn

Joined: Oct 22, 2012
Posts: 5
Siitesh - Thank you for your help. I didn't specify Athena. But I used -b 0.0.0.0 for the JBoss binding, so that other computers on my network can connect. I guess it picked up the host name from DNS because of that.

And you are right: I don't need the @SOAPBinding annotation.

I actually have now succeeded in accessing the webservice, but I am not sure why. I looked in the MyWebServicesBean.wsdl file, to try to find some clues, and saw this:

So I tried entering that URL into my browser and, sure enough, I receive the WSDL is I expect. And when I enter this URL as the initial wsdl address in soapUI everything works as expected:

I can send the "name" soap request and I get the expected response. Hurrah!

But the JBoss localhost:8080/jbossws/services page still gives me the same (incorrect) endpoint address as before. So I am left now with a remaining question.
Why is JBoss giving me "http://Athena:8080/MyDynamicWebProjectEAR-MyDynamicWebProject/MyWebServicesBean?wsdl" as the endpoint address when it is not correct? I suppose I must have some out of date junk somewhere in my project, and I need to rebuild some artifact. But what?
Siitesh Hind
Ranch Hand

Joined: Sep 06, 2012
Posts: 51
@SOAPBinding( style = SOAPBinding.Style.RPC )

or

@SOAPBinding( style = SOAPBinding.Style.DOCUMENT)

works just fine. Nothing wrong here if you have it in the code.

Can you execute the wsdl using Internet Explorer instead of SOAPUI?

Chris Johnz
Greenhorn

Joined: Oct 22, 2012
Posts: 5
Yes, I get the expected behaviour in both browsers and soapUI.
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10240
    
168

Which version of JBoss AS are you using?

[My Blog] [JavaRanch Journal]
Siitesh Hind
Ranch Hand

Joined: Sep 06, 2012
Posts: 51
Chris

"I didn't specify Athena. But I used -b 0.0.0.0 for the JBoss binding, so that other computers on my network can connect. I guess it picked up the host name from DNS because of that. "

Did you had the setting as mentioned above to check in SOAPUI?

Jai

Does the AS version create an issue like this? I have 7 versions of JBoss. Never faced a problem like this before

Chris Johnz
Greenhorn

Joined: Oct 22, 2012
Posts: 5
I am using JBoss 5.0.

And I have set my soapUI initial WSDL set to "http://localhost:8080/MyDynamicWebProject/services/MyWebServicesBean", which works. This is what I see in the MyWebServicesBean.wsdl file but NOT what jbossws/services shows. So the question is where does JBoss get this from? And why?
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10240
    
168

Siitesh Hind wrote:

Jai

Does the AS version create an issue like this? I have 7 versions of JBoss. Never faced a problem like this before



There are chances that it might be a bug or a configuration issue. So knowing the AS version helps narrow down the possibilities.
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10240
    
168

It's a bug https://issues.jboss.org/browse/JBWS-2630. Take a look at the "Workaround description" section in that JIRA for a workaround.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JBoss shows my WebService in /jbossws/services but I get 404 when click on the link