Line | |
---|
1 | # SOAP4R - SOAP Simple header item handler
|
---|
2 | # Copyright (C) 2003-2005 NAKAMURA, Hiroshi <[email protected]>.
|
---|
3 |
|
---|
4 | # This program is copyrighted free software by NAKAMURA, Hiroshi. You can
|
---|
5 | # redistribute it and/or modify it under the same terms of Ruby's license;
|
---|
6 | # either the dual license version in 2003, or any later version.
|
---|
7 |
|
---|
8 |
|
---|
9 | require 'soap/header/handler'
|
---|
10 | require 'soap/baseData'
|
---|
11 |
|
---|
12 |
|
---|
13 | module SOAP
|
---|
14 | module Header
|
---|
15 |
|
---|
16 |
|
---|
17 | class SimpleHandler < SOAP::Header::Handler
|
---|
18 | def initialize(elename)
|
---|
19 | super(elename)
|
---|
20 | end
|
---|
21 |
|
---|
22 | # Should return a Hash, String or nil.
|
---|
23 | def on_simple_outbound
|
---|
24 | nil
|
---|
25 | end
|
---|
26 |
|
---|
27 | # Given header is a Hash, String or nil.
|
---|
28 | def on_simple_inbound(header, mustunderstand)
|
---|
29 | end
|
---|
30 |
|
---|
31 | def on_outbound
|
---|
32 | h = on_simple_outbound
|
---|
33 | h ? SOAPElement.from_obj(h, elename.namespace) : nil
|
---|
34 | end
|
---|
35 |
|
---|
36 | def on_inbound(header, mustunderstand)
|
---|
37 | h = header.respond_to?(:to_obj) ? header.to_obj : header.data
|
---|
38 | on_simple_inbound(h, mustunderstand)
|
---|
39 | end
|
---|
40 | end
|
---|
41 |
|
---|
42 |
|
---|
43 | end
|
---|
44 | end
|
---|
Note:
See
TracBrowser
for help on using the repository browser.