cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Beyer, Doug" <>
Subject Configuration for https
Date Thu, 13 Oct 2011 14:34:31 GMT
I'm trying to connect to our own .Net web services using java. I need to use HTTPS.
is a bit confusing as the configuration examples shown don't seem to align correctly with
the data in the CXF 2.4.2 samples\wsdl_first_https\wsdl\hello_world.wsdl file.

I am not an expert in Spring or CXF and am just trying to get my java web service client configured
as quickly as possible.

Below is a snippet containing the pertinent (I hope) sections from our wsdl:

<wsdl:definitions name="ClientService" targetNamespace=""
xmlns:wsdl="" xmlns:wsx=""
xmlns:wsa10="" xmlns:tns=""
xmlns:soap12="" xmlns:wsu=""
xmlns:wsp="" xmlns:wsap=""
xmlns:msc="" xmlns:wsa=""
xmlns:wsam="" xmlns:wsaw=""
xmlns:soap="" xmlns:xsd=""
   <wsp:Policy wsu:Id="CustomBinding_IClientService_policy">
            <sp:TransportBinding xmlns:sp="">
            <sp:SignedSupportingTokens xmlns:sp="">
                  <sp:UsernameToken sp:IncludeToken="">
            <sp:Wss11 xmlns:sp="">
            <sp:Trust10 xmlns:sp="">


   <wsdl:service name="ClientService">
      <wsdl:port name="CustomBinding_IClientService" binding="tns:CustomBinding_IClientService">
         <soap12:address location=""/>
            <Identity xmlns="">

>From , I decided
to use the following shorthand since all our clients will need the same https conduit for
all our services:
Another option for the name attribute is a reg-ex expression for the ORIGINAL URL of the endpoint.
The configuration is matched at conduit creation so the address used in the WSDL or used for
the JAX-WS Service.create(...) call can be used for the name. For example, you can do:
   <http:conduit name="http://localhost:8080/.*">
to configure a conduit for all interactions on localhost:8080. If you have multiple clients
interacting with different services on the same server, this is probably the easiest way to
configure it.
That same CXF web page references a blog entry at
. Using the info from that blog entry, the CXF web page, and my wsdl, I decided to use the
following conduit configuration in my cxf.xml:

    <http:conduit name="*">


            <sec:UserName><the user name></sec:UserName>

            <sec:Password><the password></sec:Password>


        <http:tlsClientParameters secureSocketProtocol="SSL"></http:tlsClientParameters>

When I attempt to execute a method of our web service, I get the following from the CXF debug
logging (with log level = INFO):
Oct 13, 2011 7:28:46 AM prepareRefresh
INFO: Refreshing org.apache.cxf.bus.spring.BusApplicationContext@11a01dd: startup date [Thu
Oct 13 07:28:46 PDT 2011]; root of context hierarchy
Oct 13, 2011 7:28:46 AM org.apache.cxf.bus.spring.BusApplicationContext getConfigResources
INFO: Loaded configuration file cxf.xml.
Oct 13, 2011 7:28:46 AM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions
INFO: Loading XML bean definitions from file [D:\Dev\phoenix_git\protocolprototype2\CxfWebServices\cxf.xml]
Oct 13, 2011 7:28:47 AM
INFO: Pre-instantiating singletons in
defining beans [cxf,org.apache.cxf.bus.spring.BusWiringBeanFactoryPostProcessor,org.apache.cxf.bus.spring.Jsr250BeanPostProcessor,org.apache.cxf.bus.spring.BusExtensionPostProcessor,org.apache.cxf.wstx_msv_validation.WoodstoxValidationImpl,LoggingInInterceptor,LoggingOutInterceptor,cxf.config0,*];
root of factory hierarchy
Oct 13, 2011 7:28:47 AM org.apache.cxf.service.factory.ReflectionServiceFactoryBean buildServiceFromWSDL
INFO: Creating Service {}ClientService from
WSDL: file:wsdl/ClientService.svc.wsdl
Oct 13, 2011 7:28:48 AM handleNoRegisteredBuilder
WARNING: No assertion builder for type {}HttpToken
Oct 13, 2011 7:28:48 AM
WARNING: Failed to build the policy 'CustomBinding_IClientService_policy'
cannot be cast to
ERROR - login_1() -
cannot be cast to
Is the problem simple like mis-matched jars or does it have to do with my configuration?
Thanks in advance for your help.

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message