From 6d2d5668027be16426db41beca24469dea473586 Mon Sep 17 00:00:00 2001 From: CornierKhan1 Date: Thu, 6 Sep 2018 21:24:20 +1000 Subject: [PATCH] SOAP Responses complete and up to date. --- main.go | 45 +++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 43 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index b093af0..deb49a9 100644 --- a/main.go +++ b/main.go @@ -93,10 +93,20 @@ type GRI struct { // Register 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 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() { @@ -356,7 +366,26 @@ func handler(w http.ResponseWriter, r *http.Request) { } fmt.Println(REG) fmt.Println("The request is valid! Responding...") - fmt.Fprintf(w, ``) + fmt.Fprintf(w, ` + + + + `+REG.Version+` + `+REG.DeviceId+` + `+REG.MessageId+` + `+timestamp+` + 0 + false + `+REG.AccountId+` + 00000000 + `+REG.Country+` + + 00000000 + + +`) } else { @@ -372,7 +401,19 @@ func handler(w http.ResponseWriter, r *http.Request) { } fmt.Println(UNR) fmt.Println("The request is valid! Responding...") - fmt.Fprintf(w, ``) + fmt.Fprintf(w, ` + + + + `+UNR.Version+` + `+UNR.DeviceId+` + `+UNR.MessageId+` + `+timestamp+` + 0 + false + + +`) } else { fmt.Println("Nothing sent?")