This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes JBoss/WildFly and the fly likes Confusion over JBossWS 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 "Confusion over JBossWS" Watch "Confusion over JBossWS" New topic
Author

Confusion over JBossWS

Krithi Raghu
Greenhorn

Joined: Jan 15, 2008
Posts: 23
Hi everyone...

I am trying to develop a sample web service using JBOSS. When i searched in Google, i could see that webservices in JBOSS could be developed using AXIS, JBOSSWS and WS4EE. What are all these exactly? How do we determine which one we should use for our purpose? Please throw some light on this...
I have used weblogic before and we are migrating to JBOSS now. I am still unable to develop a helloworld web service using JBOSS.

Awaiting eagerly for some reply on this...
Rene Larsen
Ranch Hand

Joined: Oct 12, 2001
Posts: 1179

Whitch version of JBoss do you use?

If you are using version 4.2+ you can use this User Guide for JBossWS - and it works

Just remember that this is "The JBoss way" of using the JavaEE webservice implementation, but it is almost like the real standard SUN (Glassfish) implementation.


Regards, Rene Larsen
Dropbox Invite
Krithi Raghu
Greenhorn

Joined: Jan 15, 2008
Posts: 23
When i compile my java class, i get this error...



I am using JBOSS4.2.2
Krithi Raghu
Greenhorn

Joined: Jan 15, 2008
Posts: 23
This is my webservice interface


This is the annotated WS

Rene Larsen
Ranch Hand

Joined: Oct 12, 2001
Posts: 1179

To be able to compile your WS code, you need to add the right JBoss WS jar files to the compile classpath. Because your hello world code does not contain any JBoss specific WS code, I just used my normal 'javaee.jar' (GlassFish implementation) as the only one in the classpath - beside the JDK.

Your HelloWorld code did not work as it was (could not deploy), but I did not get any compiler errors.

I needed to add then "@Stateless" annotation to the HelloWorldWS - then the webservice could deploy on a JBoss v2.4.1.



And it gave me this WSDL:


[ April 17, 2008: Message edited by: Rene Larsen ]
Krithi Raghu
Greenhorn

Joined: Jan 15, 2008
Posts: 23
Thanks Larsen...
I still could not resolve the annotation issue. However i could develop a sample web service without using annotation. I tried writing a sample client program to invoke the web service. This was done using HttpURLConnection. But this gives the following error in the server.

I could not guess what exactly is going wrong?
A snippet of my sample client program

Please guide me. In weblogic, i was able to send my xml using this program. But in JBOSS, it is giving me this error.
Rene Larsen
Ranch Hand

Joined: Oct 12, 2001
Posts: 1179

Hi,

If I use the webservice 'HelloWorldWS', with the '@Stateless' added to it - and I modified the SOAP to match that WSDL - everything works.

To see how the SOAP should look like, you can use SOAP UI as a client

I have modified these lines, with the right SoapActionUrl, webservice method name and namespace:


Finally I added an InputStream to be able to read from the HttpURLConnection:
Krithi Raghu
Greenhorn

Joined: Jan 15, 2008
Posts: 23
Thanks Larsen. I could make this working now.
 
Consider Paul's rocket mass heater.
 
subject: Confusion over JBossWS