[JBossWS] - Web services and stateful session
by jova73
Hi,
I'm working with JBoss 4.0.5 and the embedded JBoss Web Service support.
I have to expose as web services some functionalities of an existing J2EE application with stateful session management, i.e. I've a javax.ejb.Handle object which references my session and this handle must be passed to every method of the business logic EJBs.
Questions:
- how can I expose this Handle object to a web service client?
javax.ejb.Handle is not supported by JAX-RPC so I was considering serializing this object (e.g. base64 encoding). Is there any better method?
- I serialized my handle object to a file and it's less then 400 bytes: is that the average size of a serialized JBoss javax.ejb.Handle?
- is there any standard, implemented by JBoss 4.0.5, for a web service conversation?
I'd like to have my web service client making the following calls:
perform login
request one or more service (each one once or more times)
perform logout
Maybe I'm wrong but I think that my model doesn't fit in BPEL (I can't know in advance which and how many services a client will call between login() and logout())... Any suggestion?
Thanks in advance,
Andrea
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4010026#4010026
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4010026
17 years, 11 months
[JBossWS] - user error handling.
by DoubleDenim
does anyone have any techniques for handling user errors with webservices?
for example you have a web service that queries a database for records but no records are found (not a terribly good example, but lets pretend that no records could mean a number of different things)..
do you use a webservice fault (exception) to say that theres no records because...? or do you have the operation return a "response" type message that contains a nullable object for the records (if there is any) and a list of error messages if there isn't?
When i started creating webservices in java i would have just thrown a bunch of custom faults for my user error handling.. but faults come back in a soap response with a 500 Internal server error http header and this just doesn't seem right. Plus i've since been programming using VB in dotnet *vomits* and exceptions (which i see faults as) are used a little differently to the way they are in java, moreso for exceptional circumstances rather than handling possible expected outcomes.
So I'm really just wondering how you guys handle expected user errors/responses? Are there any recommended or standard patterns for ways to handle these circumstances?
thanks
d
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4009950#4009950
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4009950
17 years, 11 months
[JBossWS] - Re: JBossWS 1.2.0CR2 with JEMS 1.2 (and JBoss 4.0.5) fails
by Juergen.Zimmermann
So far the classpath issues are solved. Now I get this stacktrace:
2007-02-01 17:50:16,266 INFO [org.jboss.system.server.Server] JBoss (MX MicroKernel) [4.0.5.GA (build: CVSTag=Branch_4_0 date=200610162339)] Started in 42s:842ms
| 2007-02-01 17:50:34,873 DEBUG [org.jboss.ws.core.server.AbstractServiceEndpointServlet] doPost: /hska/KundenverwaltungService
| 2007-02-01 17:50:34,883 DEBUG [org.jboss.ws.core.soap.MessageContextAssociation] pushMessageContext: org.jboss.ws.core.jaxws.handler.SOAPMessageContextJAXWS@18c3efb (Thread http-0.0.0.0-8080-1)
| 2007-02-01 17:50:34,883 DEBUG [org.jboss.ws.core.server.ServiceEndpoint] BEGIN handleRequest: jboss.ws:context=hska/KundenverwaltungService,endpoint=KundenverwaltungService
| 2007-02-01 17:50:34,883 TRACE [org.jboss.ws.core.soap.MessageFactoryImpl] [authorization=Basic Mjoy]
| 2007-02-01 17:50:34,883 TRACE [org.jboss.ws.core.soap.MessageFactoryImpl] [soapaction=]
| 2007-02-01 17:50:34,883 TRACE [org.jboss.ws.core.soap.MessageFactoryImpl] [content-type=text/xml; charset="utf-8"]
| 2007-02-01 17:50:34,883 TRACE [org.jboss.ws.core.soap.MessageFactoryImpl] [accept=text/xml, multipart/related, text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2]
| 2007-02-01 17:50:34,883 TRACE [org.jboss.ws.core.soap.MessageFactoryImpl] [user-agent=Java/1.5.0_10]
| 2007-02-01 17:50:34,883 TRACE [org.jboss.ws.core.soap.MessageFactoryImpl] [host=localhost:8080]
| 2007-02-01 17:50:34,883 TRACE [org.jboss.ws.core.soap.MessageFactoryImpl] [connection=keep-alive]
| 2007-02-01 17:50:34,883 TRACE [org.jboss.ws.core.soap.MessageFactoryImpl] [content-length=202]
| 2007-02-01 17:50:34,903 DEBUG [org.jboss.ws.core.soap.MessageFactoryImpl] createMessage: [contentType=text/xml; charset=utf-8]
| 2007-02-01 17:50:34,903 TRACE [org.jboss.ws.core.soap.MessageFactoryImpl] createMessage
| <?xml version="1.0" ?><S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"><S:Body><ns2:findNachname xmlns:ns2="http://ws.hska.de"><long_1>71</long_1></ns2:findNachname></S:Body></S:Envelope>
| 2007-02-01 17:50:34,933 DEBUG [javax.xml.soap.MessageFactory] Load from Service API META-INF/services/javax.xml.soap.SOAPFactory: org.jboss.ws.core.soap.SOAPFactoryImpl
| 2007-02-01 17:50:34,933 TRACE [org.jboss.ws.core.utils.DOMUtils] createElement {http://schemas.xmlsoap.org/soap/envelope/}S:Envelope
| 2007-02-01 17:50:34,933 TRACE [org.jboss.ws.core.soap.SOAPElementImpl] new SOAPElementImpl: {http://schemas.xmlsoap.org/soap/envelope/}Envelope
| 2007-02-01 17:50:34,933 TRACE [org.jboss.ws.core.soap.SOAPElementImpl] new SOAPElementImpl: {http://schemas.xmlsoap.org/soap/envelope/}Envelope
| 2007-02-01 17:50:34,933 TRACE [org.jboss.ws.core.soap.SOAPElementImpl] addNamespaceDeclaration: xmlns:S='http://schemas.xmlsoap.org/soap/envelope/'
| 2007-02-01 17:50:34,933 TRACE [org.jboss.ws.core.utils.DOMUtils] createElement {http://schemas.xmlsoap.org/soap/envelope/}S:Header
| 2007-02-01 17:50:34,933 TRACE [org.jboss.ws.core.soap.SOAPElementImpl] new SOAPElementImpl: {http://schemas.xmlsoap.org/soap/envelope/}Header
| 2007-02-01 17:50:34,933 TRACE [org.jboss.ws.core.soap.SOAPElementImpl] addChildElement: {http://schemas.xmlsoap.org/soap/envelope/}Envelope -> {http://schemas.xmlsoap.org/soap/envelope/}Header
| 2007-02-01 17:50:34,933 TRACE [org.jboss.ws.core.utils.DOMUtils] createElement {http://schemas.xmlsoap.org/soap/envelope/}S:Body
| 2007-02-01 17:50:34,933 TRACE [org.jboss.ws.core.soap.SOAPElementImpl] new SOAPElementImpl: {http://schemas.xmlsoap.org/soap/envelope/}Body
| 2007-02-01 17:50:34,933 TRACE [org.jboss.ws.core.soap.SOAPElementImpl] addChildElement: {http://schemas.xmlsoap.org/soap/envelope/}Envelope -> {http://schemas.xmlsoap.org/soap/envelope/}Body
| 2007-02-01 17:50:34,943 TRACE [org.jboss.ws.core.utils.DOMUtils] createElement {http://ws.hska.de}ns2:findNachname
| 2007-02-01 17:50:34,943 TRACE [org.jboss.ws.core.soap.SOAPElementImpl] new SOAPElementImpl: {http://ws.hska.de}findNachname
| 2007-02-01 17:50:34,943 TRACE [org.jboss.ws.core.soap.SOAPBodyImpl] addChildElement: {http://ws.hska.de}findNachname
| 2007-02-01 17:50:34,943 TRACE [org.jboss.ws.core.soap.SOAPElementImpl] addChildElement: {http://schemas.xmlsoap.org/soap/envelope/}Body -> {http://ws.hska.de}findNachname
| 2007-02-01 17:50:34,943 TRACE [org.jboss.ws.core.soap.SOAPBodyImpl] appendChild: ns2:findNachname
| 2007-02-01 17:50:34,943 TRACE [org.jboss.ws.core.soap.SOAPElementImpl] addNamespaceDeclaration: xmlns:ns2='http://ws.hska.de'
| 2007-02-01 17:50:34,943 TRACE [org.jboss.ws.core.utils.DOMUtils] createElement {}long_1
| 2007-02-01 17:50:34,943 TRACE [org.jboss.ws.core.soap.SOAPElementImpl] new SOAPElementImpl: long_1
| 2007-02-01 17:50:34,943 TRACE [org.jboss.ws.core.soap.SOAPElementImpl] addChildElement: {http://ws.hska.de}findNachname -> long_1
| 2007-02-01 17:50:34,943 TRACE [org.jboss.ws.core.utils.DOMUtils] Ignore attribute: [uri=null,qname=xmlns,value=]
| 2007-02-01 17:50:34,943 DEBUG [org.jboss.ws.core.soap.SOAPContentElement] setXMLFragment: <long_1 xmlns=''>71</long_1>
| 2007-02-01 17:50:34,943 TRACE [org.jboss.ws.core.soap.SOAPContentElement] removeContentsAsIs
| 2007-02-01 17:50:34,943 TRACE [org.jboss.ws.core.soap.SOAPElementImpl] removeContents
| 2007-02-01 17:50:34,943 TRACE [org.jboss.ws.core.soap.SOAPContentElement] getChildElements
| 2007-02-01 17:50:34,943 TRACE [org.jboss.ws.core.soap.SOAPContentElement] getChildNodes
| 2007-02-01 17:50:34,943 TRACE [org.jboss.ws.core.soap.SOAPContentElement] resetElementContent
| 2007-02-01 17:50:34,943 TRACE [org.jboss.ws.core.soap.SOAPContentElement] invalidateDOMContent
| 2007-02-01 17:50:34,943 TRACE [org.jboss.ws.core.soap.SOAPContentElement] invalidateObjectContent
| 2007-02-01 17:50:34,943 TRACE [org.jboss.ws.core.soap.SOAPContentElement] invalidateXMLContent
| 2007-02-01 17:50:34,943 TRACE [org.jboss.ws.core.soap.SOAPContentElement] invalidateDOMContent
| 2007-02-01 17:50:34,943 TRACE [org.jboss.ws.core.soap.SOAPContentElement] invalidateObjectContent
| 2007-02-01 17:50:34,943 DEBUG [org.jboss.ws.core.jaxws.handler.HandlerDelegateJAXWS] callRequestHandlerChain: PRE
| 2007-02-01 17:50:34,943 DEBUG [org.jboss.ws.core.jaxws.handler.HandlerResolverImpl] initHandlerChain: PRE
| 2007-02-01 17:50:34,943 DEBUG [org.jboss.ws.core.jaxws.handler.HandlerResolverImpl] initHandlerChain: ENDPOINT
| 2007-02-01 17:50:34,943 DEBUG [org.jboss.ws.core.jaxws.handler.HandlerResolverImpl] initHandlerChain: POST
| 2007-02-01 17:50:34,943 DEBUG [org.jboss.ws.core.jaxws.handler.HandlerResolverImpl] getHandlerChain: [service={http://ws.hska.de}KundenverwaltungService,port={http://ws.hska.d...]
| 2007-02-01 17:50:34,953 DEBUG [org.jboss.ws.core.jaxws.handler.HandlerChainExecutor] Create a handler executor: []
| 2007-02-01 17:50:34,953 TRACE [org.jboss.ws.core.soap.SOAPBodyImpl] getChildElements
| 2007-02-01 17:50:34,953 TRACE [org.jboss.ws.core.soap.SOAPBodyImpl] getChildNodes
| 2007-02-01 17:50:34,953 DEBUG [org.jboss.ws.core.soap.SOAPMessageDispatcher] getDispatchDestination: {http://ws.hska.de}findNachname
| 2007-02-01 17:50:34,953 DEBUG [org.jboss.ws.core.jaxws.binding.SOAP11BindingJAXWS] unbindRequestMessage: {http://ws.hska.de}findNachname
| 2007-02-01 17:50:34,953 TRACE [org.jboss.ws.core.soap.SOAPBodyImpl] getChildElements
| 2007-02-01 17:50:34,953 TRACE [org.jboss.ws.core.soap.SOAPBodyImpl] getChildNodes
| 2007-02-01 17:50:34,963 ERROR [org.jboss.ws.core.jaxws.SOAPFaultHelperJAXWS] SOAP request exception
| org.jboss.ws.WSException: Cannot find child element: arg0
| at org.jboss.ws.core.CommonSOAPBinding.getParameterFromMessage(CommonSOAPBinding.java:749)
| at org.jboss.ws.core.CommonSOAPBinding.unbindRequestMessage(CommonSOAPBinding.java:265)
| at org.jboss.ws.core.server.AbstractServiceEndpointInvoker.invoke(AbstractServiceEndpointInvoker.java:147)
| at org.jboss.ws.core.server.ServiceEndpoint.handleRequest(ServiceEndpoint.java:203)
| at org.jboss.ws.core.server.ServiceEndpointManager.processSOAPRequest(ServiceEndpointManager.java:383)
| at org.jboss.ws.core.server.AbstractServiceEndpointServlet.doPost(AbstractServiceEndpointServlet.java:114)
| at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
| at org.jboss.ws.core.server.AbstractServiceEndpointServlet.service(AbstractServiceEndpointServlet.java:75)
| at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
| at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
| at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
| at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
| at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
| at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:524)
| at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
| at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
| at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
| at org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
| at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
| at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
| at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
| at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
| at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
| at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
| at java.lang.Thread.run(Thread.java:595)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4009561#4009561
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4009561
17 years, 11 months