Skip to content

Commit

Permalink
Add go.mod and change ChargeBoxIdentity to string
Browse files Browse the repository at this point in the history
  • Loading branch information
eduhenke committed Feb 27, 2019
1 parent 0be0d37 commit 44ca30c
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 3 deletions.
6 changes: 6 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module github.com/eduhenke/go-ocpp

require (
github.com/google/uuid v1.1.0
github.com/sirupsen/logrus v1.3.0
)
17 changes: 17 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/google/uuid v1.1.0 h1:Jf4mxPC/ziBnoPIdpQdPJ9OeiomAUHLvxmPRSPH9m4s=
github.com/google/uuid v1.1.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/konsorten/go-windows-terminal-sequences v1.0.1 h1:mweAR1A6xJ3oS2pRaGiHgQ4OO8tzTaLawm8vnODuwDk=
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/sirupsen/logrus v1.3.0 h1:hI/7Q+DtNZ2kINb6qt/lS+IyXnHQe9e90POfeewL/ME=
github.com/sirupsen/logrus v1.3.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.2.2 h1:bSDNvY7ZPG5RlJ8otE/7V6gMiyenm9RtJ7IUVIAoJ1w=
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
golang.org/x/crypto v0.0.0-20180904163835-0709b304e793 h1:u+LnwYTOOW7Ukr/fppxEb1Nwz0AtPflrblfvUudpo+I=
golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33 h1:I6FyU15t786LL7oL/hn43zqTuEGr4PN7F4XJ1p4E3Y8=
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
3 changes: 3 additions & 0 deletions soap/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ func NewClient(url string) *Client {

// Call performs HTTP POST request
func (s *Client) Call(soapAction string, request, response interface{}) error {
if len(s.url) == 0 {
return errors.New("no URL to request")
}
envelope := toSendEnvelope{XMLNS: "http://www.w3.org/2003/05/soap-envelope"}
envelope.Header = &toSendHeader{
XMLNS: "http://www.w3.org/2005/08/addressing",
Expand Down
4 changes: 1 addition & 3 deletions soap/models.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ package soap

import (
"encoding/xml"

"github.com/eduhenke/go-ocpp/messages"
)

type Envelope receivedEnvelope
Expand Down Expand Up @@ -75,7 +73,7 @@ type toSendHeader struct {
Action string `xml:"wsa5:Action"`
MessageID string `xml:"wsa5:MessageID"`
From toSendFrom
ChargeBoxIdentity messages.ChargeBoxIdentity `xml:"urn://Ocpp/Cs/2012/06/ chargeBoxIdentity"`
ChargeBoxIdentity string `xml:"urn://Ocpp/Cs/2012/06/ chargeBoxIdentity"`
}

type toSendBody struct {
Expand Down

0 comments on commit 44ca30c

Please sign in to comment.