This is related to issue
http://jira.codehaus.org/browse/XFIRE-243
.
I tried the following:
#1 - Make use of the SoapActionOutHandler()
GetTeamMemberService proxy = (GetTeamMemberService) new XFireProxyFactory().create(serviceModel, url);
Client.getInstance(proxy).addOutHandler(new SoapActionOutHandler());
#2 - Created my own handler with the following code:
public void invoke(MessageContext msgContext) throws Exception {
Service service = msgContext.getService();
if (service != null) {
OperationInfo op = msgContext.getExchange().getOperation();
AbstractSoapBinding binding = (AbstractSoapBinding) msgContext.getBinding();
String action = "http://service.wellsfargo.com/provider/pcs/bus/getTeamMember/2006/"
msgContext.getOutMessage().setProperty(SoapConstants.SOAP_ACTION, action);
msgContext.getExchange().getOperation().setProperty(SoapConstants.SOAP_ACTION, action);
}
}
Both do NOT work. As we all know, without a valid SOAPAction, it would be tricky to interoperate with Axis 1.x-based services.
If you want to set action using handler, then you handler must looks like:
public class ActionHandler
extends AbstractHandler
{
public ActionHandler(){ setPhase(Phase.TRANSPORT); after(SoapActionInHandler.class.getName()); }
{ context.getExchange().getOutMessage().setProperty(SoapConstants.SOAP_ACTION, MySOAPAction"); }public void invoke(MessageContext context)
throws Exception
}
But you can also configure action using following client code ( ofcourse this code is simplyfied to be used for one service method
:
ObjectServiceFactory factory = new ObjectServiceFactory(xfire.getTransportManager(),
{ OperationInfo op = super.addOperation(endpoint, method, use); new AddressingOperationInfo("http://example.org/action/echoIn", "http://example.org/action/echoOut", op); return op; }new MessageBindingProvider())
{
protected OperationInfo addOperation(Service endpoint, Method method, String use)
protected QName getInParameterName(Service endpoint,
{ return new QName("http://example.org/echo", "echo"); }OperationInfo op,
Method method,
int paramNumber,
boolean doc)
};
XFireProxyFactory serviceFactory = new XFireProxyFactory();
Service serviceModel = factory.create(BookService.class,null,"http://xfire.codehaus.org/BookService",null);