[JBossWS] - Re: Type Substitution doesn't work with Schema2Java Client a
by M_schumpa
hi again,
no one here who can help me with this issue?
Maybe my description of the problem is hard to understand. so I'll try to make it more clear.
First I have written a web service with a parameter and a return value.
the method is something like:
returnValue calculate (List<Car> carList){...}
The parameter is something like:
class car{...}
class cheep extends car{...}
class cabrio extends car{...}
so I added the @XmlSeeAlso ({cheep.class, cabrio.class}) annotation to the Car class.
I can now deploy the web service and the wsdl gets generated in a proper way.
The first thing I did to test the service was writting a simple client which creates a cheep and a cabrio instance and adds these two instances to a list and passes it to the web service. For this I used the classes I coded.
With this setup everything worked fine and the service was able to cast the list members to the proper type. So the type substitution worked well.
But I need the test the Schema2Java approach, too.
So I consumed the WSDL with wsconsume and the -t 2.1 switch.
I addopted the client to use the generated classes. But here the type substitution doesn't work. Only a list of car instances gets passed to the service.
Anybody here who has a clue on how to fix this problem?
Thanks in advance.
Greetings
m_schumpa
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4074455#4074455
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4074455
17 years, 4 months
[JBossWS] - Unable to priint the content of SOAPBody
by bossy
Hi,
I need to print the content of every request/response/fault that comes in or goes out from my JAX-RPC web service, that runs under JBoss 4.0.4.
I created a hadler that extends javax.xml.rpc.handler.GenericHandler. I can intercept every request / response / fault but I can't get the content of the SOAPBody as a text in the xml format.
This is what I've tried:
| public class mywsLogHandler extends GenericHandler
| {
|
| ........
| public boolean handleRequest(MessageContext ctx)
| {
| if (ctx instanceof SOAPMessageContext)
| {
| try
| {
| SOAPMessageContext context = (SOAPMessageContext)ctx;
| SOAPEnvelope env = context.getMessage().getSOAPPart().getEnvelope();
| SOAPBody body = env.getBody();
| System.out.println(body.getTextContent());
| }
| catch (SOAPException ex)
| { }
| }
| }
|
| ..................
| }
|
I was expecting to see something like :
| <soapenv:Envelope xmlns:myws='http://www.mycom.com/myws/'
| xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/'>
| <soapenv:Header/>
| <soapenv:Body>
| <myws:QueryRequest>
| <Element1>this is a test</Element1>
| </myws:QueryRequest>
| </soapenv:Body>
| </soapenv:Envelope>
|
being printen, but instead I get the following Rintime exception:
| 10:16:48,908 WARN [HandlerWrapper] RuntimeException in handler method, transition to DOES_NOT_EXIST
| 10:16:48,908 DEBUG [HandlerWrapper] destroy: com.mycom.myws.ws.handler.mywsLogHandler@125e791
| 10:16:50,268 ERROR [HandlerChainBaseImpl] RuntimeException in request handler
| org.jboss.util.NotImplementedException: getTextContent
| at org.jboss.ws.soap.NodeImpl.getTextContent(NodeImpl.java:622)
| at com.mycom.myws.ws.handler.mywsLogHandler.handleRequest(mywsLogHandler.java:72)
| at org.jboss.ws.handler.HandlerWrapper.handleRequest(HandlerWrapper.java:121)
| at org.jboss.ws.handler.HandlerChainBaseImpl.handleRequest(HandlerChainBaseImpl.java:254)
| at org.jboss.ws.handler.ServerHandlerChain.handleRequest(ServerHandlerChain.java:47)
| at org.jboss.ws.server.ServiceEndpointInvoker.callRequestHandlerChain(ServiceEndpointInvoker.java:211)
| at org.jboss.ws.server.ServiceEndpointInvoker.invoke(ServiceEndpointInvoker.java:104)
| at org.jboss.ws.server.ServiceEndpoint.handleRequest(ServiceEndpoint.java:234)
| at org.jboss.ws.server.ServiceEndpointServlet.doPost(ServiceEndpointServlet.java:120)
| at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
| 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.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(Unknown Source)
| 10:16:50,268 DEBUG [HandlerChainBaseImpl] Exit: handleRequest with status: false
| 10:16:50,283 DEBUG [SOAPFaultException] new SOAPFaultException [code={http://schemas.xmlsoap.org/soap/envelope/}Client,string=org.jboss.u...: getTextContent,actor=null,detail=null]
| 10:16:50,283 ERROR [SOAPFaultExceptionHelper] SOAP request exception
| org.jboss.util.NotImplementedException: getTextContent
| at org.jboss.ws.soap.NodeImpl.getTextContent(NodeImpl.java:622)
| at com.mycom.myws.ws.handler.mywsLogHandler.handleRequest(mywsLogHandler.java:72)
| at org.jboss.ws.handler.HandlerWrapper.handleRequest(HandlerWrapper.java:121)
| at org.jboss.ws.handler.HandlerChainBaseImpl.handleRequest(HandlerChainBaseImpl.java:254)
| at org.jboss.ws.handler.ServerHandlerChain.handleRequest(ServerHandlerChain.java:47)
| at org.jboss.ws.server.ServiceEndpointInvoker.callRequestHandlerChain(ServiceEndpointInvoker.java:211)
| at org.jboss.ws.server.ServiceEndpointInvoker.invoke(ServiceEndpointInvoker.java:104)
| at org.jboss.ws.server.ServiceEndpoint.handleRequest(ServiceEndpoint.java:234)
| at org.jboss.ws.server.ServiceEndpointServlet.doPost(ServiceEndpointServlet.java:120)
| at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
| 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.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(Unknown Source)
| 10:16:50,315 DEBUG [HandlerChainBaseImpl] Enter: handleFault
| 10:16:50,315 DEBUG [HandlerChainBaseImpl] Handle fault: [state=DOES_NOT_EXIST,handler=com.mycom.myws.ws.handler.mywsLogHandler@125e791]
| 10:16:50,315 WARN [HandlerWrapper] Handler is in state DOES_NOT_EXIST, skipping Handler.handleFault for: com.mycom.myws.ws.handler.mywsLogHandler@125e791
| 10:16:50,315 DEBUG [HandlerChainBaseImpl] Exit: handleFault with status: true
| 10:16:50,315 DEBUG [ServiceEndpoint] Outgoing SOAPMessage
| <env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'>
| <env:Header/>
| <env:Body>
| <env:Fault>
| <faultcode>env:Client</faultcode>
| <faultstring>org.jboss.util.NotImplementedException: getTextContent</faultstring>
| </env:Fault>
| </env:Body>
| </env:Envelope>
| 10:16:50,315 DEBUG [ServiceEndpoint] END handleRequest: jboss.ws:di=myws.war,service=mywsService,port=mywsSOAP
| 10:16:50,315 DEBUG [MessageContextAssociation] popMessageContext: org.jboss.ws.soap.SOAPMessageContextImpl@da2610
|
Could anybody, please, tell me why this isn't working, could this possibly be a bug?
Thanks.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4073899#4073899
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4073899
17 years, 4 months