[JBossWS] - the client can't invoke the service
by Bouchwichman
Hi everybody!
I'm following the JBossWS quick start (http://jbws.dyndns.org/mediawiki/index.php?title=Quick_Start), and i'm facing some weird errors.
Here is what i have done :
Server side
My implementation class :
package org.domain.proj_essai.ws;
|
| import javax.ejb.Stateless;
| import javax.jws.WebParam;
| import javax.jws.WebService;
| import javax.jws.WebMethod;
| import javax.jws.soap.SOAPBinding;
|
| @Stateless
| @WebService(
| name="SommeWS",
| targetNamespace = "http://ws.proj_essai.domain.org",
| serviceName = "SommeWSService")
| @SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.WRAPPED) public class SommeWS {
|
| @WebMethod
| public int additionner( int a, int b){
| return a + b;
| }
|
| @WebMethod
| public int soustraire( int a, int b){
| return a - b;
| }
|
| @WebMethod
| public String afficherBonjour() {
| return "Bonjour";
| }
|
| }
|
my WSDL location (generated automatically when deploying):
http://127.0.0.1:8080/SommeWSService/SommeWS?wsdl
Client side:
First, I generated all client classes with wsconsume :
wsconsume -k -p bsa.ws http://127.0.0.1:8080/SommeWSService/SommeWS?wsdl
|
it gave me the following files:
bsa\ws\Additionner.java
| bsa\ws\AdditionnerResponse.java
| bsa\ws\AfficherBonjour.java
| bsa\ws\AfficherBonjourResponse.java
| bsa\ws\ObjectFactory.java
| bsa\ws\SommeWS.java
| bsa\ws\SommeWSService.java
| bsa\ws\Soustraire.java
| bsa\ws\SoustraireResponse.java
| bsa\ws\package-info.java
| bsa\ws\Additionner.java
| bsa\ws\AdditionnerResponse.java
| bsa\ws\AfficherBonjour.java
| bsa\ws\AfficherBonjourResponse.java
| bsa\ws\ObjectFactory.java
| bsa\ws\SommeWS.java
| bsa\ws\SommeWSService.java
| bsa\ws\Soustraire.java
| bsa\ws\SoustraireResponse.java
| bsa\ws\package-info.java
|
| Then i try to invoke the service from a method (that works without the web service invoking part) :
| URL url = null;
| | try {
| | url = new URL("http://127.0.0.1:8080/SommeWSService/SommeWS?wsdl");
| | } catch (MalformedURLException e) {
| | e.printStackTrace();
| | }
| |
| | Logger.getRootLogger().info("---------------- FLAG1 ----------------");
| | Service service = Service.create( url,new QName("SommeWSService") );
| | //Service service = Service.create(url,new QName( "http://ws.proj_essai.domain.org", "SommeWSService") );
| |
| | Logger.getRootLogger().info("---------------- FLAG2 ----------------");
| | SommeWS s = service.getPort( SommeWS.class);
| |
| |
| | Logger.getRootLogger().info("------------------------- "+ s.afficherBonjour() +" -----------------------");
| |
|
| PROBLEM:
| i have the following exception:
| ...
| | Caused by: javax.xml.ws.WebServiceException: java.lang.IllegalArgumentException: Cannot obtain wsdl service: SommeWSService
| | ...
| | Caused by: java.lang.IllegalArgumentException: Cannot obtain wsdl service: SommeWSService
| | ...
| |
|
| Then, i modified the instruction in the FLAG1 zone by the commented one ( Service service = Service.create(url,new QName( "http://ws.proj_essai.domain.org", "SommeWSService") ); ) . It succeeds, but the FLAG2 instruction ( SommeWS s = service.getPort( SommeWS.class); ) brings me un error :
| ...
| | Caused by: java.lang.LinkageError: Class javax/xml/rpc/ParameterMode violates loader constraints
| | ...
| |
|
| Could you help me please? If you need more informations ask me.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4132434#4132434
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4132434
16 years, 8 months
[JBoss jBPM] - JBoss JBPM Question~~~!!
by sim912
Hi everyone,
I am using jboss 4.0.4, jwsdp 2.0 and jbpm-bpel 1.1 beta 3. I am developing a simple web service that return two values from a operation. I have created the bpel and wsdl file and ServiceImpl.java.
Inside ServiceImpl.java,
It contains only one operation get():
public void get(float a, float b, FloatHolder c, FloatHolder d) throws RemoteException{
}
--> this method it simple take in two float values and return the intake values back to the client.
In wsdl file:
<part name="a" type="xsd:flaot>
<part name="b" type="xsd:flaot>
<part name="c" type="xsd:flaot>
<part name="c" type="xsd:flaot>
.......
After i run ant build.xml in terminal, It compile and create the required file and then deploy to jboss server.
The generated endpoint interface is called ServicePT.java,
public interface ServicePT extends Remote{
public void get(float a, float b, FloatHolder c, FloatHolder d) throws RemoteException;
}
It can deploy successfully, but when the get() is invoked, there is an error.
In jboss server log, i found the following lines, it may be the reason to my problem.
OperationMetaData:
xmlName={http://example/test}get
javaName=get
style=rpc/literal
oneWay=false
soapAction=http://example/test
ParameterMetaData:
xmlName=a
xmlType={http://www.w3.org/2001/XMLSchema}float
javaType=java.lang.Float
mode=IN
inHeader=false
ParameterMetaData:
xmlName=b
xmlType={http://www.w3.org/2001/XMLSchema}float
javaType=java.lang.Float
mode=IN
inHeader=false
ReturnMetaData:
xmlName=d
xmlType={http://www.w3.org/2001/XMLSchema}float
javaType=java.lang.Float
mode=OUT
inHeader=false
I have spent few days to figure out why there is an error when returning two values.
Can anyone tell me how to fix it? And did anyone try to deploy a service to jboss server that return more than one values ?
Thanks a lot.
sim
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4132427#4132427
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4132427
16 years, 8 months
[Clustering/JBoss] - Re: Jboss 4.2.1 clustering bug ?
by islpe
The application is a war file and reads EDI files and applies these as updates to the database. There are few html pages where you can 'take the temperature' of the application, and it is on these pages that the error occurrs.
One difference between Jboss 3.2.2 and jboss 4.2.1 is the use of Avalon framework. This is in 4.2.1 placed in lib directory whereas it was not present in 3.2.2. Since Cocoon uses Avalon framework I had to use isolation(http://wiki.jboss.org/wiki/Wiki.jsp?page=ClassLoadingConfiguration, updated jboss-web.xml and this made the application run as it should in deploy directory under 4.2.1. Here are the scenarios I have tried. All have been deployed in deploy-hasingleton
1) Put the war file in deploy-hasingleton, as it is described in the Jboss Clustering Guide. The error occurred and this is shown in the log
Only the root deployment can set the loader repository, ignoring config=LoaderRepositoryConfig(repositoryName: jboss.dataintegration:war=dataintegration.war, repositoryClassName: org.jboss.mx.loading.HeirarchicalLoaderRepository3, configParserClassName: org.jboss.mx.loading.HeirarchicalLoaderRepository3ConfigParser, repositoryConfig: java2ParentDelegation=false)
but according to 'http://wiki.jboss.org/wiki/Wiki.jsp?page=GetWARNquotOnlyTheRootDeployment...', this can be ignored
2) Created a SAR and a jboss-service.xml with isolation and and an mbean containing HASingletonController. The same error occurred, but again this is shown in the log
Only the root deployment can set the loader repository, ignoring config=LoaderRepositoryConfig(repositoryName: jboss.dataintegration:sar=dataintegration.sar, repositoryClassName: org.jboss.mx.loading.HeirarchicalLoaderRepository3, configParserClassName: org.jboss.mx.loading.HeirarchicalLoaderRepository3ConfigParser, repositoryConfig: java2ParentDelegation=false)
for both sar and war
3) Created a SAR and a jboss-service.xml with isolation and and an mbean containing HASingletonController but this time the isolation in jboss-web.xml in the war file is removed. The same error occurred, but again this is shown in the log:
Only the root deployment can set the loader repository, ignoring config=LoaderRepositoryConfig(repositoryName: jboss.dataintegration:sar=dataintegration.sar, repositoryClassName: org.jboss.mx.loading.HeirarchicalLoaderRepository3, configParserClassName: org.jboss.mx.loading.HeirarchicalLoaderRepository3ConfigParser, repositoryConfig: java2ParentDelegation=false)
I think it is odd that each time the application is deployed in deploy-hasingleton and fails, the text about root deployment that can be ignored, is showing.
I used to think that this problem wa related to classpath, but I am not so sure
Lasse Petersen
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4132416#4132416
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4132416
16 years, 8 months