1

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?

Community
  • 1
  • 1
Aleš
  • 8,896
  • 8
  • 62
  • 107
  • Cannot provide any error message since anytime I modify the Proxy Service file and click safe, the "localEntry" file just disappers - I guess thats how Management Console deals with compilation errors. – Aleš Mar 15 '12 at 02:09

2 Answers2

4

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
keheliya
  • 2,393
  • 2
  • 24
  • 35
  • 2
    Thank you. I did not know "conf:" is a shortcut for "/_system/config". I can now see the files in my repository. – Aleš Mar 15 '12 at 18:21
  • I am now trying to use the WSDL in my publishWSDL element but still get the "Unable to locage the speficied WSDL" error. Is the following syntax correct: `publishWSDL key="standard.wsdl" resource location="conf:/wsdl/MyServiceSOAP.wsdl" key="standard.wsdl" publishWSDL` – Aleš Mar 15 '12 at 18:40
  • 1
    You can just say Sorry for the late reply. I had missed your comment. – keheliya Jun 14 '12 at 05:32
2

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.