soap

package
v1.6.7 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ArgsMap

type ArgsMap []*WsdlFunctionArgs

type SoapBinding

type SoapBinding struct {
	XMLName   xml.Name `xml:"binding"`
	Style     string   `xml:"style,attr"`
	Transport string   `xml:"transport,attr"`
}

type SoapBody

type SoapBody struct {
	XMLName   xml.Name `xml:"body"`
	Namespace string   `xml:"namespace,attr"`
	Use       string   `xml:"use,attr"`
}

type SoapClient

type SoapClient struct {
	// contains filtered or unexported fields
}

func NewSoapClient

func NewSoapClient(soap_url string) (*SoapClient, error)

新建一个SOAP客户端

func NewSoapClientForContent

func NewSoapClientForContent(content string) (*SoapClient, error)

用WSDL内容新建一个SOAP客户端

func (*SoapClient) Call

func (s *SoapClient) Call(func_name string, args ...interface{}) (string, error)

func (*SoapClient) ReplaceXml

func (s *SoapClient) ReplaceXml(str string, toxml bool) string

替换XML特殊字符

func (*SoapClient) SetAddress

func (s *SoapClient) SetAddress(addr string)

重新设置调用地址

func (*SoapClient) SetOptions

func (s *SoapClient) SetOptions(key, val string)
	设置SOAP配置项
 *  配置项名称           说明                     示例值
 *  SOAP-VERSION        [SOAP 构建版本]          1.1|1.2
 *  SOAP-DEF-SERVICE    [SOAP 默认使用SERVICE]   0

func (*SoapClient) SetReturnAll

func (s *SoapClient) SetReturnAll(yes bool)

设置接口返回时是否返回全格式

type SoapMessageBody

type SoapMessageBody struct {
	XMLName xml.Name          `xml:"Body"`
	Fault   *SoapMessageFault `xml:"Fault"`
}

type SoapMessageEnvelope

type SoapMessageEnvelope struct {
	XMLName     xml.Name         `xml:"Envelope"`
	Body        *SoapMessageBody `xml:"Body"`
	BodyContent string           `xml:"Body"`
}

type SoapMessageFault

type SoapMessageFault struct {
	XMLName     xml.Name `xml:"Fault"`
	Faultcode   string   `xml:"faultcode"`
	Faultstring string   `xml:"faultstring"`
	Detail      string   `xml:"detail"`
}

type SoapOperation

type SoapOperation struct {
	XMLName    xml.Name `xml:"operation"`
	SoapAction string   `xml:"soapAction,attr"`
	Style      string   `xml:"style,attr"`
}

type Wsdl

type Wsdl struct {
	// contains filtered or unexported fields
}

func NewWsdl

func NewWsdl() *Wsdl

新建一个WSDL解释器

func (*Wsdl) Explain

func (w *Wsdl) Explain(body []byte) error

解释WSDL文件得到解构

func (*Wsdl) GetAddress

func (w *Wsdl) GetAddress(idx int) string

得到WSDL服务调用地址

func (*Wsdl) GetFunction

func (w *Wsdl) GetFunction(build_name, func_name string) *WsdlFunction

得到一个方法

type WsdlBinding

type WsdlBinding struct {
	XMLName      xml.Name         `xml:"binding"`
	Name         string           `xml:"name,attr"`
	Type         string           `xml:"type,attr"`
	Binding      *SoapBinding     `xml:"binding"`
	Operation    []*WsdlOperation `xml:"operation"`
	OperationMap map[string]*WsdlOperation
}

type WsdlComplexContent

type WsdlComplexContent struct {
	XMLName   xml.Name `xml:"complexContent"`
	Extension struct {
		Base     string `xml:"base,attr"`
		Sequence struct {
			Element []*WsdlTypeElement `xml:"element"`
		} `xml:"sequence"`
	} `xml:"extension"`
}

type WsdlComplexType

type WsdlComplexType struct {
	XMLName  xml.Name `xml:"complexType"`
	Name     string   `xml:"name,attr"`
	Sequence struct {
		Element []*WsdlTypeElement `xml:"element"`
	} `xml:"sequence"`
	ComplexContent  *WsdlComplexContent `xml:"complexContent"`
	TargetNamespace string
}

type WsdlElement

type WsdlElement struct {
	XMLName         xml.Name        `xml:"http://schemas.xmlsoap.org/wsdl/ definitions"`
	Xsd             xml.Attr        `xml:"xsd,attr"`
	Wsdl            xml.Attr        `xml:"wsdl,attr"`
	Tns             xml.Attr        `xml:"tns,attr"`
	Soap            xml.Attr        `xml:"soap,attr"`
	Nsl             xml.Attr        `xml:"nsl,attr"`
	Name            string          `xml:"name,attr"`
	TargetNamespace string          `xml:"targetNamespace,attr"`
	Types           *WsdlTypes      `xml:"types"`
	Message         []*WsdlMessage  `xml:"message"`
	PortType        []*WsdlPortType `xml:"portType"`
	Binding         []*WsdlBinding  `xml:"binding"`
	Service         *WsdlService    `xml:"service"`
}

type WsdlFunction

type WsdlFunction struct {
	Name         string            //方法名
	Action       string            //SOAP Action
	RequestArgs  *WsdlFunctionArgs //调用方法参数集合
	ResponseName string            //方法返回值名
	ResponseArgs *WsdlFunctionArgs //回调用方法参数集合
}

type WsdlFunctionArgs

type WsdlFunctionArgs struct {
	Name      string  //参数名
	Namespace string  //参数命名空间
	MinOccurs int     //最小出现个数
	MaxOccurs string  //最大出现个数
	Nillable  bool    //是否为空
	Type      string  //类型
	Elements  ArgsMap //如果type为其它类型
}

type WsdlInput

type WsdlInput struct {
	XMLName xml.Name  `xml:"input"`
	Message string    `xml:"message,attr"`
	Name    string    `xml:"name,attr"`
	Action  string    `xml:"Action,attr"`
	Body    *SoapBody `xml:"body"`
}

type WsdlMessage

type WsdlMessage struct {
	XMLName xml.Name    `xml:"message"`
	Name    string      `xml:"name,attr"`
	Parts   []*WsdlPart `xml:"part"`
}

message

type WsdlOperation

type WsdlOperation struct {
	XMLName       xml.Name       `xml:"operation"`
	Name          string         `xml:"name,attr"`
	Message       string         `xml:"message,attr"`
	Action        string         `xml:"Action,attr"`
	Input         *WsdlInput     `xml:"input"`
	Output        *WsdlOutput    `xml:"output"`
	SoapOperation *SoapOperation `xml:"operation"`
}

type WsdlOutput

type WsdlOutput struct {
	XMLName xml.Name `xml:"output"`
	Message string   `xml:"message,attr"`
	Name    string   `xml:"name,attr"`
}

type WsdlPart

type WsdlPart struct {
	XMLName xml.Name `xml:"part"`
	Name    string   `xml:"name,attr"`
	Type    string   `xml:"type,attr"`
	Element string   `xml:"element,attr"`
}

type WsdlPortType

type WsdlPortType struct {
	XMLName      xml.Name         `xml:"portType"`
	Name         string           `xml:"name,attr"`
	Operation    []*WsdlOperation `xml:"operation"`
	OperationMap map[string]*WsdlOperation
}

type WsdlSchema

type WsdlSchema struct {
	XMLName              xml.Name `xml:"schema"`
	AttributeFormDefault string   `xml:"attributeFormDefault,attr"`
	ElementFormDefault   string   `xml:"elementFormDefault,attr"`
	TargetNamespace      string   `xml:"targetNamespace,attr"`
	Import               []struct {
		XMLName   xml.Name `xml:"import"`
		Namespace string   `xml:"namespace,attr"`
	} `xml:"import"`
	ComplexType []*WsdlComplexType   `xml:"complexType"`
	Element     []*WsdlSchemaElement `xml:"element"`
}

type WsdlSchemaElement

type WsdlSchemaElement struct {
	XMLName         xml.Name         `xml:"element"`
	Name            string           `xml:"name,attr"`
	Type            string           `xml:"type,attr"`
	ComplexType     *WsdlComplexType `xml:"complexType"`
	TargetNamespace string
}

type WsdlService

type WsdlService struct {
	XMLName xml.Name `xml:"service"`
	Name    string   `xml:"name,attr"`
	Port    []struct {
		XMLName xml.Name `xml:"port"`
		Binding string   `xml:"binding,attr"`
		Name    string   `xml:"name,attr"`
		Address struct {
			XMLName  xml.Name `xml:"address"`
			Location string   `xml:"location,attr"`
		} `xml:"address"`
	} `xml:"port"`
}

type WsdlTypeElement

type WsdlTypeElement struct {
	XMLName   xml.Name `xml:"element"`
	Name      string   `xml:"name,attr"`
	MinOccurs int      `xml:"minOccurs,attr"`
	MaxOccurs string   `xml:"maxOccurs,attr"`
	Nillable  bool     `xml:"nillable,attr"`
	Type      string   `xml:"type,attr"`
}

type WsdlTypes

type WsdlTypes struct {
	XMLName xml.Name      `xml:"types"`
	Schema  []*WsdlSchema `xml:"schema"`
}

Jump to

Keyboard shortcuts

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