Hello all!

I'm banging my head with this one for over a week. I've created services with 
WSDL2Java applied interceptors to it to use WSS and all works fine. Now I want 
to run clients also and I can't seem to get interceptors working.
I've created client from WSDL with (WSDL2Java) and configured the cxf.xml like 
you see in attached file.

When I try to configure jaxws:client like:
<jaxws:client 
id="{http://cdb.services.np.aek.seavus.com/}NetworkOperatorWS_ImplPort"; 
createdFromAPI="true">
        <jaxws:inInterceptors>
            <bean class="org.apache.cxf.binding.soap.saaj.SAAJInInterceptor" />
            <ref local="wssInInterceptor" />
        </jaxws:inInterceptors>
        <jaxws:outInterceptors>
                <bean 
class="org.apache.cxf.binding.soap.saaj.SAAJOutInterceptor" />
            <ref local="wssOutInterceptor" />
        </jaxws:outInterceptors>
    </jaxws:client>

I get an error when I try to run the client like this: java 
mobik.np.NetworkOperatorWS_NetworkOperatorWSImplPort_Client
Exception in thread "main" java.lang.RuntimeException: 
org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 99 
in XML document from file 
[/var/lib/tomcat5.5/webapps/np/WEB-INF/classes/cxf.xml] is invalid; nested 
exception is org.xml.sax.SAXParseException: cvc-datatype-valid.1.2.1: 
'{http://cdb.services.np.aek.seavus.com/}NetworkOperatorWS_ImplPort' is not a 
valid value for 'NCName'.

If I set jaxws:client like this: 
<jaxws:client id="client" 
name="{http://cdb.services.np.aek.seavus.com/}NetworkOperatorWS_ImplPort"; 
createdFromAPI="true">
<jaxws:inInterceptors>
            <bean class="org.apache.cxf.binding.soap.saaj.SAAJInInterceptor" />
            <ref local="wssInInterceptor" />
        </jaxws:inInterceptors>
        <jaxws:outInterceptors>
        <bean class="org.apache.cxf.binding.soap.saaj.SAAJOutInterceptor" />
            <ref local="wssOutInterceptor" />
        </jaxws:outInterceptors>
    </jaxws:client>

Then client is working,  but security headers are not added, so I guess 
interceptors are not used at all?!

Any clues on how to get interceptors working?

Thank you and kind regards,
Dejan

Attachment: cxf.xml
Description: cxf.xml

Reply via email to