[ 
https://issues.apache.org/jira/browse/SYNAPSE-200?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Andreas Veithen updated SYNAPSE-200:
------------------------------------

    Attachment: resource-map-patch.txt

I attached a patch that allows to have declarations like this in the 
synapse.xml file:

<publishWSDL key="conf/bis.wsdl">
  <resource location="bis.xsd" key="conf/bis.xsd"/>
</publishWSDL>

I tested this with a WSDL 1.1 document, but not yet with a WSDL 2.0.

The patch adds
* a class ResourceMap that stores the location->key mappings and contains the 
logic to resolve a location to an InputSource object via the registry
* an adapter class ResourceMapURIResolver that implements the URIResolver 
interface
* an adapter class ResourceMapWSDLLocator that implements the WSDLLocator 
interface: Axis 2 needs this for WSDL 1.1 documents; I'm not sure why this is 
so (there is obviously an overlap with the URIResolver object)
* ResourceMapFactory/ResourceMapSerializer classes (probably they could also be 
useful for the <validate> mediation)

It modifies
* ProxyService with a new property resourceMap and the logic to set up the 
URIResolver and WSDLLocator
* ProxyServiceFactory/ProxyServiceSerializer
* ProxyServiceSerializationTest


> Publishing WSDL files with imported WSDL/XSD not working
> --------------------------------------------------------
>
>                 Key: SYNAPSE-200
>                 URL: https://issues.apache.org/jira/browse/SYNAPSE-200
>             Project: Synapse
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 1.1, NIGHTLY
>            Reporter: Andreas Veithen
>         Attachments: resource-map-patch.txt, wsdl-patch.txt
>
>
> I'm writing a Web service proxy and I have a some trouble to publish WSDL 
> files that import other WSDL or XSD files. In my case I have a WSDL file 
> bis.wsdl (placed in the conf directory in the repository directory) importing 
> an XSD located in the same directory. The WSDL file uses a relative URL for 
> the schemaLocation attribute:
> <xsd:import namespace="..." schemaLocation="bis.xsd"/>
> When I try to use publishWSDL with uri="file:repository/conf/bis.wsdl", I get 
> the following error:
> java.io.FileNotFoundException: This file was not found: 
> file:/Users/veithen/workspace/pim-ebxml/synapse/bis.xsd
> Obviously Synapse (or Axis in this case) doesn't resolve bis.xsd relative to 
> the location of the WSDL, but relative to the working directory. I get the 
> same result when using 
> uri="file:///Users/veithen/workspace/pim-ebxml/synapse/repository/conf/bis.wsdl"
>  or key="conf/bis.wsdl". When I try with uri="repository/conf/bis.wsdl" I get 
> the following error:
> java.lang.IllegalArgumentException: URI is not absolute
> There seems to be no way to make this work.
> One part of the problem is that the code in ProxyService only calls 
> WSDLToAxisServiceBuilder#setBaseUri for WSDL 2.0 documents (in my case it's a 
> WSDL 1.1 document). This is obviously a bug. After correcting this (see 
> attached patch), I can use 
> uri="file:///Users/veithen/workspace/pim-ebxml/synapse/repository/conf/bis.wsdl"
>  to get the expected result. However, using absolute filenames in synapse.xml 
> is not appropriate. When using uri="file:repository/conf/bis.wsdl" I now get 
> the following error:
> org.apache.ws.commons.schema.XmlSchemaException: 
> /Users/veithen/workspace/pim-ebxml/synapse/bis.xsd (No such file or directory)
> This is not so surprising since "file:repository/conf/bis.wsdl" is actually 
> an invalid URL (even if Synapse seems to accept it in some contexts): only 
> "repository/conf/bis.wsdl" and 
> "file:///Users/veithen/workspace/pim-ebxml/synapse/repository/conf/bis.wsdl" 
> are strictly valid, one as relative URL, the other as absolute URL.
> For the two other alternatives (uri="repository/conf/bis.wsdl" and 
> key="conf/bis.wsdl") I get, not surprisingly, the same error as before.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to