You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by amitmahesh <la...@yahoo.com> on 2016/03/02 16:56:36 UTC

Unable to route Rest webservice Json response to SOAP service via camel route

We are calling a thirdparty SOAP service (without WSDL) from a REST service.
We created a intermediate proxy cxf webservice to invoke the final third
party webservice. The JSON request is not getting converted to SOAP
parameters correctly and we getting Exception that "Expecting 3 parameters
but getting 1 , Pls check your data format" .  When we change the SOAP
interface to accept 1 parameter, and remove @Webparam annotation from
interface then it is working fine. How do we correctly map the JSON string
to SOAP request parameters , such that all 3 parameters from JSON string are
correctly mapped. 

*Rest Server config below :
*
	/<cxf:rsServer id="GetCustomerService" address="/getCustomer">
		<cxf:serviceBeans>
			<bean
				class="com.infrasoft.osb.login.serverProxy.GetCustomerProxyServerImpl"
/>
		</cxf:serviceBeans>
		<cxf:providers>
			<bean class="org.codehaus.jackson.jaxrs.JacksonJsonProvider" />
		</cxf:providers>

		<cxf:properties>
			<entry key="dataFormat" value="POJO" />
		</cxf:properties>
	</cxf:rsServer>/


*Proxy webservice to third party service :
*
/	<cxf:cxfEndpoint id="getOSBCustomerClient"  
serviceName="s:GetOSBCustomerService"     
            serviceClass="com.infrasoft.osb.bastion.GetOSBCustomer" 
            wsdlURL="http://localhost:8080/SystemServer/GetOSBCustomer?wsdl"
xmlns:s="http://bastion.osb.infrasoft.com/">
     <cxf:properties>
      <entry key="dataFormat" value="POJO"/>
     </cxf:properties>
      </cxf:cxfEndpoint>/


*Camel route :
*
/<route id="CustomerRoute">
			<from uri="cxfrs://bean://GetCustomerService" />
			<setExchangePattern pattern="InOut" />
			 <camel:bean ref="getMortgageAccountResquestProcessor"
				method="process" />
			<setHeader headerName="operationName">
				<constant>getCustomerDetails</constant>
			</setHeader>
			<to uri="cxf:bean:getOSBCustomerClient"/>
		</route>/


JSON message as seen from Request Processor before invoking the proxy :
Exchange[Message: {"customerId":"0000104","systemId":"POR","brandId":"KRS"}]


Web param definition of SOAP service proxy :
	@WebMethod public Customer
getCustomerDetails(@WebParam(name="systemId")String
systemId,@WebParam(name="brandId")String
brandId,@WebParam(name="customerId")String customerId) throws
JsonParseException, JsonMappingException, IOException ;

Pls suggest how to map JSON elements to each web params??





--
View this message in context: http://camel.465427.n5.nabble.com/Unable-to-route-Rest-webservice-Json-response-to-SOAP-service-via-camel-route-tp5778525.html
Sent from the Camel - Users mailing list archive at Nabble.com.