/
gen.go
48 lines (36 loc) · 1019 Bytes
/
gen.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
package gen
import (
"encoding/xml"
"time"
"github.com/hooklift/gowsdl/soap"
)
// against "unused imports"
var _ time.Time
var _ xml.Name
type TradePriceRequest struct {
XMLName xml.Name `xml:"http://example.com/stockquote.xsd TradePriceRequest"`
TickerSymbol string `xml:"tickerSymbol,omitempty"`
}
type TradePrice struct {
XMLName xml.Name `xml:"http://example.com/stockquote.xsd TradePrice"`
Price float32 `xml:"price,omitempty"`
}
type StockQuotePortType interface {
GetLastTradePrice(request *TradePriceRequest) (*TradePrice, error)
}
type stockQuotePortType struct {
client *soap.Client
}
func NewStockQuotePortType(client *soap.Client) StockQuotePortType {
return &stockQuotePortType{
client: client,
}
}
func (service *stockQuotePortType) GetLastTradePrice(request *TradePriceRequest) (*TradePrice, error) {
response := new(TradePrice)
err := service.client.Call("http://example.com/GetLastTradePrice", request, response)
if err != nil {
return nil, err
}
return response, nil
}