Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
mod-spox committed Apr 28, 2009
0 parents commit 7cd6edb
Show file tree
Hide file tree
Showing 642 changed files with 85,203 additions and 0 deletions.
7 changes: 7 additions & 0 deletions COPYING
@@ -0,0 +1,7 @@
SOAP4R, WSDL4R and XSD4R
Copyright (C) 2000-2003 NAKAMURA, Hiroshi <nahi@ruby-lang.org>.

This program is copyrighted free software by NAKAMURA, Hiroshi. You can
redistribute it and/or modify it under the same terms of Ruby's license;
either the dual license version in 2003 (see the file RUBYS), or any later
version.
340 changes: 340 additions & 0 deletions GPL

Large diffs are not rendered by default.

17 changes: 17 additions & 0 deletions README
@@ -0,0 +1,17 @@
== soap4r ==

This is a modified version of the soap4r library for
the Ruby programming language. The official verion
can be found at:

http://dev.ctor.org/soap4r

This modified version simply allows soap4r to run on
Ruby 1.9. I have not done any extensive testing, merely
fixed things that I needed to work. If you find problems,
please drop me a line and I'll do an update to fix it.

Thanks!

spox
spox@modspox.com
1,900 changes: 1,900 additions & 0 deletions RELEASE_en.html

Large diffs are not rendered by default.

56 changes: 56 additions & 0 deletions RUBYS
@@ -0,0 +1,56 @@
Ruby is copyrighted free software by Yukihiro Matsumoto <matz@netlab.jp>.
You can redistribute it and/or modify it under either the terms of the GPL
(see the file GPL), or the conditions below:

1. You may make and give away verbatim copies of the source form of the
software without restriction, provided that you duplicate all of the
original copyright notices and associated disclaimers.

2. You may modify your copy of the software in any way, provided that
you do at least ONE of the following:

a) place your modifications in the Public Domain or otherwise
make them Freely Available, such as by posting said
modifications to Usenet or an equivalent medium, or by allowing
the author to include your modifications in the software.

b) use the modified software only within your corporation or
organization.

c) give non-standard binaries non-standard names, with
instructions on where to get the original software distribution.

d) make other distribution arrangements with the author.

3. You may distribute the software in object code or binary form,
provided that you do at least ONE of the following:

a) distribute the binaries and library files of the software,
together with instructions (in the manual page or equivalent)
on where to get the original distribution.

b) accompany the distribution with the machine-readable source of
the software.

c) give non-standard binaries non-standard names, with
instructions on where to get the original software distribution.

d) make other distribution arrangements with the author.

4. You may modify and include the part of the software into any other
software (possibly commercial). But some files in the distribution
are not written by the author, so that they are not under these terms.

For the list of those files and their copying conditions, see the
file LEGAL.

5. The scripts and library files supplied as input to or produced as
output from the software do not automatically fall under the
copyright of the software, but belong to whomever generated them,
and may be sold commercially, and may be aggregated with this
software.

6. THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE.
9 changes: 9 additions & 0 deletions Rakefile
@@ -0,0 +1,9 @@
require 'rake/gempackagetask'
load 'soap4r.gemspec'

task :default => :gem

Rake::GemPackageTask.new(SPEC) do |pkg|
pkg.need_zip = true
pkg.need_tar = true
end
137 changes: 137 additions & 0 deletions bin/wsdl2ruby.rb
@@ -0,0 +1,137 @@
#!/usr/bin/env ruby

require 'getoptlong'
require 'logger'
require 'wsdl/soap/wsdl2ruby'


class WSDL2RubyApp < Logger::Application
private

OptSet = [
['--wsdl','-w', GetoptLong::REQUIRED_ARGUMENT],
['--module_path','-m', GetoptLong::REQUIRED_ARGUMENT],
['--type','-t', GetoptLong::REQUIRED_ARGUMENT],
['--classdef','-e', GetoptLong::OPTIONAL_ARGUMENT],
['--mapping_registry','-r', GetoptLong::NO_ARGUMENT],
['--client_skelton','-c', GetoptLong::OPTIONAL_ARGUMENT],
['--servant_skelton','-s', GetoptLong::OPTIONAL_ARGUMENT],
['--cgi_stub','-g', GetoptLong::OPTIONAL_ARGUMENT],
['--servlet_stub','-l', GetoptLong::OPTIONAL_ARGUMENT],
['--standalone_server_stub','-a', GetoptLong::OPTIONAL_ARGUMENT],
['--driver','-d', GetoptLong::OPTIONAL_ARGUMENT],
['--drivername_postfix','-n', GetoptLong::REQUIRED_ARGUMENT],
['--force','-f', GetoptLong::NO_ARGUMENT],
['--quiet','-q', GetoptLong::NO_ARGUMENT],
]

def initialize
super('app')
STDERR.sync = true
self.level = Logger::FATAL
end

def run
@worker = WSDL::SOAP::WSDL2Ruby.new
@worker.logger = @log
location, opt = parse_opt(GetoptLong.new(*OptSet))
usage_exit unless location
@worker.location = location
if opt['quiet']
self.level = Logger::FATAL
else
self.level = Logger::INFO
end
@worker.opt.update(opt)
@worker.run
0
end

def usage_exit
puts <<__EOU__
Usage: #{ $0 } --wsdl wsdl_location [options]
wsdl_location: filename or URL
Example:
For server side:
#{ $0 } --wsdl myapp.wsdl --type server
For client side:
#{ $0 } --wsdl myapp.wsdl --type client
Options:
--wsdl wsdl_location
--type server|client
--type server implies;
--classdef --mapping_registry --servant_skelton --standalone_server_stub
--type client implies;
--classdef --mapping_registry --client_skelton --driver
--classdef [filenameprefix]
--mapping_registry
--client_skelton [servicename]
--servant_skelton [porttypename]
--cgi_stub [servicename]
--servlet_stub [servicename]
--standalone_server_stub [servicename]
--driver [porttypename]
--drivername_postfix driver_classname_postfix
--module_path Module::Path::Name
--force
--quiet
Terminology:
Client <-> Driver <-(SOAP)-> Stub <-> Servant
Driver and Stub: Automatically generated
Client and Servant: Skelton generated (you should change)
__EOU__
exit 1
end

def parse_opt(getoptlong)
opt = {}
wsdl = nil
begin
getoptlong.each do |name, arg|
case name
when "--wsdl"
wsdl = arg
when "--module_path"
opt['module_path'] = arg
when "--type"
case arg
when "server"
opt['classdef'] ||= nil
opt['mapping_registry'] ||= nil
opt['servant_skelton'] ||= nil
opt['standalone_server_stub'] ||= nil
when "client"
opt['classdef'] ||= nil
opt['mapping_registry'] ||= nil
opt['driver'] ||= nil
opt['client_skelton'] ||= nil
else
raise ArgumentError.new("Unknown type #{ arg }")
end
when "--classdef", "--mapping_registry",
"--client_skelton", "--servant_skelton",
"--cgi_stub", "--servlet_stub", "--standalone_server_stub",
"--driver"
opt[name.sub(/^--/, '')] = arg.empty? ? nil : arg
when "--drivername_postfix"
opt['drivername_postfix'] = arg
when "--force"
opt['force'] = true
when "--quiet"
opt['quiet'] = true
else
raise ArgumentError.new("Unknown type #{ arg }")
end
end
rescue
usage_exit
end
return wsdl, opt
end
end

WSDL2RubyApp.new.start
90 changes: 90 additions & 0 deletions bin/xsd2ruby.rb
@@ -0,0 +1,90 @@
#!/usr/bin/env ruby

require 'getoptlong'
require 'logger'
require 'wsdl/xmlSchema/xsd2ruby'


class XSD2RubyApp < Logger::Application
private

OptSet = [
['--xsd','-x', GetoptLong::REQUIRED_ARGUMENT],
['--module_path','-m', GetoptLong::REQUIRED_ARGUMENT],
['--classdef','-e', GetoptLong::OPTIONAL_ARGUMENT],
['--mapping_registry','-r', GetoptLong::NO_ARGUMENT],
['--mapper','-p', GetoptLong::NO_ARGUMENT],
['--force','-f', GetoptLong::NO_ARGUMENT],
['--quiet','-q', GetoptLong::NO_ARGUMENT],
]

def initialize
super('app')
STDERR.sync = true
self.level = Logger::FATAL
end

def run
@worker = WSDL::XMLSchema::XSD2Ruby.new
@worker.logger = @log
location, opt = parse_opt(GetoptLong.new(*OptSet))
usage_exit unless location
@worker.location = location
if opt['quiet']
self.level = Logger::FATAL
else
self.level = Logger::INFO
end
@worker.opt.update(opt)
@worker.run
0
end

def usage_exit
puts <<__EOU__
Usage: #{ $0 } --xsd xsd_location [options]
xsd_location: filename or URL
Example:
#{ $0 } --xsd myapp.xsd --classdef foo
Options:
--xsd xsd_location
--classdef [filenameprefix]
--mapping_registry
--mapper
--module_path [Module::Path::Name]
--force
--quiet
__EOU__
exit 1
end

def parse_opt(getoptlong)
opt = {}
xsd = nil
begin
getoptlong.each do |name, arg|
case name
when "--xsd"
xsd = arg
when "--module_path"
opt['module_path'] = arg
when "--classdef", "--mapping_registry", "--mapper"
opt[name.sub(/^--/, '')] = arg.empty? ? nil : arg
when "--force"
opt['force'] = true
when "--quiet"
opt['quiet'] = true
else
raise ArgumentError.new("Unknown type #{ arg }")
end
end
rescue
usage_exit
end
return xsd, opt
end
end

XSD2RubyApp.new.start

0 comments on commit 7cd6edb

Please sign in to comment.