[JBossWS] - Re: Call a web service
by PeterJ
Yes, you use the files generated by wsconsume in your client. As an example, say you have a hello web service (I am not sowing all the code):
class Hello {
| public String sayHello(String name) {...}
| }
wsconsume will create an interface named Hello and a class named HelloService (and possibly other classes). The code for the client is:
public class Client {
| public static void main(String[] args) {
| HelloService svc = new HelloService();
| Hello hello = svc.getHelloPort();
| System.out.println(hello.sayHello(args[0]));
| }
| }
Compile the client with the classes generated by wsconsume, and package the client and the wsconsume classes info a jar file. Then use wsrunclient to run it:
wsrunclient -classpath client.jar Hello me
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4136757#4136757
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4136757
16 years, 9 months
[JBossWS] - Call a web service
by rodosa
Hello!
I'm new in JbossWS. I have been looking into the documentation but... I'm a bit lost. I've generated a web service that I can see at http://localhost:8080/jbossws/services. My problem is how I can access form a client application ... and if I have to produce something with wstools.
I notice that wsdl file is automaticaly created in data folder of Jboss 4.2.2. But what happens with wsconsume tools? I've executed and this created me several files. I have to use them to call my web service? or ... I have to do something similar to
| String urlstr = "http://127.0.0.1:8080/proyecto/JbpmService?wsdl";
|
| URL url = new URL(urlstr);
|
| QName qname = new QName("http://ws/",
| "JbpmService");
|
|
| ServiceFactory factory = ServiceFactory.newInstance();
| Service service = factory.createService(url, qname);
|
|
This second option doesn't works for me because the following exception is thrown:
| Exception in thread "main" java.lang.IllegalArgumentException: Cannot obtain wsdl service: {http://ws/}JbpmService
| at org.jboss.ws.metadata.builder.jaxrpc.JAXRPCClientMetaDataBuilder.buildMetaDataInternal(JAXRPCClientMetaDataBuilder.java:172)
| at org.jboss.ws.metadata.builder.jaxrpc.JAXRPCClientMetaDataBuilder.buildMetaData(JAXRPCClientMetaDataBuilder.java:134)
| at org.jboss.ws.metadata.builder.jaxrpc.JAXRPCClientMetaDataBuilder.buildMetaData(JAXRPCClientMetaDataBuilder.java:86)
| at org.jboss.ws.core.jaxrpc.client.ServiceImpl.<init>(ServiceImpl.java:111)
| at org.jboss.ws.core.jaxrpc.client.ServiceFactoryImpl.createService(ServiceFactoryImpl.java:157)
| at org.jboss.ws.core.jaxrpc.client.ServiceFactoryImpl.createService(ServiceFactoryImpl.java:128)
| at client.JbpmWSClient.main(JbpmWSClient.java:61)
|
how I could solucionate this problem?
Thanks
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4136702#4136702
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4136702
16 years, 9 months
[JBossWS] - Message faults not signed
by mimra
We have a project running on JBoss 4.2.0 (JBossWS 1.2.1.GA) which exposes an EJB3 web service like:
| @Stateless
| @WebService(wsdlLocation="META-INF/wsdl/LovWS.wsdl", targetNamespace = "http://rep.oio.dk/wmdata.dk/as2007/schemas/2006/11/20/")
| @SOAPBinding(style = SOAPBinding.Style.DOCUMENT)
| @HandlerChain(file = "resource://META-INF/ServerHandlers.xml", name = "SecureHandlerChain")
| @WebContext(contextRoot="/as2007/facade")
| public class LovWS extends WSBean {
| .
| .
| .
| @WebMethod()
| @WebResult(name="resultat")
| public LovType hentLov(@WebParam(name="Kode") String kode) throws WSException{
| if ("".equals(kode)){
| throw new WSException(165,"Kode argumentet er tomt");
| }
| .
| .
| .
| }
| }
|
Now if the request to the web service is successful, the response is singed as expected.
However, if any exception is thrown and a SOAP fault is returned, then the SOAP body is not signed.
Is this expected behavior? Is there any way to get JBossWS to also sign the SOAP faults?
Best regards
Michael
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4136642#4136642
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4136642
16 years, 9 months
[JBossWS] - Single API called twice after certain time
by rashmi_yes
Hi,
My Client is calling an web service API in remote machine. This API will take around 7 minutes to execute. But before completing the execution, the same API is called again after 5 minutes. But actually, the client is not calling the same API again. It had been called automatically.
When the first call completes execution, it is trying to return the result but throwing the below error & the value is not returned. But the second call(which was called automatically) completes & returns successfully.
Could anybody help me on this problem
thrown error in first call:
java.io.IOException: stream is closed
at sun.net.httpserver.Request$WriteStream.write(Request.java:378)
at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:65
)
at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:123)
at sun.net.httpserver.ExchangeImpl.sendResponseHeaders(ExchangeImpl.java
:192)
at sun.net.httpserver.HttpExchangeImpl.sendResponseHeaders(HttpExchangeI
mpl.java:68)
at com.sun.xml.internal.ws.transport.http.server.ServerConnectionImpl.ge
tOutput(ServerConnectionImpl.java:116)
at com.sun.xml.internal.ws.util.SOAPConnectionUtil.send(SOAPConnectionUt
il.java:106)
at com.sun.xml.internal.ws.util.SOAPConnectionUtil.sendResponse(SOAPConn
ectionUtil.java:115)
at com.sun.xml.internal.ws.protocol.soap.server.SOAPMessageDispatcher.se
ndResponse(SOAPMessageDispatcher.java:382)
at com.sun.xml.internal.ws.protocol.soap.server.SOAPMessageDispatcher.re
ceive(SOAPMessageDispatcher.java:159)
at com.sun.xml.internal.ws.server.Tie.handle(Tie.java:90)
at com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.process(W
SHttpHandler.java:173)
at com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handleExc
hange(WSHttpHandler.java:121)
at com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handle(WS
HttpHandler.java:97)
at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
at sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:65)
at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:68)
at sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(ServerImpl.
java:556)
at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
at sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:528)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExec
utor.java:885)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
.java:907)
at java.lang.Thread.run(Thread.java:619)
javax.xml.ws.WebServiceException: java.lang.NullPointerException
at com.sun.xml.internal.ws.util.SOAPConnectionUtil.send(SOAPConnectionUt
il.java:109)
at com.sun.xml.internal.ws.util.SOAPConnectionUtil.sendResponse(SOAPConn
ectionUtil.java:115)
at com.sun.xml.internal.ws.protocol.soap.server.SOAPMessageDispatcher.se
ndResponse(SOAPMessageDispatcher.java:382)
at com.sun.xml.internal.ws.protocol.soap.server.SOAPMessageDispatcher.re
ceive(SOAPMessageDispatcher.java:159)
at com.sun.xml.internal.ws.server.Tie.handle(Tie.java:90)
at com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.process(W
SHttpHandler.java:173)
at com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handleExc
hange(WSHttpHandler.java:121)
at com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handle(WS
HttpHandler.java:97)
at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
at sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:65)
at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:68)
at sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(ServerImpl.
java:556)
at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
at sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:528)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExec
utor.java:885)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
.java:907)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.NullPointerException
at com.sun.xml.internal.messaging.saaj.soap.MessageImpl.writeTo(MessageI
mpl.java:1219)
at com.sun.xml.internal.ws.util.SOAPConnectionUtil.send(SOAPConnectionUt
il.java:106)
... 16 more
Mar 13, 2008 6:41:14 PM com.sun.xml.internal.ws.protocol.soap.server.SOAPMessage
Dispatcher receive
SEVERE: java.lang.NullPointerException
javax.xml.ws.WebServiceException: java.lang.NullPointerException
at com.sun.xml.internal.ws.util.SOAPConnectionUtil.send(SOAPConnectionUt
il.java:109)
at com.sun.xml.internal.ws.util.SOAPConnectionUtil.sendResponse(SOAPConn
ectionUtil.java:115)
at com.sun.xml.internal.ws.protocol.soap.server.SOAPMessageDispatcher.se
ndResponse(SOAPMessageDispatcher.java:382)
at com.sun.xml.internal.ws.protocol.soap.server.SOAPMessageDispatcher.re
ceive(SOAPMessageDispatcher.java:159)
at com.sun.xml.internal.ws.server.Tie.handle(Tie.java:90)
at com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.process(W
SHttpHandler.java:173)
at com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handleExc
hange(WSHttpHandler.java:121)
at com.sun.xml.internal.ws.transport.http.server.WSHttpHandler.handle(WS
HttpHandler.java:97)
at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
at sun.net.httpserver.AuthFilter.doFilter(AuthFilter.java:65)
at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:68)
at sun.net.httpserver.ServerImpl$Exchange$LinkHandler.handle(ServerImpl.
java:556)
at com.sun.net.httpserver.Filter$Chain.doFilter(Filter.java:65)
at sun.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:528)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExec
utor.java:885)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
.java:907)
at java.lang.Thread.run(Thread.java:619)
Caused by: java.lang.NullPointerException
at com.sun.xml.internal.messaging.saaj.soap.MessageImpl.writeTo(MessageI
mpl.java:1219)
at com.sun.xml.internal.ws.util.SOAPConnectionUtil.send(SOAPConnectionUt
il.java:106)
... 16 more
Thanks,
Rashmi
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4136604#4136604
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4136604
16 years, 9 months