Question

I tried to create router with JBoss Fuse/Camel and deployed in successfully.

<camelContext id="blueprintContext"
                trace="false"
                xmlns="http://camel.apache.org/schema/blueprint">
    <route id="httpBridge">
      <from uri="jetty:http://mysystem:8282/CreateAccountService?matchOnUriPrefix=true"/>
      <to uri="jetty:http://mysystem:8080/service/services/CreateAccountService?bridgeEndpoint=true&amp;throwExceptionOnFailure=false"/>
    </route>
  </camelContext>  

Able to access the service using proxy.

I have used xsd for data types in wsdl.

<wsdl:types>
<xsd:schema xmlns:fault="http://www.sample.project.com.au/common/message/FaultMessage/v1" xmlns:pref="http://www.sample.project.com.au/services/account/CreateAccount/CreateAccountRequest/v1" xmlns:pref1="http://www.sample.project.com.au/services/account/CreateAccount/CreateAccountResponse/v1" xmlns:pref2="http://www.sample.project.com.au/common/message/TechnicalException/v1" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://www.sample.project.com.au/services/account/CreateAccount/v1" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.sample.project.com.au/services/account/CreateAccount/v1">
<xsd:import namespace="http://www.sample.project.com.au/services/account/CreateAccount/CreateAccountRequest/v1" schemaLocation="http://mysystem:8080/service/services/CreateAccountService?xsd=CreateAccountRequest.xsd"></xsd:import>
<xsd:import namespace="http://www.sample.project.com.au/services/account/CreateAccount/CreateAccountResponse/v1" schemaLocation="http://mysystem:8080/service/services/CreateAccountService?xsd=CreateAccountResponse.xsd"></xsd:import>
</xsd:schema>
</wsdl:types>

http://mysystem:8282/CreateAccountService?wsdl (Proxy)

But, I can see all the xsd details in wsdl with

<xsd:import namespace="http://www.sample.project.com.au/services/account/CreateAccount/CreateAccountRequest/v1" schemaLocation="http://mysystem:8080/service/services/CreateAccountService?xsd=CreateAccountRequest.xsd"></xsd:import>

which is original url of the schema.

http://mysystem:8080/service/services/CreateAccountService?xsd=CreateAccountRequest.xsd

I want to hide this details also.

But, I was able to see all the schema with actual url details.

How can I create the proxy for all the contents in the URI.

If I am not clear with my question, please let me know.

Was it helpful?

Solution

1)

You need to process the reply message (using message translator eip http://camel.apache.org/message-translator.html) before returning it to the client, so you can replace the url in the message body from the actual url, to the proxy url

For example you can use a bean with a single method that does the search/replace

public String transformTheMessage(String body) {
  ...
  ... search for the url you want to replace
}

And then define a bean in the xml file and use it in the Camel route

<route id="httpBridge">
      <from uri="jetty:http://mysystem:8282/CreateAccountService?matchOnUriPrefix=true"/>
      <to uri="jetty:http://mysystem:8080/service/services/CreateAccountService?bridgeEndpoint=true&amp;throwExceptionOnFailure=false"/>
      <to uri="bean:myBean"/>
    </route>

2)

Or check if the request is for the WSDL and do a content based router, and return the content from a file which you have on the proxy server - and the file has the proxy urls hardcoded etc. http://camel.apache.org/content-based-router.html

3)

Or check out this example

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top