From c5454ab7c2de6e012d09b9faa35cc2758b4bea21 Mon Sep 17 00:00:00 2001 From: CornierKhan1 Date: Mon, 15 Oct 2018 21:28:12 +1100 Subject: [PATCH] Fork it. Pull it. Build it. Twist it. Bop it. --- README.md | 4 --- main.go | 76 +----------------------------------------- structure.go | 94 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 95 insertions(+), 79 deletions(-) create mode 100644 structure.go diff --git a/README.md b/README.md index cc91227..f267465 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,5 @@ # SOAP-GO-OSC Open Shop Channel's SOAP Server, designed specifically to handle Wii Shop Channel SOAP. -## I wanna fork just because I can! -Please refrain from forking if you don't plan on contributing, tinkering or working with it. -It only just makes unnecessary messiness. - ## What's the difference between this repo and that other SOAP repo? This is the SOAP Server Software. The other repository only has the communication templates between a Wii and WSC's server. diff --git a/main.go b/main.go index 8baf946..81e0021 100644 --- a/main.go +++ b/main.go @@ -35,80 +35,6 @@ const ( Header = `` + "\n" ) -///////////////////// -// SOAP STRUCTURES // -///////////////////// -// The structures may seem repetitive and redundant, but blame WSC's inconsistent SOAP requests. - -// CheckDeviceStatus -type CDS struct { - XMLName xml.Name `xml:"Envelope"` - Version string `xml:"Body>CheckDeviceStatus>Version"` - DeviceId string `xml:"Body>CheckDeviceStatus>DeviceId"` - MessageId string `xml:"Body>CheckDeviceStatus>MessageId"` -} - -// NotifiedETicketsSynced -type NETS struct { - XMLName xml.Name `xml:"Envelope"` - Version string `xml:"Body>NotifiedETicketsSynced>Version"` - DeviceId string `xml:"Body>NotifiedETicketsSynced>DeviceId"` - MessageId string `xml:"Body>NotifiedETicketsSynced>MessageId"` -} - -// ListETickets -type LET struct { - XMLName xml.Name `xml:"Envelope"` - Version string `xml:"Body>ListETickets>Version"` - DeviceId string `xml:"Body>ListETickets>DeviceId"` - MessageId string `xml:"Body>ListETickets>MessageId"` -} - -// PurchaseTitle -type PT struct { - XMLName xml.Name `xml:"Envelope"` - Version string `xml:"Body>PurchaseTitle>Version"` - DeviceId string `xml:"Body>PurchaseTitle>DeviceId"` - MessageId string `xml:"Body>PurchaseTitle>MessageId"` -} - -// CheckRegistration -type CR struct { - XMLName xml.Name `xml:"Envelope"` - Version string `xml:"Body>CheckRegistration>Version"` - DeviceId string `xml:"Body>CheckRegistration>DeviceId"` - MessageId string `xml:"Body>CheckRegistration>MessageId"` - SerialNo string `xml:"Body>CheckRegistration>SerialNumber"` -} - -// GetRegistrationInfo -type GRI struct { - XMLName xml.Name `xml:"Envelope"` - Version string `xml:"Body>GetRegistrationInfo>Version"` - DeviceId string `xml:"Body>GetRegistrationInfo>DeviceId"` - MessageId string `xml:"Body>GetRegistrationInfo>MessageId"` - AccountId string `xml:"Body>GetRegistrationInfo>AccountId"` - Country string `xml:"Body>GetRegistrationInfo>Country"` -} - -// 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() { fmt.Println("Starting HTTP connection (Port 2018)...") fmt.Println("NOTICE: The SOAP Server runs under a port that doesn't work with WSC naturally.") @@ -427,5 +353,5 @@ func handler(w http.ResponseWriter, r *http.Request) { } } - fmt.Println("-=End of Request.=-"+"\n") + fmt.Println("-=End of Request.=-" + "\n") } diff --git a/structure.go b/structure.go new file mode 100644 index 0000000..6aa97a5 --- /dev/null +++ b/structure.go @@ -0,0 +1,94 @@ +package main + +import "encoding/xml" + +// Copyright (C) 2018 CornierKhan1 +// +// SOAP-GO-OSC is Open Shop Channel's SOAP Server Software, designed specifically to handle Wii Shop Channel SOAP. +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as published +// by the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see http://www.gnu.org/licenses/. + +///////////////////// +// SOAP STRUCTURES // +///////////////////// +// The structures may seem repetitive and redundant, but blame WSC's inconsistent SOAP requests. + +// CheckDeviceStatus +type CDS struct { + XMLName xml.Name `xml:"Envelope"` + Version string `xml:"Body>CheckDeviceStatus>Version"` + DeviceId string `xml:"Body>CheckDeviceStatus>DeviceId"` + MessageId string `xml:"Body>CheckDeviceStatus>MessageId"` +} + +// NotifiedETicketsSynced +type NETS struct { + XMLName xml.Name `xml:"Envelope"` + Version string `xml:"Body>NotifiedETicketsSynced>Version"` + DeviceId string `xml:"Body>NotifiedETicketsSynced>DeviceId"` + MessageId string `xml:"Body>NotifiedETicketsSynced>MessageId"` +} + +// ListETickets +type LET struct { + XMLName xml.Name `xml:"Envelope"` + Version string `xml:"Body>ListETickets>Version"` + DeviceId string `xml:"Body>ListETickets>DeviceId"` + MessageId string `xml:"Body>ListETickets>MessageId"` +} + +// PurchaseTitle +type PT struct { + XMLName xml.Name `xml:"Envelope"` + Version string `xml:"Body>PurchaseTitle>Version"` + DeviceId string `xml:"Body>PurchaseTitle>DeviceId"` + MessageId string `xml:"Body>PurchaseTitle>MessageId"` +} + +// CheckRegistration +type CR struct { + XMLName xml.Name `xml:"Envelope"` + Version string `xml:"Body>CheckRegistration>Version"` + DeviceId string `xml:"Body>CheckRegistration>DeviceId"` + MessageId string `xml:"Body>CheckRegistration>MessageId"` + SerialNo string `xml:"Body>CheckRegistration>SerialNumber"` +} + +// GetRegistrationInfo +type GRI struct { + XMLName xml.Name `xml:"Envelope"` + Version string `xml:"Body>GetRegistrationInfo>Version"` + DeviceId string `xml:"Body>GetRegistrationInfo>DeviceId"` + MessageId string `xml:"Body>GetRegistrationInfo>MessageId"` + AccountId string `xml:"Body>GetRegistrationInfo>AccountId"` + Country string `xml:"Body>GetRegistrationInfo>Country"` +} + +// 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"` +}