Documentation ¶
Index ¶
- func GetPayloadFromError(err error) []byte
- func IsFault(err error) bool
- func SetCustomEnvelope(prefix string, attrs map[string]string)
- type ArrayParams
- type Client
- type Config
- type DumpLogger
- type ErrorWithPayload
- type Fault
- type FaultError
- type HeaderParams
- type Params
- type Request
- type RequestStruct
- type Response
- type SoapBody
- type SoapEnvelope
- type SoapHeader
- type SoapParams
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetPayloadFromError ¶ added in v1.4.5
GetPayloadFromError returns the payload of a ErrorWithPayload
func IsFault ¶ added in v1.4.5
IsFault returns whether the given error is a fault error or not.
IsFault will return false when the error could not be typecasted to FaultError, because every fault error should have it's dynamic type as FaultError.
func SetCustomEnvelope ¶ added in v1.4.5
SetCustomEnvelope define customizated envelope
Types ¶
type ArrayParams ¶ added in v1.4.5
type ArrayParams [][2]interface{}
type Client ¶
type Client struct { HTTPClient *http.Client AutoAction bool URL string HeaderName string HeaderParams HeaderParams Definitions *wsdlDefinitions // Must be set before first request otherwise has no effect, minimum is 15 minutes. RefreshDefinitionsAfter time.Duration Username string Password string // contains filtered or unexported fields }
Client struct hold all the information about WSDL, request and response of the server.
func SoapClient ¶
SoapClient return new *Client to handle the requests with the WSDL
func SoapClientWithConfig ¶ added in v1.4.5
SoapClientWithConfig return new *Client to handle the requests with the WSDL
func (*Client) Call ¶
func (c *Client) Call(m string, p SoapParams) (res *Response, err error)
Call call's the method m with Params p
func (*Client) CallByStruct ¶ added in v1.4.5
func (c *Client) CallByStruct(s RequestStruct) (res *Response, err error)
CallByStruct call's by struct
type Config ¶ added in v1.4.5
type Config struct { Dump bool Logger DumpLogger }
Config config the Client
type DumpLogger ¶ added in v1.4.5
type ErrorWithPayload ¶ added in v1.4.5
type ErrorWithPayload struct { Payload []byte // contains filtered or unexported fields }
ErrorWithPayload error payload schema
type Fault ¶ added in v1.1.0
type Fault struct { Code string `xml:"faultcode"` Description string `xml:"faultstring"` Detail string `xml:"detail"` }
Fault response Fault implements Stringer interface
type FaultError ¶ added in v1.4.5
type FaultError struct {
// contains filtered or unexported fields
}
FaultError implements error interface
func (FaultError) Error ¶ added in v1.4.5
func (e FaultError) Error() string
type HeaderParams ¶ added in v1.2.0
type HeaderParams map[string]interface{}
HeaderParams holds params specific to the header
type Request ¶ added in v1.4.5
type Request struct { Method string Params SoapParams }
Request Soap Request
func NewRequest ¶ added in v1.4.5
func NewRequest(m string, p SoapParams) *Request
func NewRequestByStruct ¶ added in v1.4.5
func NewRequestByStruct(s RequestStruct) (*Request, error)
NewRequestByStruct create a new request using builder
type RequestStruct ¶ added in v1.4.5
type RequestStruct interface {
SoapBuildRequest() *Request
}
RequestStruct soap request interface
type SoapBody ¶
type SoapBody struct { XMLName struct{} `xml:"Body"` Contents []byte `xml:",innerxml"` }
SoapBody struct
type SoapEnvelope ¶
type SoapEnvelope struct { XMLName struct{} `xml:"Envelope"` Header SoapHeader Body SoapBody }
SoapEnvelope struct
type SoapHeader ¶ added in v1.2.0
type SoapHeader struct { XMLName struct{} `xml:"Header"` Contents []byte `xml:",innerxml"` }
SoapHeader struct
type SoapParams ¶ added in v1.4.5
type SoapParams interface{}
Params type is used to set the params in soap request