[JBossWS] - returning array undefined in web service
by mckeno
Hi all I am having this problem, not sure whether it is related to jboss web service or the client site application:
I am writing a web service inside EJB container:
@Stateless
@WebService(name = "Mojo", targetNamespace = "http://myservice.com/services", serviceName = "CoolService")
@SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.WRAPPED)
public class MyWebService {
@WebMethod
@WebResult
public int[] getNumber(@WebParam(name = "userName") String sth) {
int[] number = new int[3];
number[0] = 7;
number[1] = 2;
number[2] = 3;
log.info("ARRAY METHOD CALLED " + number.length);
return number;
}
@WebMethod
@WebResult
public int getNum(int param) {
int result = param + 2;
return result ;
}
}
The getNum() method works fine, but the getNumber() always return undefined result(I am calling the web service using Web Sevice Connector in Flash application). So I am wondering whether I need any specific annotation for the array returning methods?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4107928#4107928
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4107928
16 years, 6 months
[JBossWS] - WSDL not autogenerating for WebServiceProvider
by aazaroff
I am trying to deploy a web service using the @WebServiceProvider annotation. I am trying to deploy a stateless session bean as a web service. My target platform is 4.0.5. The code is packaged in a simple jar file. Here is the code:
| @Stateless
| @Remote(PosDataServicesRemoteInterface.class)
| @Local(PosDataServicesInterface.class)
| @LocalBinding(jndiBinding = "/local/ejb3/PosDataServicesBean")
| @RemoteBinding(jndiBinding = "/ejb3/PosDataServicesBean")
| @WebServiceProvider
| @ServiceMode(value = Service.Mode.MESSAGE)
| public class PosDataServices implements PosDataServicesRemoteInterface, PosDataServicesInterface, Provider<SOAPMessage> {
|
| private java.util.Properties properties;
| private java.util.TreeSet dataSourceMap;
| private org.apache.log4j.Logger logger;
|
| /**
| * Creates a new instance of PosDataServices
| */
| public PosDataServices() {
| this.logger = org.apache.log4j.Logger.getLogger(this.getClass().getName());
| }
|
| public SOAPMessage invoke(SOAPMessage sourceDocument) {
| return sourceDocument;
| }
|
| }
|
Here are the results
With the stock 1.0.3 sp1 stack there are no exceptions thrown and no service endpoints registered when using the http://localhost:8080/jbossws/services
I then upgraded to the 2.0.2 stack and I get the following error during deployment:
java.lang.IllegalStateException: Cannot obtain wsdl location for: {http://posdataservices.possystems/}PosDataServicesService
After startup is complete I get the obligatory incomplete deployment message:
--- Incompletely deployed packages ---
org.jboss.deployment.DeploymentInfo@85514b6f { url=file:/usr/local/appserver/jboss/jboss-4.0.5.GA/server/default/deploy/ws.jar }
deployer: MBeanProxyExt[jboss.ejb3:service=EJB3Deployer]
status: Deployment FAILED reason: Cannot obtain wsdl location for: {http://posdataservices.possystems/}PosDataServicesService
state: FAILED
watch: file:/usr/local/appserver/jboss/jboss-4.0.5.GA/server/default/deploy/ws.jar
altDD: null
lastDeployed: 1196103088795
lastModified: 1196103088000
mbeans:
jboss.j2ee:jar=ws.jar,name=PosDataServices,service=EJB3 state: Started
The odd thing is that using 2.0.2, the endpoint gets registered and I can see it in the list of deployed web services under http://localhost:8080/jbossws/services but when I click on the link for the WSDL it throws the same error as at deploy time and returns a message to the browser about an xml error (jaxb I think) that there is no root element.
According to the docs the WSDL should autogenerate for me. The examples I have researched in the case of a provider all have hard WSDL files that are not autogenerated and use the location attribute of the @WebServiceProvider annotation. If autogeneration is not the case for a provider I believe I am to put it in the META-INF directory, correct? Also should I be deploying this in a war instead of a jar?
What am I missing?
One more thing to note. The EJB gets deployed in either case (1.0.3 and 2.0.2) and is available and usable as an EJB internally to applications in the container. I have not yet tested the remote interface for the EJB but I have no doubt it will probably work.
Thanks in advance
Andre
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4107880#4107880
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4107880
16 years, 6 months
[JBossWS] - Re: Webservice not starting in AS 4.2.2
by richard.opalka@jboss.com
| ...
| 20:43:03,655 INFO [TomcatDeployer] deploy, ctxPath=/jmx-console, warUrl=.../deploy/jmx-console.war/
| 20:43:04,665 INFO [Http11Protocol] Starting Coyote HTTP/1.1 on http-127.0.0.1-8080
| 20:43:04,975 INFO [AjpProtocol] Starting Coyote AJP/1.3 on ajp-127.0.0.1-8009
| 20:43:04,996 INFO [Server] JBoss (MX MicroKernel) [4.2.2.GA (build: SVNTag=JBoss_4_2_2_GA date=200711201921)] Started in 45s:236ms
| 20:44:15,086 INFO [JmxKernelAbstraction] creating wrapper delegate for: org.jboss.ejb3.stateless.StatelessContainer
| 20:44:15,102 INFO [JmxKernelAbstraction] installing MBean: jboss.j2ee:jar=test2.jar,name=HelloWorld,service=EJB3 with dependencies:
| 20:44:15,600 INFO [EJBContainer] STARTED EJB: org.jboss.test.ws.jaxws.jbws.HelloWorld ejbName: HelloWorld
| 20:44:15,784 INFO [EJB3Deployer] Deployed: file:/opt/svn/jbossas/tags/JBoss_4_2_2_GA/build/output/jboss-4.2.2.GA/server/default/deploy/test2.jar/
| 20:44:16,001 INFO [DefaultEndpointRegistry] register: jboss.ws:context=test2,endpoint=HelloWorld
| 20:44:19,366 INFO [WSDLFilePublisher] WSDL published to: file:/opt/svn/jbossas/tags/JBoss_4_2_2_GA/build/output/jboss-4.2.2.GA/server/default/data/wsdl/test2.jar/HelloWorld50713.wsdl
| 20:44:19,606 INFO [TomcatDeployer] deploy, ctxPath=/test2, warUrl=.../tmp/deploy/test2.jar50712.war
Richard
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4107868#4107868
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4107868
16 years, 6 months
[JBossWS] - Re: Webservice not starting in AS 4.2.2
by isthisusernameavailable
"richard.opalka(a)jboss.com" wrote : Hi,
|
| which version of JBossWS are you using? Just FYI there will be a new version of JBossWS 2.0.2 downloadable soon which is well tested on JBossAS 4.2.2. I suggest you to upgrade.
|
| Richard
Hi Richard,
I've upgraded to JBoss 4.2.2 and JbossWS 2.0.2, but I'm still seeing the same problem. Here's sample code that I'm using.
@Remote
| public interface IHelloWorld {
| public String hello();
| }
|
| @Stateless
| @Clustered(partition="DefaultPartition")
| @WebService(serviceName="HelloWorld")
| public class HelloWorld implements IHelloWorld {
| @WebMethod
| public String hello() {
| return "hello, world";
| }
| }
I'm creating a simple jar file with these two classes in it. When I copy this jar file to my deploy directory in JBoss 4.2.1/JBossws 1.2.1, I see this message:
WebService started: http://127.0.0.1:8080/HelloWorldService/HelloWorld
When I deploy it to JBoss 4.2.2/JBossws 2.0.2, I do not see this line, and the web service is not started.
Is there something I need to do to explicitly start the webservice in 4.2.2/2.0.2?
Thanks,
John
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4107839#4107839
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4107839
16 years, 6 months