Created
October 1, 2012 06:23
-
-
Save inancsevinc/3809800 to your computer and use it in GitHub Desktop.
namespace-to-package mapper for non-standard namespaces in wsdl/xsd files, to be run before jax-rpc client generation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os, re | |
searchDir= "C:/temp" | |
mydict = {} #empty dictionary, keys are namespace urls, values are mapped packages | |
for dirpath, dirnames, filenames in os.walk(searchDir): #walk thru directories recursively | |
for file in [ f for f in filenames if os.path.splitext(f)[1] in [".xsd",".wsdl"] ]: | |
with open(os.path.join(dirpath,file)) as current_file: | |
for line in current_file.readlines(): | |
m = re.search(r'(http://)(isbank\.com([^\"])+)', line) | |
if(m): mydict[m.group(0)] = "com.isbank."+".".join(m.group(2).replace('/','.').split(".")[2:] ) | |
for key,value in mydict.items(): | |
print("<arg line=\"-N "+key+"="+value+"\" />") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment