Fork it. Pull it. Build it. Twist it. Bop it.

This commit is contained in:
CornierKhan1 2018-10-15 21:28:12 +11:00
parent 51f489ddc5
commit c5454ab7c2
3 changed files with 95 additions and 79 deletions

View File

@ -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.

76
main.go
View File

@ -35,80 +35,6 @@ const (
Header = `<?xml version="1.0" encoding="UTF-8"?>` + "\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")
}

94
structure.go Normal file
View File

@ -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"`
}