mirror of
https://wiilab.wiimart.org/wiimart/WiiSOAP
synced 2025-09-05 21:11:02 +02:00
not working, but its something
This commit is contained in:
parent
0842985b84
commit
958a3605f1
13
main.go
13
main.go
@ -1,7 +1,9 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"encoding/xml"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
@ -23,9 +25,13 @@ type Check struct {
|
||||
}
|
||||
|
||||
func main() {
|
||||
|
||||
file, err := ioutil.ReadFile("SOAP-WSC/ECS/checkDeviceStatus.xml")
|
||||
// ChRes is a variable that's in the form of JSON. This organises all the data into sub-variables like ChRes.CDS.
|
||||
// This is probably my favourite thing in GoLang to be honest.
|
||||
if err != nil {
|
||||
panic(err)
|
||||
return
|
||||
}
|
||||
ChRes := Check{
|
||||
CDS: "",
|
||||
LET: "",
|
||||
@ -36,6 +42,11 @@ func main() {
|
||||
REG: "",
|
||||
UNR: "",
|
||||
}
|
||||
err = xml.Unmarshal(file, &ChRes)
|
||||
if err != nil {
|
||||
fmt.Printf("error: %v", err)
|
||||
return
|
||||
}
|
||||
fmt.Println(ChRes)
|
||||
|
||||
// http.ListenAndServe starts a HTTP server, which is important to take note of as we will be using this to deliver the SOAP.
|
||||
|
Loading…
x
Reference in New Issue
Block a user