mirror of
https://wiilab.wiimart.org/wiimart/WiiSOAP
synced 2025-09-05 21:11:02 +02:00
SOAP Responses complete and up to date.
This commit is contained in:
parent
eb9b096daa
commit
6d2d566802
45
main.go
45
main.go
@ -93,10 +93,20 @@ type GRI struct {
|
|||||||
|
|
||||||
// Register
|
// Register
|
||||||
type REG struct {
|
type REG struct {
|
||||||
|
XMLName xml.Name `xml:"Envelope"`
|
||||||
|
Version string `xml:"Body>Register>Version"`
|
||||||
|
DeviceId string `xml:"Body>Register>DeviceId"`
|
||||||
|
MessageId string `xml:"Body>Register>MessageId"`
|
||||||
|
AccountId string `xml:"Body>Register>AccountId"`
|
||||||
|
Country string `xml:"Body>Register>Country"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Unregister
|
// Unregister
|
||||||
type UNR struct {
|
type UNR struct {
|
||||||
|
XMLName xml.Name `xml:"Envelope"`
|
||||||
|
Version string `xml:"Body>Unregister>Version"`
|
||||||
|
DeviceId string `xml:"Body>Unregister>DeviceId"`
|
||||||
|
MessageId string `xml:"Body>Unregister>MessageId"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
@ -356,7 +366,26 @@ func handler(w http.ResponseWriter, r *http.Request) {
|
|||||||
}
|
}
|
||||||
fmt.Println(REG)
|
fmt.Println(REG)
|
||||||
fmt.Println("The request is valid! Responding...")
|
fmt.Println("The request is valid! Responding...")
|
||||||
fmt.Fprintf(w, ``)
|
fmt.Fprintf(w, `<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
|
||||||
|
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||||
|
<soapenv:Body>
|
||||||
|
<RegisterResponse xmlns="urn:ias.wsapi.broadon.com">
|
||||||
|
<Version>`+REG.Version+`</Version>
|
||||||
|
<DeviceId>`+REG.DeviceId+`</DeviceId>
|
||||||
|
<MessageId>`+REG.MessageId+`</MessageId>
|
||||||
|
<TimeStamp>`+timestamp+`</TimeStamp>
|
||||||
|
<ErrorCode>0</ErrorCode>
|
||||||
|
<ServiceStandbyMode>false</ServiceStandbyMode>
|
||||||
|
<AccountId>`+REG.AccountId+`</AccountId>
|
||||||
|
<DeviceToken>00000000</DeviceToken>
|
||||||
|
<Country>`+REG.Country+`</Country>
|
||||||
|
<ExtAccountId></ExtAccountId>
|
||||||
|
<DeviceCode>00000000</DeviceCode>
|
||||||
|
</RegisterResponse>
|
||||||
|
</soapenv:Body>
|
||||||
|
</soapenv:Envelope>`)
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
@ -372,7 +401,19 @@ func handler(w http.ResponseWriter, r *http.Request) {
|
|||||||
}
|
}
|
||||||
fmt.Println(UNR)
|
fmt.Println(UNR)
|
||||||
fmt.Println("The request is valid! Responding...")
|
fmt.Println("The request is valid! Responding...")
|
||||||
fmt.Fprintf(w, ``)
|
fmt.Fprintf(w, `<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||||
|
<soapenv:Body>
|
||||||
|
<UnregisterResponse xmlns="urn:ias.wsapi.broadon.com">
|
||||||
|
<Version>`+UNR.Version+`</Version>
|
||||||
|
<DeviceId>`+UNR.DeviceId+`</DeviceId>
|
||||||
|
<MessageId>`+UNR.MessageId+`</MessageId>
|
||||||
|
<TimeStamp>`+timestamp+`</TimeStamp>
|
||||||
|
<ErrorCode>0</ErrorCode>
|
||||||
|
<ServiceStandbyMode>false</ServiceStandbyMode>
|
||||||
|
</UnregisterResponse>
|
||||||
|
</soapenv:Body>
|
||||||
|
</soapenv:Envelope>`)
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
fmt.Println("Nothing sent?")
|
fmt.Println("Nothing sent?")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user