Hi,
You could name the beans.xml to cxf.xml and put it into the class path.
CXF will load it automatically.
You could also use -Dcxf.config.file=beans.xml load the configuration
file in the class path,
or you could use -Dcxf.config.file.url={beans.xml url} to load the
configuration file.
Another option is you could load the bus with this beans.xml [1]
[1]http://www.nabble.com/Setting-the-timeout-on-the-client-side-tf4361130.html#a12429634
Willem.
Christian Vest Hansen wrote:
Hi,
I have a beans.xml file containing:
<http:conduit
name="{http://ws.unwire.dk/ldap/MyService/v1}MyService1Staging.http-conduit">
<http:tlsClientParameters secureSocketProtocol="SSL">
</http:tlsClientParameters>
</http:conduit>
And a little test client that does this in it's main() method:
ApplicationContext ac = new ClassPathXmlApplicationContext("beans.xml");
MyService1_Service service = new MyService1_Service();
MyService1 my = service.getMyService1Staging();
Client c = ClientProxy.getClient(my);
HTTPConduit conduit = (HTTPConduit) c.getConduit();
TLSClientParameters tlsParams = new TLSClientParameters();
conduit.setTlsClientParameters(tlsParams);
System.out.println(my.someOperation());
And that works and all is well.
However, if I comment the creation of the ApplicationContext out, I
get the following error:
INFO: Creating Service
{http://ws.unwire.dk/ldap/MyService/v1}MyService1 from WSDL:
https://staging.unwire.dk/ldapservice/services/MyService1?wsdl
Exception in thread "main" org.apache.cxf.interceptor.Fault: No
conduit initiator was found for the namepsace
http://schemas.xmlsoap.org/soap/http.
at
org.apache.cxf.endpoint.AbstractConduitSelector.getSelectedConduit(AbstractConduitSelector.java:89)
at
org.apache.cxf.endpoint.UpfrontConduitSelector.selectConduit(UpfrontConduitSelector.java:71)
at org.apache.cxf.endpoint.ClientImpl.getConduit(ClientImpl.java:413)
at dk.unwire.ws.ldap.myservice.v1.MyService1_Service.main(Main.java:95)
Caused by: org.apache.cxf.BusException: No conduit initiator was found
for the namepsace http://schemas.xmlsoap.org/soap/http.
at
org.apache.cxf.transport.ConduitInitiatorManagerImpl.getConduitInitiator(ConduitInitiatorManagerImpl.java:96)
at
org.apache.cxf.endpoint.AbstractConduitSelector.getSelectedConduit(AbstractConduitSelector.java:70)
... 3 more
So, is it possible to perform the same configuration using the API as
would otherwise have been done by the ApplicationContext and the
http:conduit element?
This whole thing is being used in a component intended for other
projects to use, so I could simplify my public interface and
configuration overhead if I could make all the default configurations
built in.