Documentation
¶
Index ¶
- Constants
- Variables
- func FilterEmptyTags(w io.Writer, r io.Reader) error
- func FindBody(dec *xml.Decoder) (xml.StartElement, error)
- func NewSOAPHandler(config SOAPHandlerConfig) soapHandler
- func SOAPCall(ctx context.Context, destURL, action string, reqBody string, resp interface{}, ...) error
- func SOAPCallWithHeader(ctx context.Context, destURL string, customizeRequest func(*http.Request), ...) error
- func SOAPCallWithHeaderClient(ctx context.Context, client *http.Client, destURL string, ...) error
- func Ungzb64(s string) string
- type Annotation
- type SOAPFault
- type SOAPHandlerConfig
Constants ¶
View Source
const ( SOAPHeader = `` /* 130-byte string literal not displayed */ SOAPBody = `</soapenv:Header><soapenv:Body>` )
Variables ¶
View Source
var (
DefaultCallTimeout = time.Minute
)
View Source
var DefaultTimeout = 5 * time.Minute
Functions ¶
func FindBody ¶
func FindBody(dec *xml.Decoder) (xml.StartElement, error)
FindBody will find the first StartElement after soap:Body.
func NewSOAPHandler ¶ added in v0.17.0
func NewSOAPHandler(config SOAPHandlerConfig) soapHandler
func SOAPCall ¶ added in v0.9.0
func SOAPCall(ctx context.Context, destURL, action string, reqBody string, resp interface{}, logger *slog.Logger) error
SOAPCall destURL with SOAPAction=action, decoding the response body into resp.
func SOAPCallWithHeader ¶ added in v0.11.0
func SOAPCallWithHeader(ctx context.Context, destURL string, customizeRequest func(*http.Request), customizeResponse func(*http.Response), action, soapHeader, reqBody string, resp interface{}, logger *slog.Logger, ) error
SOAPCallWithHeader calls with the given SOAP- and extra header and action.
func SOAPCallWithHeaderClient ¶ added in v0.11.1
func SOAPCallWithHeaderClient(ctx context.Context, client *http.Client, destURL string, customizeRequest func(req *http.Request), customizeResponse func(resp *http.Response), action, soapHeader, reqBody string, resp interface{}, logger *slog.Logger, ) error
SOAPCallWithHeader calls with the given SOAP- and extra header and action.
Types ¶
type Annotation ¶ added in v0.3.0
type SOAPFault ¶ added in v0.4.6
type SOAPFault struct {
XMLName xml.Name `xml:"Fault"`
Code string `xml:"faultcode"`
String string `xml:"faultstring"`
Actor string `xml:"faultactor,omitempty"`
Detail string `xml:"detail>ExceptionDetail,omitempty"`
}
SOAPFault fault
func (SOAPFault) MarshalXML ¶ added in v0.19.5
type SOAPHandlerConfig ¶ added in v0.17.0
type SOAPHandlerConfig struct {
grpcer.Client `json:"-"`
*slog.Logger `json:"-"`
GetLogger func(ctx context.Context) *slog.Logger
DecodeInput func(*string, *xml.Decoder, *xml.StartElement) (interface{}, error) `json:"-"`
EncodeOutput func(*xml.Encoder, interface{}) error `json:"-"`
DecodeHeader func(context.Context, *xml.Decoder, *xml.StartElement) (context.Context, func(context.Context, io.Writer, error) error, error) `json:"-"`
LogRequest func(context.Context, string, error)
WSDL string
Locations []string
Timeout time.Duration
}
SOAPHandlerConfig is the configuration for NewSOAPHandler
Click to show internal directories.
Click to hide internal directories.