goonvif/onvif/gosoap/ws-action.go

44 lines
1.2 KiB
Go
Raw Normal View History

2024-10-31 18:22:47 +08:00
package gosoap
import (
2024-11-07 23:26:17 +08:00
xml "git.pyer.club/kingecg/goxml"
2024-10-31 18:22:47 +08:00
)
2024-11-07 23:26:17 +08:00
// Xlmns XML Scheam
2024-10-31 18:22:47 +08:00
var actionHeaders = map[string]string{
"wsnt:Subscribe": "http://docs.oasis-open.org/wsn/bw-2/NotificationProducer/SubscribeRequest",
"ResumeSubscription": "http://docs.oasis-open.org/wsn/bw-2/PausableSubscriptionManager/ResumeSubscriptionRequest",
"PauseSubscription": "http://docs.oasis-open.org/wsn/bw-2/PausableSubscriptionManager/PauseSubscriptionRequest",
"Unsubscribe": "http://docs.oasis-open.org/wsn/bw-2/PausableSubscriptionManager/UnsubscribeRequest",
"RenewRequest": "http://docs.oasis-open.org/wsn/bw-2/PausableSubscriptionManager/RenewRequest",
}
/*************************
Action Type in Header
*************************/
2024-11-07 23:26:17 +08:00
// Action type
2024-10-31 18:22:47 +08:00
type Action struct {
//XMLName xml.Name `xml:"wsse:Security"`
XMLName xml.Name `xml:"wsa:Action"`
Operation string `xml:",chardata"`
}
/*
<wsa:Action>
http://docs.oasis-open.org/wsn/bw-2/NotificationProducer/SubscribeRequest
</wsa:Action>
*/
2024-11-07 23:26:17 +08:00
// NewAction get a new Action Section
2024-10-31 18:22:47 +08:00
func NewAction(key, value string) Action {
/** Generating Nonce sequence **/
auth := Action{
2024-11-07 23:26:17 +08:00
// Created: time.Now().UTC().Format(time.RFC3339Nano),
2024-10-31 18:22:47 +08:00
}
return auth
}