Mercurial > gemma
annotate pkg/soap/soap.go @ 5688:6281c18b109f sr-v2
Finsh serializing v2 meshes.
author | Sascha L. Teichmann <sascha.teichmann@intevation.de> |
---|---|
date | Mon, 12 Feb 2024 02:27:41 +0100 |
parents | 31973f6f5cca |
children | 6270951dda28 |
rev | line source |
---|---|
1017
a244b18cb916
Added GNU Affero General Public License.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
566
diff
changeset
|
1 // This is Free Software under GNU Affero General Public License v >= 3.0 |
a244b18cb916
Added GNU Affero General Public License.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
566
diff
changeset
|
2 // without warranty, see README.md and license for details. |
a244b18cb916
Added GNU Affero General Public License.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
566
diff
changeset
|
3 // |
a244b18cb916
Added GNU Affero General Public License.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
566
diff
changeset
|
4 // SPDX-License-Identifier: AGPL-3.0-or-later |
a244b18cb916
Added GNU Affero General Public License.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
566
diff
changeset
|
5 // License-Filename: LICENSES/AGPL-3.0.txt |
a244b18cb916
Added GNU Affero General Public License.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
566
diff
changeset
|
6 // |
a244b18cb916
Added GNU Affero General Public License.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
566
diff
changeset
|
7 // Copyright (C) 2018 by via donau |
a244b18cb916
Added GNU Affero General Public License.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
566
diff
changeset
|
8 // – Österreichische Wasserstraßen-Gesellschaft mbH |
a244b18cb916
Added GNU Affero General Public License.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
566
diff
changeset
|
9 // Software engineering by Intevation GmbH |
a244b18cb916
Added GNU Affero General Public License.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
566
diff
changeset
|
10 // |
a244b18cb916
Added GNU Affero General Public License.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
566
diff
changeset
|
11 // Author(s): |
a244b18cb916
Added GNU Affero General Public License.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
566
diff
changeset
|
12 // * Sascha L. Teichmann <sascha.teichmann@intevation.de> |
a244b18cb916
Added GNU Affero General Public License.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
566
diff
changeset
|
13 |
566
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
14 package soap |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
15 |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
16 import ( |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
17 "bytes" |
3161
6a44a89ffb51
SOAP: Added a globally configurable timeout (default 1min) till a SOAP request is canceled.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1810
diff
changeset
|
18 "context" |
566
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
19 "crypto/tls" |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
20 "encoding/xml" |
1810
7ee9bdaac336
Waterway gauge import: Added support for username/password.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1017
diff
changeset
|
21 "fmt" |
5683
31973f6f5cca
Get rid of deprecation warnings from staticcheck.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
5619
diff
changeset
|
22 "io" |
566
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
23 "math/rand" |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
24 "net" |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
25 "net/http" |
3161
6a44a89ffb51
SOAP: Added a globally configurable timeout (default 1min) till a SOAP request is canceled.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1810
diff
changeset
|
26 "sync" |
566
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
27 "time" |
3161
6a44a89ffb51
SOAP: Added a globally configurable timeout (default 1min) till a SOAP request is canceled.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1810
diff
changeset
|
28 |
6a44a89ffb51
SOAP: Added a globally configurable timeout (default 1min) till a SOAP request is canceled.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1810
diff
changeset
|
29 "gemma.intevation.de/gemma/pkg/config" |
5490
5f47eeea988d
Use own logging package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3663
diff
changeset
|
30 "gemma.intevation.de/gemma/pkg/log" |
566
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
31 ) |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
32 |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
33 type SOAPEnvelope struct { |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
34 XMLName xml.Name `xml:"http://schemas.xmlsoap.org/soap/envelope/ Envelope"` |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
35 Header *SOAPHeader |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
36 Body SOAPBody |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
37 } |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
38 |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
39 type SOAPHeader struct { |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
40 XMLName xml.Name `xml:"http://schemas.xmlsoap.org/soap/envelope/ Header"` |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
41 |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
42 Items []interface{} `xml:",omitempty"` |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
43 } |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
44 |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
45 type SOAPBody struct { |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
46 XMLName xml.Name `xml:"http://schemas.xmlsoap.org/soap/envelope/ Body"` |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
47 |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
48 Fault *SOAPFault `xml:",omitempty"` |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
49 Content interface{} `xml:",omitempty"` |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
50 } |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
51 |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
52 type SOAPFault struct { |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
53 XMLName xml.Name `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault"` |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
54 |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
55 Code string `xml:"faultcode,omitempty"` |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
56 String string `xml:"faultstring,omitempty"` |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
57 Actor string `xml:"faultactor,omitempty"` |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
58 Detail string `xml:"detail,omitempty"` |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
59 } |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
60 |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
61 const ( |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
62 // Predefined WSS namespaces to be used in |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
63 WssNsWSSE string = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
64 WssNsWSU string = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
65 WssNsType string = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText" |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
66 ) |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
67 |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
68 type WSSSecurityHeader struct { |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
69 XMLName xml.Name `xml:"http://schemas.xmlsoap.org/soap/envelope/ wsse:Security"` |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
70 XmlNSWsse string `xml:"xmlns:wsse,attr"` |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
71 |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
72 MustUnderstand string `xml:"mustUnderstand,attr,omitempty"` |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
73 |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
74 Token *WSSUsernameToken `xml:",omitempty"` |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
75 } |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
76 |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
77 type WSSUsernameToken struct { |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
78 XMLName xml.Name `xml:"wsse:UsernameToken"` |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
79 XmlNSWsu string `xml:"xmlns:wsu,attr"` |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
80 XmlNSWsse string `xml:"xmlns:wsse,attr"` |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
81 |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
82 Id string `xml:"wsu:Id,attr,omitempty"` |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
83 |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
84 Username *WSSUsername `xml:",omitempty"` |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
85 Password *WSSPassword `xml:",omitempty"` |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
86 } |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
87 |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
88 type WSSUsername struct { |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
89 XMLName xml.Name `xml:"wsse:Username"` |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
90 XmlNSWsse string `xml:"xmlns:wsse,attr"` |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
91 |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
92 Data string `xml:",chardata"` |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
93 } |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
94 |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
95 type WSSPassword struct { |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
96 XMLName xml.Name `xml:"wsse:Password"` |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
97 XmlNSWsse string `xml:"xmlns:wsse,attr"` |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
98 XmlNSType string `xml:"Type,attr"` |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
99 |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
100 Data string `xml:",chardata"` |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
101 } |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
102 |
5610
a826d84485c8
Use token server to fetch token for ERDMS requests.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
5607
diff
changeset
|
103 type Auth interface { |
a826d84485c8
Use token server to fetch token for ERDMS requests.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
5607
diff
changeset
|
104 AddAuth(request *http.Request) |
a826d84485c8
Use token server to fetch token for ERDMS requests.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
5607
diff
changeset
|
105 } |
a826d84485c8
Use token server to fetch token for ERDMS requests.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
5607
diff
changeset
|
106 |
566
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
107 type BasicAuth struct { |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
108 Login string |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
109 Password string |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
110 } |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
111 |
5610
a826d84485c8
Use token server to fetch token for ERDMS requests.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
5607
diff
changeset
|
112 func (ba *BasicAuth) AddAuth(request *http.Request) { |
5612
a9bcaac49a7e
Beware of nil interfaces.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
5610
diff
changeset
|
113 if ba != nil { |
a9bcaac49a7e
Beware of nil interfaces.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
5610
diff
changeset
|
114 request.SetBasicAuth(ba.Login, ba.Password) |
a9bcaac49a7e
Beware of nil interfaces.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
5610
diff
changeset
|
115 } |
5610
a826d84485c8
Use token server to fetch token for ERDMS requests.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
5607
diff
changeset
|
116 } |
a826d84485c8
Use token server to fetch token for ERDMS requests.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
5607
diff
changeset
|
117 |
566
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
118 type SOAPClient struct { |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
119 url string |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
120 tlsCfg *tls.Config |
5610
a826d84485c8
Use token server to fetch token for ERDMS requests.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
5607
diff
changeset
|
121 auth Auth |
566
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
122 headers []interface{} |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
123 } |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
124 |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
125 // ********** |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
126 // Accepted solution from http://stackoverflow.com/questions/22892120/how-to-generate-a-random-string-of-a-fixed-length-in-golang |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
127 // Author: Icza - http://stackoverflow.com/users/1705598/icza |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
128 |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
129 const ( |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
130 letterBytes = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789" |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
131 letterIdxBits = 6 // 6 bits to represent a letter index |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
132 letterIdxMask = 1<<letterIdxBits - 1 // All 1-bits, as many as letterIdxBits |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
133 letterIdxMax = 63 / letterIdxBits // # of letter indices fitting in 63 bits |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
134 ) |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
135 |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
136 func randStringBytesMaskImprSrc(n int) string { |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
137 src := rand.NewSource(time.Now().UnixNano()) |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
138 b := make([]byte, n) |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
139 // A src.Int63() generates 63 random bits, enough for letterIdxMax characters! |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
140 for i, cache, remain := n-1, src.Int63(), letterIdxMax; i >= 0; { |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
141 if remain == 0 { |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
142 cache, remain = src.Int63(), letterIdxMax |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
143 } |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
144 if idx := int(cache & letterIdxMask); idx < len(letterBytes) { |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
145 b[i] = letterBytes[idx] |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
146 i-- |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
147 } |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
148 cache >>= letterIdxBits |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
149 remain-- |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
150 } |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
151 return string(b) |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
152 } |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
153 |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
154 // ********** |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
155 |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
156 func NewWSSSecurityHeader(user, pass, mustUnderstand string) *WSSSecurityHeader { |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
157 hdr := &WSSSecurityHeader{XmlNSWsse: WssNsWSSE, MustUnderstand: mustUnderstand} |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
158 hdr.Token = &WSSUsernameToken{XmlNSWsu: WssNsWSU, XmlNSWsse: WssNsWSSE, Id: "UsernameToken-" + randStringBytesMaskImprSrc(9)} |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
159 hdr.Token.Username = &WSSUsername{XmlNSWsse: WssNsWSSE, Data: user} |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
160 hdr.Token.Password = &WSSPassword{XmlNSWsse: WssNsWSSE, XmlNSType: WssNsType, Data: pass} |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
161 return hdr |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
162 } |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
163 |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
164 func (b *SOAPBody) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
165 if b.Content == nil { |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
166 return xml.UnmarshalError("Content must be a pointer to a struct") |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
167 } |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
168 |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
169 var ( |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
170 token xml.Token |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
171 err error |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
172 consumed bool |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
173 ) |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
174 |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
175 Loop: |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
176 for { |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
177 if token, err = d.Token(); err != nil { |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
178 return err |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
179 } |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
180 |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
181 if token == nil { |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
182 break |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
183 } |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
184 |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
185 switch se := token.(type) { |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
186 case xml.StartElement: |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
187 if consumed { |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
188 return xml.UnmarshalError("Found multiple elements inside SOAP body; not wrapped-document/literal WS-I compliant") |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
189 } else if se.Name.Space == "http://schemas.xmlsoap.org/soap/envelope/" && se.Name.Local == "Fault" { |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
190 b.Fault = &SOAPFault{} |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
191 b.Content = nil |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
192 |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
193 err = d.DecodeElement(b.Fault, &se) |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
194 if err != nil { |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
195 return err |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
196 } |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
197 |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
198 consumed = true |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
199 } else { |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
200 if err = d.DecodeElement(b.Content, &se); err != nil { |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
201 return err |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
202 } |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
203 |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
204 consumed = true |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
205 } |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
206 case xml.EndElement: |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
207 break Loop |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
208 } |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
209 } |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
210 |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
211 return nil |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
212 } |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
213 |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
214 func (f *SOAPFault) Error() string { |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
215 return f.String |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
216 } |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
217 |
5610
a826d84485c8
Use token server to fetch token for ERDMS requests.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
5607
diff
changeset
|
218 func NewSOAPClient(url string, insecureSkipVerify bool, auth Auth) *SOAPClient { |
566
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
219 tlsCfg := &tls.Config{ |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
220 InsecureSkipVerify: insecureSkipVerify, |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
221 } |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
222 return NewSOAPClientWithTLSConfig(url, tlsCfg, auth) |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
223 } |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
224 |
5610
a826d84485c8
Use token server to fetch token for ERDMS requests.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
5607
diff
changeset
|
225 func NewSOAPClientWithTLSConfig(url string, tlsCfg *tls.Config, auth Auth) *SOAPClient { |
566
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
226 return &SOAPClient{ |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
227 url: url, |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
228 tlsCfg: tlsCfg, |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
229 auth: auth, |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
230 } |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
231 } |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
232 |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
233 func (s *SOAPClient) AddHeader(header interface{}) { |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
234 s.headers = append(s.headers, header) |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
235 } |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
236 |
5607
f2b51ac3d5cf
Modified SOAP client to fit new needs.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
5490
diff
changeset
|
237 func (s *SOAPClient) CallContext(ctx context.Context, soapAction string, request, response interface{}) error { |
f2b51ac3d5cf
Modified SOAP client to fit new needs.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
5490
diff
changeset
|
238 return s.Call(soapAction, request, response) |
f2b51ac3d5cf
Modified SOAP client to fit new needs.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
5490
diff
changeset
|
239 } |
f2b51ac3d5cf
Modified SOAP client to fit new needs.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
5490
diff
changeset
|
240 |
566
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
241 func (s *SOAPClient) Call(soapAction string, request, response interface{}) error { |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
242 envelope := SOAPEnvelope{} |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
243 |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
244 if s.headers != nil && len(s.headers) > 0 { |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
245 soapHeader := &SOAPHeader{Items: make([]interface{}, len(s.headers))} |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
246 copy(soapHeader.Items, s.headers) |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
247 envelope.Header = soapHeader |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
248 } |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
249 |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
250 envelope.Body.Content = request |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
251 buffer := new(bytes.Buffer) |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
252 |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
253 encoder := xml.NewEncoder(buffer) |
5618
57c655b93ba8
Suppress namespace for erdms.GetRisDataXML SOAP call args.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
5612
diff
changeset
|
254 encoder.Indent("", " ") |
566
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
255 |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
256 if err := encoder.Encode(envelope); err != nil { |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
257 return err |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
258 } |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
259 |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
260 if err := encoder.Flush(); err != nil { |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
261 return err |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
262 } |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
263 |
5619
f0413b20ad4d
Fixed logging
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
5618
diff
changeset
|
264 if log.DebugLogLevel >= log.GetLogLevel() { |
5618
57c655b93ba8
Suppress namespace for erdms.GetRisDataXML SOAP call args.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
5612
diff
changeset
|
265 log.Debugf("SOAP message:\n%s\n", buffer.String()) |
57c655b93ba8
Suppress namespace for erdms.GetRisDataXML SOAP call args.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
5612
diff
changeset
|
266 } |
57c655b93ba8
Suppress namespace for erdms.GetRisDataXML SOAP call args.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
5612
diff
changeset
|
267 |
566
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
268 req, err := http.NewRequest("POST", s.url, buffer) |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
269 if err != nil { |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
270 return err |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
271 } |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
272 if s.auth != nil { |
5610
a826d84485c8
Use token server to fetch token for ERDMS requests.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
5607
diff
changeset
|
273 s.auth.AddAuth(req) |
566
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
274 } |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
275 |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
276 req.Header.Add("Content-Type", "text/xml; charset=\"utf-8\"") |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
277 req.Header.Add("SOAPAction", soapAction) |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
278 |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
279 req.Header.Set("User-Agent", "gowsdl/0.1") |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
280 req.Close = true |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
281 |
3580
d38b20ccb6f9
GM import: Be more graceful when accepting measure/issue dates.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3324
diff
changeset
|
282 timeout := config.SOAPTimeout() |
d38b20ccb6f9
GM import: Be more graceful when accepting measure/issue dates.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3324
diff
changeset
|
283 |
566
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
284 tr := &http.Transport{ |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
285 TLSClientConfig: s.tlsCfg, |
3580
d38b20ccb6f9
GM import: Be more graceful when accepting measure/issue dates.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3324
diff
changeset
|
286 Dial: func(network, addr string) (net.Conn, error) { |
d38b20ccb6f9
GM import: Be more graceful when accepting measure/issue dates.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3324
diff
changeset
|
287 return net.DialTimeout(network, addr, timeout) |
d38b20ccb6f9
GM import: Be more graceful when accepting measure/issue dates.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3324
diff
changeset
|
288 }, |
566
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
289 } |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
290 |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
291 client := &http.Client{Transport: tr} |
1810
7ee9bdaac336
Waterway gauge import: Added support for username/password.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1017
diff
changeset
|
292 |
3161
6a44a89ffb51
SOAP: Added a globally configurable timeout (default 1min) till a SOAP request is canceled.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1810
diff
changeset
|
293 ctx, cancel := context.WithTimeout(context.Background(), timeout) |
6a44a89ffb51
SOAP: Added a globally configurable timeout (default 1min) till a SOAP request is canceled.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1810
diff
changeset
|
294 |
6a44a89ffb51
SOAP: Added a globally configurable timeout (default 1min) till a SOAP request is canceled.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1810
diff
changeset
|
295 var once sync.Once |
6a44a89ffb51
SOAP: Added a globally configurable timeout (default 1min) till a SOAP request is canceled.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1810
diff
changeset
|
296 |
6a44a89ffb51
SOAP: Added a globally configurable timeout (default 1min) till a SOAP request is canceled.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1810
diff
changeset
|
297 defer once.Do(cancel) |
6a44a89ffb51
SOAP: Added a globally configurable timeout (default 1min) till a SOAP request is canceled.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1810
diff
changeset
|
298 |
6a44a89ffb51
SOAP: Added a globally configurable timeout (default 1min) till a SOAP request is canceled.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1810
diff
changeset
|
299 req = req.WithContext(ctx) |
6a44a89ffb51
SOAP: Added a globally configurable timeout (default 1min) till a SOAP request is canceled.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1810
diff
changeset
|
300 |
6a44a89ffb51
SOAP: Added a globally configurable timeout (default 1min) till a SOAP request is canceled.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1810
diff
changeset
|
301 go func() { |
6a44a89ffb51
SOAP: Added a globally configurable timeout (default 1min) till a SOAP request is canceled.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1810
diff
changeset
|
302 defer once.Do(cancel) |
6a44a89ffb51
SOAP: Added a globally configurable timeout (default 1min) till a SOAP request is canceled.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1810
diff
changeset
|
303 <-ctx.Done() |
6a44a89ffb51
SOAP: Added a globally configurable timeout (default 1min) till a SOAP request is canceled.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1810
diff
changeset
|
304 }() |
6a44a89ffb51
SOAP: Added a globally configurable timeout (default 1min) till a SOAP request is canceled.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
1810
diff
changeset
|
305 |
566
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
306 res, err := client.Do(req) |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
307 if err != nil { |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
308 return err |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
309 } |
3663
f8e684108425
Be more verbose if a SOAP call fails.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3580
diff
changeset
|
310 |
f8e684108425
Be more verbose if a SOAP call fails.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3580
diff
changeset
|
311 defer res.Body.Close() |
f8e684108425
Be more verbose if a SOAP call fails.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3580
diff
changeset
|
312 |
3324
96dbfcc614be
Backed out changeset bd1385c00b59
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3321
diff
changeset
|
313 if res.StatusCode < http.StatusOK || res.StatusCode > 299 { |
5683
31973f6f5cca
Get rid of deprecation warnings from staticcheck.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
5619
diff
changeset
|
314 rawbody, err := io.ReadAll(res.Body) |
3663
f8e684108425
Be more verbose if a SOAP call fails.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3580
diff
changeset
|
315 var body string |
f8e684108425
Be more verbose if a SOAP call fails.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3580
diff
changeset
|
316 if err == nil { |
f8e684108425
Be more verbose if a SOAP call fails.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3580
diff
changeset
|
317 if len(rawbody) > 1024 { |
f8e684108425
Be more verbose if a SOAP call fails.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3580
diff
changeset
|
318 body = fmt.Sprintf("\nbody: %.1024q...", rawbody) |
f8e684108425
Be more verbose if a SOAP call fails.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3580
diff
changeset
|
319 } else { |
f8e684108425
Be more verbose if a SOAP call fails.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3580
diff
changeset
|
320 body = fmt.Sprintf("\nbody: %q", rawbody) |
f8e684108425
Be more verbose if a SOAP call fails.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3580
diff
changeset
|
321 } |
f8e684108425
Be more verbose if a SOAP call fails.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3580
diff
changeset
|
322 } |
3324
96dbfcc614be
Backed out changeset bd1385c00b59
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3321
diff
changeset
|
323 return fmt.Errorf( |
3663
f8e684108425
Be more verbose if a SOAP call fails.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3580
diff
changeset
|
324 "HTTP error: %d (%s)%s", |
f8e684108425
Be more verbose if a SOAP call fails.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3580
diff
changeset
|
325 res.StatusCode, http.StatusText(res.StatusCode), body) |
3324
96dbfcc614be
Backed out changeset bd1385c00b59
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3321
diff
changeset
|
326 } |
566
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
327 |
5683
31973f6f5cca
Get rid of deprecation warnings from staticcheck.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
5619
diff
changeset
|
328 rawbody, err := io.ReadAll(res.Body) |
566
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
329 if err != nil { |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
330 return err |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
331 } |
3324
96dbfcc614be
Backed out changeset bd1385c00b59
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3321
diff
changeset
|
332 if len(rawbody) == 0 { |
5490
5f47eeea988d
Use own logging package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3663
diff
changeset
|
333 log.Warnln("empty response") |
3324
96dbfcc614be
Backed out changeset bd1385c00b59
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3321
diff
changeset
|
334 return nil |
566
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
335 } |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
336 |
5618
57c655b93ba8
Suppress namespace for erdms.GetRisDataXML SOAP call args.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
5612
diff
changeset
|
337 log.Debugf("length response: %d\n", len(rawbody)) |
57c655b93ba8
Suppress namespace for erdms.GetRisDataXML SOAP call args.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
5612
diff
changeset
|
338 |
5490
5f47eeea988d
Use own logging package.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3663
diff
changeset
|
339 //log.Debugln(string(rawbody)) |
566
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
340 respEnvelope := new(SOAPEnvelope) |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
341 respEnvelope.Body = SOAPBody{Content: response} |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
342 err = xml.Unmarshal(rawbody, respEnvelope) |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
343 if err != nil { |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
344 return err |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
345 } |
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
346 |
3324
96dbfcc614be
Backed out changeset bd1385c00b59
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3321
diff
changeset
|
347 fault := respEnvelope.Body.Fault |
96dbfcc614be
Backed out changeset bd1385c00b59
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3321
diff
changeset
|
348 if fault != nil { |
96dbfcc614be
Backed out changeset bd1385c00b59
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3321
diff
changeset
|
349 return fault |
96dbfcc614be
Backed out changeset bd1385c00b59
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3321
diff
changeset
|
350 } |
96dbfcc614be
Backed out changeset bd1385c00b59
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3321
diff
changeset
|
351 |
96dbfcc614be
Backed out changeset bd1385c00b59
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
3321
diff
changeset
|
352 return nil |
566
5e45f441aed6
Added SOAP client for the IFBN bottleneck service.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff
changeset
|
353 } |