soap

package
v2.2.0+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 1, 2017 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Overview

Package soap provides a SOAP HTTP client.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthHeader

type AuthHeader struct {
	Namespace string `xml:"xmlns:ns,attr"`
	Username  string `xml:"ns:username"`
	Password  string `xml:"ns:password"`
}

AuthHeader is a Header to be encoded as the SOAP Header element in requests, to convey credentials for authentication.

type Body

type Body struct {
	XMLName xml.Name `xml:"SOAP-ENV:Body"`
	Message Message
}

Body is the body of a SOAP envelope.

type Client

type Client struct {
	URL         string // URL of the server
	Namespace   string // SOAP Namespace
	Envelope    string // Optional SOAP Envelope
	Header      Header // Optional SOAP Header
	ContentType string // Optional Content-Type (default text/xml)
	//ResilientClient *pester.Client      // Optional pestor client
	//Config          *http.Client        // Optional HTTP client
	ResilientClient HttpClient          // Optional pestor client
	Config          HttpClient          // Optional HTTP client
	Pre             func(*http.Request) // Optional hook to modify outbound requests
}

Client is a SOAP client.

func (*Client) RoundTrip

func (c *Client) RoundTrip(in, out Message) error

RoundTrip implements the RoundTripper interface.

func (*Client) UseResiliencyLibrary

func (c *Client) UseResiliencyLibrary()

UseResiliencyLibrary sets a new pester client with built in request resiliency.

type Envelope

type Envelope struct {
	XMLName      xml.Name `xml:"SOAP-ENV:Envelope"`
	EnvelopeAttr string   `xml:"xmlns:SOAP-ENV,attr"`
	NSAttr       string   `xml:"xmlns:ns,attr"`
	Header       Message  `xml:"SOAP-ENV:Header"`
	Body         Body
}

Envelope is a SOAP envelope.

type Header interface{}

Header is an opaque type used as the SOAP Header element in requests.

type HttpClient

type HttpClient interface {
	//func (c *Client) Do(req *http.Request) (resp *http.Response, err error) {
	//func (c *Client) Do(req *Request) (*Response, error) {
	Do(req *http.Request) (*http.Response, error)
}

type Message

type Message interface{}

Message is an opaque type used by the RoundTripper to carry XML documents for SOAP.

type RoundTripper

type RoundTripper interface {
	RoundTrip(req, resp Message) error
}

A RoundTripper executes a request passing the given req as the SOAP envelope body. The HTTP response is then de-serialized onto the resp object. Returns error in case an error occurs serializing req, making the HTTP request, or de-serializing the response.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL