[JBossWS] - SOAP header not being set as request param
by griff7023
I am having trouble migrating a WS from JAX-WS RI 2.0/JBoss 4.0.5.GA to JBossWS/JBoss 4.2.0.GA.
The WS starts ok and I can connect a client but the request and response headers are always null.
For example, I have an operation SubmitBasket which is defined as follows:
| @WebMethod(operationName = "SubmitBasket")
| @WebResult(name = "receipt", targetNamespace = "http://www.m-bar-go.com", partName = "response")
| public Receipt submitBasket(
| @WebParam(name = "header", targetNamespace = "http://www.m-bar-go.com", header = true)
| Header inboundHeader,
| @WebParam(name = "header", targetNamespace = "http://www.m-bar-go.com", header = true, mode = WebParam.Mode.OUT)
| Holder<Header> outboundHeader,
| @WebParam(name = "basket", targetNamespace = "http://www.m-bar-go.com", partName = "request")
| Basket request) throws BadBasketFault, BadRequestFault;
|
But when I try to access either the inboundHeader or outboundHeader params they are both null.
Looking in the log I can see the following:
| 2007-06-01 16:43:40,864 TRACE [org.jboss.ws.core.soap.MessageFactoryImpl] [user-agent=Java/1.5.0_06]
| 2007-06-01 16:43:40,864 TRACE [org.jboss.ws.core.soap.MessageFactoryImpl] [host=127.0.0.1:8080]
| 2007-06-01 16:43:40,864 TRACE [org.jboss.ws.core.soap.MessageFactoryImpl] [connection=keep-alive]
| 2007-06-01 16:43:40,864 TRACE [org.jboss.ws.core.soap.MessageFactoryImpl] [content-length=540]
| 2007-06-01 16:43:40,864 DEBUG [org.jboss.ws.core.soap.MessageFactoryImpl] createMessage: [contentType=text/xml; charset=utf-8]
| 2007-06-01 16:43:40,864 TRACE [org.jboss.ws.core.soap.MessageFactoryImpl] createMessage
| <?xml version="1.0" ?><S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"><S:Header><header xmlns="http://www.m-bar-go.com"><uid>01156986742242df80c7a68036a39aaf</uid></header></S:Header><S:Body><basket xmlns="http://www.m-bar-go.com"><scheme-name>test</scheme-name><customer-id>05000005</customer-id><store-id>501</store-id><type>sale</type><basket><item><product-id>05010103</product-id></item><item><product-id>05010202</product-id></item><item><product-id>05010301</product-id></item></basket></basket></S:Body></S:Envelope>
| 2007-06-01 16:43:40,864 TRACE [org.jboss.ws.core.utils.DOMUtils] createElement {http://schemas.xmlsoap.org/soap/envelope/}S:Envelope
| 2007-06-01 16:43:40,864 TRACE [org.jboss.ws.core.soap.SOAPElementImpl] new SOAPElementImpl: {http://schemas.xmlsoap.org/soap/envelope/}Envelope
| 2007-06-01 16:43:40,864 TRACE [org.jboss.ws.core.soap.SOAPElementImpl] new SOAPElementImpl: {http://schemas.xmlsoap.org/soap/envelope/}Envelope
| 2007-06-01 16:43:40,864 TRACE [org.jboss.ws.core.soap.SOAPElementImpl] addNamespaceDeclaration: xmlns:S='http://schemas.xmlsoap.org/soap/envelope/'
| 2007-06-01 16:43:40,864 TRACE [org.jboss.ws.core.utils.DOMUtils] createElement {http://schemas.xmlsoap.org/soap/envelope/}S:Header
| 2007-06-01 16:43:40,864 TRACE [org.jboss.ws.core.soap.SOAPElementImpl] new SOAPElementImpl: {http://schemas.xmlsoap.org/soap/envelope/}Header
| 2007-06-01 16:43:40,864 TRACE [org.jboss.ws.core.soap.SOAPElementImpl] addChildElement: {http://schemas.xmlsoap.org/soap/envelope/}Envelope -> {http://schemas.xmlsoap.org/soap/envelope/}Header
| 2007-06-01 16:43:40,864 TRACE [org.jboss.ws.core.utils.DOMUtils] createElement {http://schemas.xmlsoap.org/soap/envelope/}S:Body
| 2007-06-01 16:43:40,864 TRACE [org.jboss.ws.core.soap.SOAPElementImpl] new SOAPElementImpl: {http://schemas.xmlsoap.org/soap/envelope/}Body
| 2007-06-01 16:43:40,864 TRACE [org.jboss.ws.core.soap.SOAPElementImpl] addChildElement: {http://schemas.xmlsoap.org/soap/envelope/}Envelope -> {http://schemas.xmlsoap.org/soap/envelope/}Body
| 2007-06-01 16:43:40,864 TRACE [org.jboss.ws.core.utils.DOMUtils] createElement {http://www.m-bar-go.com}header
| 2007-06-01 16:43:40,864 TRACE [org.jboss.ws.core.soap.SOAPElementImpl] new SOAPElementImpl: {http://www.m-bar-go.com}header
| 2007-06-01 16:43:40,864 TRACE [org.jboss.ws.core.soap.SOAPElementImpl] addChildElement: {http://schemas.xmlsoap.org/soap/envelope/}Header -> {http://www.m-bar-go.com}header
| 2007-06-01 16:43:40,864 TRACE [org.jboss.ws.core.soap.SOAPContentElement] setAttribute: [nsURI=http://www.w3.org/2000/xmlns/,name=xmlns,value=http://www.m-bar-go.com]
| 2007-06-01 16:43:40,864 TRACE [org.jboss.ws.core.soap.SOAPElementImpl] removeContents
| 2007-06-01 16:43:40,864 TRACE [org.jboss.ws.core.utils.DOMUtils] createElement {http://www.m-bar-go.com}basket
| 2007-06-01 16:43:40,864 TRACE [org.jboss.ws.core.soap.SOAPElementImpl] new SOAPElementImpl: {http://www.m-bar-go.com}basket
| 2007-06-01 16:43:40,864 TRACE [org.jboss.ws.core.soap.SOAPBodyImpl] addChildElement: {http://www.m-bar-go.com}basket
| 2007-06-01 16:43:40,864 TRACE [org.jboss.ws.core.soap.SOAPElementImpl] addChildElement: {http://schemas.xmlsoap.org/soap/envelope/}Body -> {http://www.m-bar-go.com}basket
| 2007-06-01 16:43:40,864 TRACE [org.jboss.ws.core.soap.SOAPBodyImpl] appendChild: basket
| 2007-06-01 16:43:40,864 TRACE [org.jboss.ws.core.soap.SOAPContentElement] setAttribute: [nsURI=http://www.w3.org/2000/xmlns/,name=xmlns,value=http://www.m-bar-go.com]
| 2007-06-01 16:43:40,864 TRACE [org.jboss.ws.core.MessageTrace] Incoming Request Message
| <S:Envelope xmlns:S='http://schemas.xmlsoap.org/soap/envelope/'>
| <S:Header>
| <header xmlns='http://www.m-bar-go.com'>
| <uid>01156986742242df80c7a68036a39aaf</uid>
| </header>
| </S:Header>
| <S:Body>
| <basket xmlns='http://www.m-bar-go.com'>
| <scheme-name>test</scheme-name>
| <customer-id>05000005</customer-id>
| <store-id>501</store-id>
| <type>sale</type>
| <basket>
| <item>
| <product-id>05010103</product-id>
| </item>
| <item>
| <product-id>05010202</product-id>
| </item>
| <item>
| <product-id>05010301</product-id>
| </item>
| </basket>
| </basket>
| </S:Body>
| </S:Envelope>
| 2007-06-01 16:43:40,864 TRACE [org.jboss.ws.core.CommonMessageContext] put: APPLICATION:javax.xml.ws.binding.attachments.inbound={}
| 2007-06-01 16:43:40,864 DEBUG [org.jboss.ws.core.jaxws.handler.HandlerDelegateJAXWS] callRequestHandlerChain: POST
| 2007-06-01 16:43:40,864 DEBUG [org.jboss.ws.core.jaxws.handler.HandlerResolverImpl] getHandlerChain: [type=POST,info=[service={http://www.m-bar-go.com}MbargoPayPointImplServic...]
| 2007-06-01 16:43:40,864 DEBUG [org.jboss.ws.core.jaxws.handler.HandlerChainExecutor] Create a handler executor: []
| 2007-06-01 16:43:40,864 TRACE [org.jboss.ws.core.CommonMessageContext] get(javax.xml.ws.handler.message.outbound): APPLICATION:javax.xml.ws.handler.message.outbound=false
| 2007-06-01 16:43:40,864 TRACE [org.jboss.ws.core.CommonMessageContext] get(javax.xml.ws.addressing.context.inbound): null
| 2007-06-01 16:43:40,864 DEBUG [org.jboss.ws.core.soap.SOAPMessageDispatcher] getDispatchDestination: {http://www.m-bar-go.com}SubmitBasket
| 2007-06-01 16:43:40,864 DEBUG [org.jboss.ws.core.jaxws.binding.SOAP11BindingJAXWS] unbindRequestMessage: {http://www.m-bar-go.com}SubmitBasket
| 2007-06-01 16:43:40,864 DEBUG [org.jboss.ws.core.EndpointInvocation] setRequestParamValue: [name={http://www.m-bar-go.com}header,value=org.jboss.ws.core.soap.SOAPHeaderElementImpl]
| 2007-06-01 16:43:40,864 DEBUG [org.jboss.ws.core.EndpointInvocation] setRequestParamValue: [name={http://www.m-bar-go.com}header,value=null]
| 2007-06-01 16:43:40,864 DEBUG [org.jboss.ws.core.EndpointInvocation] setRequestParamValue: [name={http://www.m-bar-go.com}basket,value=org.jboss.ws.core.soap.SOAPBodyElementDoc]
| 2007-06-01 16:43:40,864 DEBUG [org.jboss.ws.core.jaxws.handler.HandlerDelegateJAXWS] callRequestHandlerChain: ENDPOINT
| 2007-06-01 16:43:40,864 DEBUG [org.jboss.ws.core.jaxws.handler.HandlerResolverImpl] getHandlerChain: [type=ENDPOINT,info=[service={http://www.m-bar-go.com}MbargoPayPointImplSe...]
| 2007-06-01 16:43:40,864 DEBUG [org.jboss.ws.core.jaxws.handler.HandlerChainExecutor] Create a handler executor: []
| 2007-06-01 16:43:40,864 TRACE [org.jboss.ws.core.CommonMessageContext] get(javax.xml.ws.handler.message.outbound): APPLICATION:javax.xml.ws.handler.message.outbound=false
| 2007-06-01 16:43:40,864 DEBUG [org.jboss.ws.core.jaxws.handler.HandlerDelegateJAXWS] callRequestHandlerChain: PRE
| 2007-06-01 16:43:40,864 DEBUG [org.jboss.ws.core.jaxws.handler.HandlerResolverImpl] getHandlerChain: [type=PRE,info=[service={http://www.m-bar-go.com}MbargoPayPointImplService...]
| 2007-06-01 16:43:40,864 DEBUG [org.jboss.ws.core.jaxws.handler.HandlerChainExecutor] Create a handler executor: []
| 2007-06-01 16:43:40,880 TRACE [org.jboss.ws.core.CommonMessageContext] get(javax.xml.ws.handler.message.outbound): APPLICATION:javax.xml.ws.handler.message.outbound=false
| 2007-06-01 16:43:40,880 TRACE [org.jboss.ws.core.CommonMessageContext] put: APPLICATION:org.jboss.ws.allow.expand.dom=true
| 2007-06-01 16:43:40,880 DEBUG [org.jboss.ws.core.server.ServiceEndpointInvokerJSE] invokeServiceEndpoint: submitBasket
| 2007-06-01 16:43:40,880 TRACE [org.jboss.ws.core.CommonMessageContext] get(javax.xml.ws.servlet.request): APPLICATION:javax.xml.ws.servlet.request=org.apache.catalina.connector.RequestFacade@14f1c67
| 2007-06-01 16:43:40,880 DEBUG [org.jboss.ws.core.EndpointInvocation] getRequestPayload
| 2007-06-01 16:43:40,880 DEBUG [org.jboss.ws.core.EndpointInvocation] getRequestParamValue: {http://www.m-bar-go.com}header
| 2007-06-01 16:43:40,880 DEBUG [org.jboss.ws.core.EndpointInvocation] transformPayloadValue: null -> null
| 2007-06-01 16:43:40,880 DEBUG [org.jboss.ws.core.EndpointInvocation] syncEndpointInputParam: null -> null(0)
| 2007-06-01 16:43:40,880 DEBUG [org.jboss.ws.core.EndpointInvocation] getRequestParamValue: {http://www.m-bar-go.com}basket
| 2007-06-01 16:43:40,880 DEBUG [org.jboss.ws.core.soap.SOAPContentElement] -----------------------------------
| 2007-06-01 16:43:40,880 DEBUG [org.jboss.ws.core.soap.SOAPContentElement] Transitioning from XML_VALID to OBJECT_VALID
| 2007-06-01 16:43:40,880 DEBUG [org.jboss.ws.core.soap.XMLContent] getObjectValue [xmlType={http://www.m-bar-go.com}>basket,javaType=class com.thelightagency.mbargo.ws.lightweight.paypoint.Basket]
| 2007-06-01 16:43:40,880 DEBUG [org.jboss.ws.core.jaxws.JAXBDeserializer] deserialize: [xmlName={http://www.m-bar-go.com}basket,xmlType={http://www.m-bar-go.com}>basket]
| 2007-06-01 16:43:40,880 DEBUG [org.jboss.ws.core.jaxws.JAXBDeserializer] deserialized: com.thelightagency.mbargo.ws.lightweight.paypoint.Basket
| 2007-06-01 16:43:40,880 DEBUG [org.jboss.ws.core.soap.XMLContent] objectValue: com.thelightagency.mbargo.ws.lightweight.paypoint.Basket
| 2007-06-01 16:43:40,880 DEBUG [org.jboss.ws.core.soap.SOAPContentElement] -----------------------------------
| 2007-06-01 16:43:40,880 DEBUG [org.jboss.ws.core.EndpointInvocation] transformPayloadValue: org.jboss.ws.core.soap.SOAPBodyElementDoc -> com.thelightagency.mbargo.ws.lightweight.paypoint.Basket
| 2007-06-01 16:43:40,880 DEBUG [org.jboss.ws.core.EndpointInvocation] syncEndpointInputParam: com.thelightagency.mbargo.ws.lightweight.paypoint.Basket -> com.thelightagency.mbargo.ws.lightweight.paypoint.Basket(2)
|
As you can see the message on the wire has a header but for some reason it is reported as null during the unbind.
Any ideas?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4050554#4050554
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4050554
18Â years, 10Â months
[Beginners Corner] - invoking an EJB over iiop
by HibsMax
Hi, folks.
I've tried a couple of other forums with this issue but no traction, so here I am to tickle your brains. :)
I have a servlet that makes calls to an EJB on another server using iiop. I've been trying for days but I still cannot get it to work. My current issue is that when I access the servlet it gets an initial context and performs a lookup for the EJB which returns this:
12:23:00,104 ERROR [STDERR] java.lang.ClassCastException
12:23:00,104 ERROR [STDERR] at com.sun.corba.se.impl.javax.rmi.PortableRemoteObject.narrow(PortableRemoteObject.java:229)
For my INITIAL_CONTEXT_FACTORY I am using:
org.jboss.iiop.naming.ORBInitialContextFactory
This is the same class as I am specifying in my server's jndi.properties.
Here are the steps being taken by the servlet:
1. create a Properties object
2. put the initial context factory class name i.e. org.jboss.iiop.naming.ORBInitialContextFactory
3. put URL of the server where the EJB lives i.e. iiop:/server:3528
4. create a new InitialContext using the above Properties object.
5. once I have the InitialContext, I perform a lookup using the EJB name i.e. "iiop://my.EJBHome"
6. I added a debug statement to the code and note that the Object returned by the lookup is : com.sun.jndi.cosnaming.CNCtx
My understanding is that the EJB JAR doesn't need any stubs, etc. they are supposed to be created on at runtime. So I must be doing something wrong but I dont' know what. I also understand that JBoss iiop is supposed to be enabled when you use the all configuration which is what I am using. I don't know of any additional configuration changes that need to be made, if any. This type of work is new to me, I don't have experience with EJBs on any other application server platform to fall back on. Can anyone suggest any know traps that a newbie might fall into? My clientside WAR file does not contain the EJB classes, just the interfaces (I found that problem in another thread). I can't find a lab or tutorial for this on JBoss 4.2 GA so I have no reference. I can't find an answer on google and the books I have (O'Reilly and JBoss admin guide) don't discuss this topic.
peace, Anders
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4050552#4050552
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4050552
18Â years, 10Â months
[JBoss jBPM] - Re: Deployment error using Eclipse GPD plugin (3.0.12) on jb
by NinjaCross
"kukeltje" wrote : please search the forum (e.g. using google or the blue search with the magnifying glass above) first for issues like this. Has been addressed previously
.... yeah, so hilarious... :)
Obvioulsy I've already searched for a while both on the forum, on Google and on the jBPM documentations, but only a few threads where related to my specific execution context.
I'm not an expert Java programmer, and neither a JBoss guru, so it's possible that I'm not using the right search keys.
Plz be patient if my questions seems a little bit obvious :)
I.E.:
Wed Sep 6, 2006
http://www.jboss.com/index.html?module=bb&op=viewtopic&t=88410
It's so old and no solutions where proposed, maybe because it's the first occurrency of this problem.
Fri May 18 2007
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4046712#4046712
You answered:
"Realy ancient, and should not occur http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3951967#3951967"
.. but unfortunately the proposed solution doesn't seem to work for me.
I've already reinstalled twice Eclipse, jBPM and the GPD plugin following the documentations, but nothing different happened.
Can you plz address me to alternative solutions other than the ones I've just mentioned ?
Thanks in advance for your help.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4050542#4050542
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4050542
18Â years, 10Â months
[JBoss AOP] - NullPointerException problem and no trace of the interceptor
by laurentSalse
Hi M. KAHN,
It's still me.
As you may understand, I'm a beginner in programmation. I've test the example "injboss".
There's no deployement of the AOP. The result is :
17:28:54,718 INFO [STDOUT] **** BasicExampleServlet.service()
17:28:54,718 INFO [STDOUT] **** ExampleValue String Constructor
17:28:54,718 INFO [STDOUT] **** ExampleValue.getMessage()
There no trace of the interceptor.
Otherwise, for my project, I've deleted JBoss server and re-install it.
I've re-loaded a clean project on svn.
I've verified that I've the good version of JBoss AOP. I've added the good libraries (JBoss AOP 1.5.5 version) in the project
I haven't convert the project to an AOP project.
I put : true
and in the run.bat file as usual: set JAVA_OPTS=%JAVA_OPTS% -Dprogram.name=%PROGNAME% -javaagent:pluggable-instrumentor.jar
In fact I've followed the advice of the "10.3.3. JBoss 4.x and JDK 5" part in the reference document and I've read carefully the JBoss forum.
I haven't found any either explanations for an AOP project which run on a JBoss server.
When I apply the javap command on the target file, there's no org.jboss.aop.Advised implementation.
I give you the console error :
--- MBeans waiting for other MBeans ---
ObjectName: jboss.aop:service=AspectManager
State: FAILED
Reason: java.lang.NullPointerException
--- MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM ---
ObjectName: jboss.aop:service=AspectManager
State: FAILED
Reason: java.lang.NullPointerException
(When I execute the run.bat of the server, there's no errors but there's still no trace of the interceptor)
I give you the interceptor code :
package com.fitnetapplication.aop.interceptors;
import org.apache.log4j.Logger;
import org.jboss.aop.advice.Interceptor;
import org.jboss.aop.joinpoint.ConstructorInvocation;
import org.jboss.aop.joinpoint.FieldInvocation;
import org.jboss.aop.joinpoint.Invocation;
import org.jboss.aop.joinpoint.MethodInvocation;
public class LoggerInterceptor implements Interceptor{
private static Logger log = Logger.getLogger(LoggerInterceptor.class);
public Object invoke (Invocation invocation) throws Throwable {
if (invocation instanceof MethodInvocation){
MethodInvocation method = (MethodInvocation) invocation;
log.info("Method: " + method.getActualMethod() + " invoked.");
System.out.println("Method: " + method.getActualMethod() + " invoked.");
}
if (invocation instanceof FieldInvocation){
FieldInvocation field = (FieldInvocation) invocation;
log.info("Field: " + field.getField() + " invoked.");
System.out.println("Field: " + field.getField() + " invoked.");
}
if (invocation instanceof ConstructorInvocation){
ConstructorInvocation constructor = (ConstructorInvocation) invocation;
log.info("Constructor: " + constructor.getConstructor() + " invoked.");
System.out.println("Constructor: " + constructor.getConstructor() + " invoked.");
}
return invocation.invokeNext();
}
public String getName() {
return "LoggerInterceptor"; // Par convention nous mettons le nom de la classe
}
}
the JBoss-aop.xml code :
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
The Jboss-service.xml which is there : \jboss-4.0.5.GA\server\default\deploy\jboss-aop-jdk50.deployer\META-INF
This file is directly concerned by the console error.
<?xml version="1.0" encoding="UTF-8" ?>
- <!-- $Id: jboss-service.xml 44143 2006-04-24 18:19:21Z kkhan $
-->
- <!-- =====================================================================
-->
- <!-- JBoss Server Configuration
-->
- <!-- =====================================================================
-->
-
-
true
true
true
org.jboss.test, org.jboss.injbossaop
org.jboss.
true
false
Finally, with all the configuration, the project (like the injboss project) goes but without trace of the interceptor
Coud you continue to help me please ?
Thank you very much
Didier ROCK
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4050540#4050540
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4050540
18Â years, 10Â months