[ http://jira.codehaus.org/browse/XFIRE-347?page=comments#action_63614 ]
Dan Diephouse commented on XFIRE-347: ------------------------------------- Wouldn't it be possible to just have the AddressingOutHandler look at the Operation's AddressingOperationInfo and create headers from that? After this handler runs the user can then have their own handler add additional headers if they want. This seems a bit cleaner to me. Thoughts? > Use WS-Addressing with XFireProxy client > ---------------------------------------- > > Key: XFIRE-347 > URL: http://jira.codehaus.org/browse/XFIRE-347 > Project: XFire > Type: Improvement > Components: Core > Versions: 1.1-beta-1 > Environment: Java 5 on Linux > Reporter: Bernd Schuller > Assignee: Dan Diephouse > Fix For: 1.1 > Attachments: Client.java > > > When using the XFireProxy client to access a WS-Addressing enabled service, I > found it impossible to add headers such as wsa:To using the procedures > outlined in the user's guide. This is due to the fact that the user cannot > set any additional headers to be inserted. > A possible workaround/solution looks as follows. > 1. Define a new out Handler > public class MyAddressingOutHandler extends AddressingOutHandler { > Map properties; > > public MyAddressingOutHandler(Map properties){ > this.properties=properties; > } > > public void invoke(MessageContext context) throws Exception{ > AddressingHeaders headers = (AddressingHeaders) > properties.get(AddressingInHandler.ADRESSING_HEADERS); > AddressingHeadersFactory factory = (AddressingHeadersFactory) > properties.get(AddressingInHandler.ADRESSING_FACTORY); > > context.getCurrentMessage().setProperty(AddressingInHandler.ADRESSING_HEADERS,headers); > > context.getCurrentMessage().setProperty(AddressingInHandler.ADRESSING_FACTORY,factory); > super.invoke(context); > } > } > 2. add the new handler to the xfire outhandlers > 3. set the properties before invoking the proxy: > Map properties=new HashMap(); > AddressingHeaders ah=new AddressingHeaders(); > ah.setAction("...."); > ah.setTo("......"); > > properties.put(AddressingInHandler.ADRESSING_HEADERS.toString(),ah); > > properties.put(AddressingInHandler.ADRESSING_FACTORY.toString(),new > AddressingHeadersFactory200508()); > DefaultXFire > xfire=(DefaultXFire)XFireFactory.newInstance().getXFire(); > xfire.addOutHandler(new > MyAddressingOutHandler(properties)); > > A real solution could be to copy the properties from the Service used to > create the proxy into the message context created in Client.invoke(), then > the standard wsa out handler would pick them up. > sorry for the long rant :) -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira