Ankur Shah wrote:
> the link doesn't work BTW
I think it does!  It's not hyperlinked though...


Ankur Shah wrote:
> More than likely the action is going to be same as method/operation name.

If you want to use the operation name dynamically using this method, then
you'll need to do 2 things:

1) add a DOMOutHandler

        Client.getInstance(service).addOutHandler(new DOMOutHandler());
        Client.getInstance(service).addOutHandler(new SOAPActionHandler());

2) Change the invoke method to extract the operation name from the SOAP
message:

public void invoke(MessageContext context) throws Exception {
        if(context != null && context.getCurrentMessage() != null) {
                Document document =
(Document)context.getCurrentMessage().getProperty(DOMOutHandler.DOM_MESSAGE);
                //  Extract the 'operation' - this is the name of the first 
child of the
body element
                String soapAction = null;
                if(document != null) {
                        Node soapEnvelope = document.getFirstChild();
                        if(soapEnvelope != null) {
                                Node soapChild = soapEnvelope.getFirstChild();
                                while(soapChild != null) {
                                        
if("body".equalsIgnoreCase(soapChild.getLocalName())) {
                                                Node op = 
soapChild.getFirstChild();
                                                if(op != null && 
op.getLocalName() != null) {
                                                        soapAction = 
op.getLocalName();
                                                }
                                                break;
                                        } else {
                                                soapChild = 
soapChild.getNextSibling();
                                        }
                                }
                        }
                }
                if(soapAction != null) {
                
context.getExchange().getOutMessage().setProperty(SoapConstants.SOAP_ACTION,
soapAction);
                }
        }
}


-- 
View this message in context: 
http://www.nabble.com/SoapAction-tf3703322.html#a11074912
Sent from the XFire - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

Reply via email to