Enterprise Integration Zone is brought to you in partnership with:

I am a graduate of University of Westminster UK (IIT) B Sc Software Engineering ( First Class Honours). I am a Sun Certified Java Programmer for Java 2 platform, 1.5 versions (SCJP 1.5). – 93% and a Sun Certified Web Component Developer 97%. I work as a Software Engineer at WSO2. Achala is a DZone MVB and is not an employee of DZone and has posted 21 posts at DZone. You can read more from them at their website. View Full User Profile

Access the WSDL for a customURI - WSO2 ESB

03.02.2013
| 1668 views |
  • submit to reddit
The URL of a proxy service can be customized. It is explained at http://achala11.blogspot.com/2012/07/wso2-esb-proxy-services-with-custom.html

Ok,  lets try to access the WSDL.

The WSDL of a custom service url can be accessed from the following workaround.

You can use "main" sequence to route ?wsdl requests to appropriate working WSDL urls.
With this configuration, you can fetch wsdl for proxy service via http://localhost:8280/CustomURL/Part1/Part2?wsdl

If you have multiple proxy services with custom uris, you have to add a <case> statement per proxy service with appropriate wsdl urls.
<proxy xmlns="http://ws.apache.org/ns/synapse" name="CustomerProxy" transports="https,http" statistics="disable" trace="disable" startOnLoad="true">
   <target>
      <outSequence>
         <send />
      </outSequence>
      <endpoint>
         <address uri="http://localhost:8280/services/Version" />
      </endpoint>
   </target>
   <publishWSDL uri="http://localhost:8280/services/Version?wsdl" />
   <parameter name="ServiceURI">/CustomURL/Part1/Part2</parameter>
</proxy> 

<sequence xmlns="http://ws.apache.org/ns/synapse" name="main">
   <in>
      <property name="REST_URL_POSTFIX" action="remove" scope="axis2" />
      <switch xmlns:ns="http://org.apache.synapse/xsd" xmlns:ns3="http://org.apache.synapse/xsd" source="get-property('To')">
         <case regex="/CustomURL/Part1/Part2\?wsdl">
            <send>
               <endpoint>
                  <address uri="http://localhost:8280/services/CustomerProxy?wsdl" format="get" />
               </endpoint>
            </send>
         </case>
      </switch>
   </in>
   <out>
      <send />
   </out>
</sequence> 
 

Published at DZone with permission of Achala Chathuranga Aponso, author and DZone MVB. (source)

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)