I have a CXF web service running that prints out a WSDL. Taking this WSDL and
running it through CXF version of wsdl2java generates me the stub,

wsdl2java -verbose -p mypackage.base -sn Myservice -client %1

When I invoke it, I always get a SOAP fault in my interceptor. My
interceptor is SecurityInterceptor given below,

read [ReadHeadersInterceptor, SecurityInterceptor, SoapActionInInterceptor,
StartBodyInterceptor]

On investigating further I find that the 'SOAPAction', is passed as
Soapaction - so when I do this
(reqHeaders.get(SoapBindingConstants.SOAP_ACTION);) -  I don't get any
Action defined. The work around for now that I could do is this,

        // Fall back on parsing headers (we get Soapaction instead of
SOAPAction also)
        if (action.length() == 0) {
            Map<String, List<String>> reqHeaders =
CastUtils.cast((Map)message.get(Message.PROTOCOL_HEADERS));
            for (Map.Entry<String, List<String>> entry :
reqHeaders.entrySet()) {

                String key = entry.getKey();
                List value = entry.getValue();
                if (SoapBindingConstants.SOAP_ACTION.equalsIgnoreCase(key))
{
                    if (value != null && value.size() > 0)
                        action.append(value.get(0).toString());
                }
            }
        }

Is this how it is supposed to work?
-- 
View this message in context: 
http://cxf.547215.n5.nabble.com/SOAP-header-wsdl2java-issue-tp3399058p3399058.html
Sent from the cxf-user mailing list archive at Nabble.com.

Reply via email to