Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Schema files from local file system #14

Open
tsujigiri opened this issue Sep 10, 2014 · 4 comments
Open

Schema files from local file system #14

tsujigiri opened this issue Sep 10, 2014 · 4 comments

Comments

@tsujigiri
Copy link

I would like to keep a copy of a WSDL and its schema files in my local file system. I can load a local WSDL by just passing the path into Sekken.new, the resolver lets me. To do the same with the associated schema files I replaced the schemaLocation attributes to have the local paths as values. The problem is, that this prevents me from importing them.

What is the reason for limting the schema locations to http URLs?

@tjarratt
Copy link
Contributor

I believe the reason for limiting schema locations to URLs is that it's pretty common for services to provide a WSDL (and that this WSDL can change arbitrarily, since it's server hosted content).

I think it's fairly reasonable to want to load your WSDL and schema files from your filesystem. Taking a look at this code, it seems like it's trying to only load absolute URLs (e.g.: it skips relative urls like /foo). File URLs are an interesting edge case in that determining relative versus absolute requires knowing the system (since / is root on unix and on windows it would look like C:\).

If you're up to submitting a pull request for allowing schema files from the local file system, I'd be more than happy to merge that in!

@tjarratt
Copy link
Contributor

Additionally, @rubiii has done the lion's share of the work on Sekken, née Savon v3, so he might have some additional insight into why loading Schema files is different. In my opinion, looking at this for all of several minutes, it appears to just be a simple oversight.

@tsujigiri
Copy link
Author

Since everything that doesn't look like a URL or XML is passed dierectly into File.read, it should work on any system as long as the paths in the schemaLocation match the system. Assuming, File.read uses Windows-style paths on Windows for example. Hence, as a patch, I would simply remove the absolute path check.

@tjarratt
Copy link
Contributor

I believe it's true that File.read respects Windows style paths, so that seems reasonable.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants