Question

Howto reference WSDL files from the registry when defining a new proxy service? I am using WSO2 ESB.

Q1: Can I use the localEntry element to define the WSDL in my proxy service? For example:

localEntry key="my_wsdl" src="file:/wsdl/MyServiceSOAP.wsdl"

Provided that I have previously used Management Console > Add Collection > create "wsdl", and Add Resource > MyServiceSOAP.wsdl. I have a problem with the "src" value, both

"/wsdl/MyServiceSOAP.wsdl" 
and
"wsdl/MyServiceSOAP.wsdl" 
do not work. I follow the documentation but they do not show howto upload WSDLs into the registry.

Q2: What if MyServiceSOAP.wsdl imports MyService.wsdl? I need to use Add Resource for MyService.wsdl as well but do I need to do anything else to make the Proxy compile?

Was it helpful?

Solution

I think you are referring to the registry here. The Registry space in each product contains three major partitions.

  • Local
  • Configuration
  • Governance

Registry Space in the ESB The configuration registry contains product specific configuration that can be shared across multiple instances of the same product (a cluster of ESB nodes for example). So you can create the WSDL collection inside the Config registry and refer to it like..

"conf:/wsdl/MyServiceSOAP.wsdl"

By uploading the resources to Registry, you can pick them easily when creating the proxy service too. enter image description here

I think you can refer to resources as "file:/wsdl/MyServiceSOAP.wsdl" only when they are inside a directory named 'wsdl' in the local file system. BTW, about the error messages.. If you look at ESB server logs you'll see the following error when you try to update the proxy referring to a non existing file.

Caused by: java.io.FileNotFoundException: ./wsdl/MyServiceSOAP.wsdl (No such file or directory)
    at java.io.FileInputStream.open(Native Method)
    at java.io.FileInputStream.<init>(FileInputStream.java:120)
    at java.io.FileInputStream.<init>(FileInputStream.java:79)
    at sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:70)
    at sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:161)
    at org.apache.synapse.config.SynapseConfigUtils.getObject(SynapseConfigUtils.java:197)
    ... 46 more

OTHER TIPS

I found a simple solution for it from a blog: In my Scenario I had a wsdl, that imported another wsdl that imported a xsd. The actual structures were in the second wsdl.

Import line in the original wsdl:

    <wsdl:import namespace="http://www.somedomain.com/interface/v1_0" location="service_interface_1_0.wsdl"/>

Import line in the second wsdl:

    <xsd:import namespace="http://www.somedomain.com/data/v1_0" schemaLocation="data_types_1_0.xsd"/>

Required xml on the proxy:

    <publishWSDL key="file_required_service_1_0.wsdl">
  <resource location="service_interface_1_0.wsdl"
            key="file_service_interface_1_0.wsdl"/>
  <resource location="data_types_1_0.xsd"
            key="file_data_types_1_0.xsd"/>

Where I have local entries for "file_required_service_1_0.wsdl" etc named local entries that contain the original wsdl and xsd files.

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