gosoap

package module
v0.0.0-...-42090e3 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2020 License: MIT Imports: 14 Imported by: 0

README

gosoap

Fork of golang gosoap library https://github.com/tiaguinho/gosoap with fixed error out of index array

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetPayloadFromError

func GetPayloadFromError(err error) []byte

Types

type Client

type Client struct {
	HttpClient   *http.Client
	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 informations about WSDL, request and response of the server

func SoapClient

func SoapClient(wsdl string) (*Client, error)

SoapClient return new *Client to handle the requests with the WSDL

func (*Client) Call

func (c *Client) Call(m string, p Params) (res *Response, err error)

Call call's the method m with Params p

func (*Client) CallByStruct

func (c *Client) CallByStruct(s RequestStruct) (res *Response, err error)

Call call's by struct

func (*Client) Do

func (c *Client) Do(req *Request) (res *Response, err error)

Process Soap Request

func (*Client) SetWSDL

func (c *Client) SetWSDL(wsdl string)

type ErrorWithPayload

type ErrorWithPayload struct {
	Payload []byte
	// contains filtered or unexported fields
}

type Fault

type Fault struct {
	Code        string `xml:"faultcode"`
	Description string `xml:"faultstring"`
	Detail      string `xml:"detail"`
}

Fault response

type HeaderParams

type HeaderParams map[string]interface{}

HeaderParams holds params specific to the header

type Params

type Params map[string]interface{}

Params type is used to set the params in soap request

type Request

type Request struct {
	Method string
	Params Params
}

Soap Request

func NewRequest

func NewRequest(m string, p Params) *Request

func NewRequestByStruct

func NewRequestByStruct(s RequestStruct) (*Request, error)

type RequestStruct

type RequestStruct interface {
	SoapBuildRequest() *Request
}

type Response

type Response struct {
	Body    []byte
	Header  []byte
	Payload []byte
}

Soap Response

func (*Response) Unmarshal

func (r *Response) Unmarshal(v interface{}) error

Unmarshal get the body and unmarshal into the 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

type SoapHeader struct {
	XMLName  struct{} `xml:"Header"`
	Contents []byte   `xml:",innerxml"`
}

SoapHeader struct

Jump to

Keyboard shortcuts

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