This is now tracked as issue: https://issues.apache.org/jira/browse/CXF-3802
Thanks, Jesse -----Original Message----- From: Daniel Kulp [mailto:[email protected]] Sent: Monday, September 12, 2011 12:11 PM To: Jesse Pangburn Cc: [email protected] Subject: Re: jaxws Provider doesn't allow override of outbound ws addressing headers On Monday, September 12, 2011 2:09:13 PM Jesse Pangburn wrote: > Hi Dan, > Great! That worked with the expected messageContext.put() after changing > this line in your patch to: maps = > (AddressingPropertiesImpl)message.getExchange().getInMessage().get(mapPrope > rty); > > For obvious reasons :-) Thanks so much! It's much better from the user > point of view this way. > > Do you want me to create an issue in Jira or you already are taking care of > that? Please do so so I don't forget about it. Thanks! Dan > Thanks, > Jesse > > -----Original Message----- > From: Daniel Kulp [mailto:[email protected]] > Sent: Friday, September 09, 2011 2:13 PM > To: [email protected] > Cc: Jesse Pangburn > Subject: Re: jaxws Provider doesn't allow override of outbound ws addressing > headers > > > This might be a simple enhancement request. Are you able to build CXF > source and test? I think a simple change like: > > --- > a/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/ContextUtils.java > +++ > b/rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/ContextUtils.java > @@ -279,6 +279,9 @@ public final class ContextUtils { > mapProperty); > AddressingPropertiesImpl maps = > (AddressingPropertiesImpl)message.get(mapProperty); > + if (maps == null && isOutbound && !isRequestor) { > + message.getExchange().getInMessage().get(mapProperty); > + } > if (maps != null) { > LOG.log(Level.FINE, "current MAPs {0}", maps); > } else if (!isProviderContext) { > > > would work in this case. Basically, on the outbound server side, if the > message doesn't have the map with the key, check the inbound message (where > the JAX-WS context would have stored it). > > Dan > > On Wednesday, September 07, 2011 9:26:31 PM Jesse Pangburn wrote: > > Debugging through the code illustrates that you can't just set this > > property on the MessageContext object for the Provider, you must set it > > on the outbound message object, like this: > > ((org.apache.cxf.jaxws.context.WrappedMessageContext)messageContext).get > > Wra > > ppedMessage().getExchange().getOutMessage().put(JAXWSAConstants.SERVER_ > > ADDRE SSING_PROPERTIES_OUTBOUND, wsaServer); > > > > So the working code for me becomes something like: > > AddressingProperties wsaServer = new AddressingPropertiesImpl(); > > AttributedURIType aut = new AttributedURIType(); > > aut.setValue("urn:get:some"); > > wsaServer.setAction(aut); > > ((org.apache.cxf.jaxws.context.WrappedMessageContext)messageContext).get > > Wrap > > pedMessage().getExchange().getOutMessage().put(JAXWSAConstants.SERVER_A > > DDRES SING_PROPERTIES_OUTBOUND, wsaServer); > > > > I've tried overriding the message id and the action headers, both were > > successful. Still, I'm wondering if it's a bug to have to jump through > > all these hoops to set that on the outbound message. Shouldn't it > > inherit from the MessageContext or something? The outbound message > > seems to get the inbound addressing properties assigned just fine. > > > > Thanks, > > Jesse > > > > -----Original Message----- > > From: Jesse Pangburn [mailto:[email protected]] > > Sent: Wednesday, September 07, 2011 5:24 PM > > To: [email protected] > > Subject: jaxws Provider doesn't allow override of outbound ws addressing > > headers > > > > Hi, > > I have a jaxws Provider configured to do WS-Addressing and the defaults > > seem to work fine. However, if I try to override some of the > > WS-Addressing headers in the MessageContext, it gets ignored. I've > > tried the following : > > > > AddressingProperties wsaServer = new AddressingPropertiesImpl(); > > AttributedURIType aut = new AttributedURIType(); > > aut.setValue("urn:get:some"); > > wsaServer.setAction(aut); > > messageContext.put(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_OUTBOUND > > , > > wsaServer); > > > > But the Action header sent in the response is the default from the WSDL, > > not my override value. Am I doing something wrong or this never > > worked? I've tried doing: > > messageContext.get(JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_OUTBOUND > > ) > > > > But that returns null, so I've been using the put instead. I tried > > overriding the messageId as well, but that didn't work either. > > > > Thanks, > > Jesse -- Daniel Kulp [email protected] http://dankulp.com/blog Talend - http://www.talend.com
