Five Stars

Dynamic CXF client parameters

Hello

We need to use 1 cxf client with dynamic parameters, for reuse purpose (we will have hundreds of WS to call and shall not use hundreds of cxf components). Context variables won't be sufficient, we need to use headers or properties.

 

I have a "normal" cxf component in a route, that works fine. I tried to cute&paste the generated java code into a cJavaDSLPRocessor , without changing anything, just set up "operationName" and "operationNamespace" before, but it fails.

Here is the code :

.toD(
"cxf://"
						+ 'the_url...'
						+ "?dataFormat=PAYLOAD"
						+ "&allowStreaming=false"
						+ "&wsdlURL="
						+ "http://uwstst01.ga.local:8080/wsdl/sgenvisvpa01.wsdl"
						+ "&serviceName="
						+ "{urn:uniface:applic:services:SGENVISVPA01}SGENVISVPA01Service"
						+ "&endpointName="
						+ "{urn:uniface:applic:services:SGENVISVPA01}SGENVISVPA01"
						+ "&defaultOperationNamespace="
						+ javax.xml.namespace.QName
								.valueOf(
										"{urn:uniface:applic:services:SGENVISVPA01}O_GET_XML")
								.getNamespaceURI()
						+ "&defaultOperationName="
						+ javax.xml.namespace.QName
								.valueOf(
										"{urn:uniface:applic:services:SGENVISVPA01}O_GET_XML")
								.getLocalPart()
						//+ "&headerFilterStrategy=#CXF_PAYLOAD_HEADER_FILTER"
)						

and the error :

org.apache.cxf.binding.soap.SoapFault: {USERVER:doSoapRequest:URBnewStatelessReq}Activation error: (-50, bad interface name: nil or empty)

How can we dynamically set a cxf client ?

 

Thank you