[JBossWS] - Re: Call a web service
by rodosa
Hello!!
I've get to call the web service from a Java application in Eclipse. I've solucionated the before error adding the library saaj-impl.jar.
Now I have a problem. I have jbpm-jpdl.3.2.2 installed in a remote machine.I would like to call this web service from here. But jbpm uses Jboss 4.0.4. I've added some libraries to the lib directory and I've copy the files that I've generated in the other machine (Jboss 4.2.2). I've modified the files replacing localhost with the IP where the webService exist. But it seems that it doesn't find the wsdl. I can do pings to my remote machine but if I put http://x.x.x.x:8080/proyecto/JbpmService?wsdl in the browser the system doesn't find anything.
| Exception in thread "main" javax.xml.ws.WebServiceException: Failed to access the WSDL at: http://x.x.x.x:8080/proyecto/JbpmService?wsdl. It failed with:
| Connection refused: connect.
| at com.sun.xml.ws.wsdl.parser.RuntimeWSDLParser.tryWithMex(RuntimeWSDLParser.java:136)
| at com.sun.xml.ws.wsdl.parser.RuntimeWSDLParser.parse(RuntimeWSDLParser.java:122)
| at com.sun.xml.ws.client.WSServiceDelegate.parseWSDL(WSServiceDelegate.java:226)
| at com.sun.xml.ws.client.WSServiceDelegate.<init>(WSServiceDelegate.java:189)
| at com.sun.xml.ws.client.WSServiceDelegate.<init>(WSServiceDelegate.java:159)
| at com.sun.xml.ws.spi.ProviderImpl.createServiceDelegate(ProviderImpl.java:81)
| at javax.xml.ws.Service.<init>(Service.java:56)
| at jbpmservice.ws.JbpmService_Service.<init>(JbpmService_Service.java:40)
| at client.JbpmWSClient.main(JbpmWSClient.java:15)
| Caused by: java.net.ConnectException: Connection refused: connect
| at java.net.PlainSocketImpl.socketConnect(Native Method)
| at java.net.PlainSocketImpl.doConnect(Unknown Source)
| at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
| at java.net.PlainSocketImpl.connect(Unknown Source)
| at java.net.Socket.connect(Unknown Source)
| at java.net.Socket.connect(Unknown Source)
| at sun.net.NetworkClient.doConnect(Unknown Source)
| at sun.net.www.http.HttpClient.openServer(Unknown Source)
| at sun.net.www.http.HttpClient.openServer(Unknown Source)
| at sun.net.www.http.HttpClient.<init>(Unknown Source)
| at sun.net.www.http.HttpClient.New(Unknown Source)
| at sun.net.www.http.HttpClient.New(Unknown Source)
| at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(Unknown Source)
| at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source)
| at sun.net.www.protocol.http.HttpURLConnection.connect(Unknown Source)
| at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
| at java.net.URL.openStream(Unknown Source)
| at com.sun.xml.ws.wsdl.parser.RuntimeWSDLParser.createReader(RuntimeWSDLParser.java:785)
| at com.sun.xml.ws.wsdl.parser.RuntimeWSDLParser.resolveWSDL(RuntimeWSDLParser.java:236)
| at com.sun.xml.ws.wsdl.parser.RuntimeWSDLParser.parse(RuntimeWSDLParser.java:107)
| ... 7 more
|
|
Any ideas?
Thanks
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4137396#4137396
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4137396
16 years, 9 months
[JBossWS] - Passing objects to JBoss Webservices
by paparaoa
Hello,
I have got a web method in my webservice as follows:
| @WebMethod
| public Hashtable<String,String> getPointValues(@WebParam(name="pointList") List<String> pointList)
| {
| Hashtable<String, String> pointValueList = new Hashtable<String, String>();
| for(int i=0;i<pointList.size();i++)
| {
| pointValueList.put(pointList.get(i),getValueForPoint(pointList.get(i)));
| }
| return pointValueList;
| }
|
I am making use of jboss remoting client to invoke the above method.
In the above method it takes argument as a list of string. I am forming a soap message and invoking the above method from my client as follows
Object response = remotingClient.invoke(soapmessage);
where the soap message is as follows:
| <soapenv:Envelope xmlns:obix="http://obixservice/obix" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
| <soapenv:Header/>
| <soapenv:Body>
| <obix:getPointValues>
| <pointList>P003</pointList>
| <pointList>P002</pointList>
| <pointList>P004</pointList>
| <pointList>P001</pointList>
| <pointList>P005</pointList>
| <pointList>P007</pointList>
| <pointList>P006</pointList>
| <pointList>P010</pointList>
| <pointList>P009</pointList>
| <pointList>P011</pointList>
| <pointList>P008</pointList>
| <pointList>P012</pointList>
| </obix:getPointValues>
| </soapenv:Body>
| </soapenv:Envelope>
|
the getPointValues method mentioned above is expected to return hashtable.
But its returning a string containing soap message.
How do i make this method return a hashtable ?
Thanks
R.Naik
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4137263#4137263
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4137263
16 years, 9 months
[JBossWS] - Re: org.jboss.ws.WSException
by anayak
I am posting the sample of the code.
Package and Import statements are removed.
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(propOrder = { "id" })
@XmlRootElement(name = "getMyRequest")
public class MyRequest {
private Long id;
public Long getId() { return id; }
public void setId(Long id) { this.id = id; }
}
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "", propOrder = { "name" })
@XmlRootElement(name = "getMyResponse")
public class MyResponse {
private String name;
public String getName() { return name; }
public void setName(String name) { this.name = name; }
}
@WebService(name = "MyFunctions")
public interface MyFunctions {
@WebMethod(operationName = "getName")
@WebResult(name = "name")
@RequestWrapper(localName = "getMyRequest", className = "com.test.services.server.MyRequest")
@ResponseWrapper(localName = "getMyResponse", className = "com.test.services.server.MyResponse")
public String getName(Long tourId);
}
@Stateless
@WebService(endpointInterface = "com.test.services.MyFunctions")
@TransactionAttribute(TransactionAttributeType.REQUIRED)
public class MyFunctionImpl implements MyFunctions {
public String getName(Long tourId) { return null; }
}
The following is the error I get.
I am using jboss 4.2.2 GA.
org.jboss.deployment.DeploymentException: Could not create deployment: file:/D:/Software/jboss/extracted/jboss-4.2.2.GA/server/hermes/deploy/temp.jar; - nested throwable: (org.jboss.ws.WSException: arg0 is not a valid property on class com.test.services.server.MyRequest)
at org.jboss.deployment.DeploymentException.rethrowAsDeploymentException(DeploymentException.java:53)
at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1050)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
at sun.reflect.GeneratedMethodAccessor20.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
at $Proxy9.deploy(Unknown Source)
at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421)
at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:634)
at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263)
at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:274)
at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:225)
Caused by: org.jboss.ws.WSException: arg0 is not a valid property on class com.test.services.server.MyRequest
at com.sun.xml.bind.v2.runtime.JAXBContextImpl.getElementPropertyAccessor(JAXBContextImpl.java:926)
at org.jboss.ws.metadata.acessor.JAXBAccessor$1$1.create(JAXBAccessor.java:75)
at org.jboss.ws.metadata.umdm.ParameterMetaData.eagerInitialize(ParameterMetaData.java:480)
at org.jboss.ws.metadata.umdm.OperationMetaData.eagerInitialize(OperationMetaData.java:458)
at org.jboss.ws.metadata.umdm.EndpointMetaData.eagerInitializeOperations(EndpointMetaData.java:533)
at org.jboss.ws.metadata.umdm.EndpointMetaData.initializeInternal(EndpointMetaData.java:519)
at org.jboss.ws.metadata.umdm.EndpointMetaData.eagerInitialize(EndpointMetaData.java:507)
at org.jboss.ws.metadata.umdm.ServiceMetaData.eagerInitialize(ServiceMetaData.java:429)
at org.jboss.ws.metadata.umdm.UnifiedMetaData.eagerInitialize(UnifiedMetaData.java:196)
at org.jboss.wsf.stack.jbws.EagerInitializeDeploymentAspect.create(EagerInitializeDeploymentAspect.java:50)
at org.jboss.wsf.framework.deployment.DeploymentAspectManagerImpl.deploy(DeploymentAspectManagerImpl.java:115)
at org.jboss.wsf.container.jboss42.ArchiveDeployerHook.deploy(ArchiveDeployerHook.java:97)
at org.jboss.wsf.container.jboss42.DeployerInterceptor.start(DeployerInterceptor.java:90)
at org.jboss.deployment.SubDeployerInterceptorSupport$XMBeanInterceptor.start(SubDeployerInterceptorSupport.java:188)
at org.jboss.deployment.SubDeployerInterceptor.invoke(SubDeployerInterceptor.java:95)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
at $Proxy34.start(Unknown Source)
at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
... 20 more
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4137186#4137186
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4137186
16 years, 9 months
[JBossWS] - Re: Call a web service
by rodosa
Hello!
Now I'm executing from Eclipse, because I'm building an .ear that contains a dinamic web project where the web service is inside. But I got the following error:
| Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/xml/messaging/saaj/soap/AttachmentPartImpl
| at com.sun.xml.ws.message.AttachmentUnmarshallerImpl.<clinit>(AttachmentUnmarshallerImpl.java:55)
| at com.sun.xml.ws.client.sei.ResponseBuilder$DocLit.readResponse(ResponseBuilder.java:500)
| at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:242)
| at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:210)
| at com.sun.xml.ws.client.sei.SEIStub.invoke(SEIStub.java:103)
| at $Proxy25.hola(Unknown Source)
| at client.JbpmWSClient.main(JbpmWSClient.java:95)
|
|
If I generate the jar and executing it with wsrunclient the following exception it's thrown (the library jboss-common-client.jar is in my path):
| Exception in thread "main" java.lang.NoClassDefFoundError: org/jboss/util/NotImplementedException
| at java.lang.Class.getDeclaredConstructors0(Native Method)
| at java.lang.Class.privateGetDeclaredConstructors(Class.java:2389)
| at java.lang.Class.getConstructor0(Class.java:2699)
| at java.lang.Class.newInstance0(Class.java:326)
| at java.lang.Class.newInstance(Class.java:308)
| at javax.xml.ws.spi.FactoryFinder.newInstance(FactoryFinder.java:36)
| at javax.xml.ws.spi.FactoryFinder.find(FactoryFinder.java:95)
| at javax.xml.ws.spi.Provider.provider(Provider.java:76)
| at javax.xml.ws.Service.<init>(Service.java:57)
| at client.JbpmServiceService.<init>(JbpmServiceService.java:42)
| at client.JbpmWSClient.main(JbpmWSClient.java:79)
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4137129#4137129
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4137129
16 years, 9 months