Skip to content

Commit

Permalink
make SoapFault optional, don't include it in request
Browse files Browse the repository at this point in the history
  • Loading branch information
Tamás Gulácsi committed Sep 2, 2014
1 parent ae3c821 commit cf53c5c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"os"
"runtime"

gen "github.com/cloudescape/gowsdl/generator"
gen "github.com/cloudscape/gowsdl/generator"
flags "github.com/jessevdk/go-flags"
)

Expand Down
2 changes: 1 addition & 1 deletion generator/header_tmpl.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ package {{.}}
// Copyright (c) 2014, Cloudescape. All rights reserved.
import (
"time"
gowsdl "github.com/cloudescape/gowsdl/generator"
gowsdl "github.com/cloudscape/gowsdl/generator"
{{/*range .Imports*/}}
{{/*.*/}}
{{/*end*/}}
Expand Down
8 changes: 6 additions & 2 deletions generator/soap.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func init() {
type SoapEnvelope struct {
XMLName xml.Name `xml:"http://schemas.xmlsoap.org/soap/envelope/ Envelope"`
EncodingStyle string `xml:"http://schemas.xmlsoap.org/soap/encoding/ encodingStyle,attr"`
Header SoapHeader `xml:"http://schemas.xmlsoap.org/soap/envelope/ Header"`
Header SoapHeader `xml:"http://schemas.xmlsoap.org/soap/envelope/ Header,omitempty"`
Body SoapBody `xml:"http://schemas.xmlsoap.org/soap/envelope/ Body"`
}

Expand All @@ -29,7 +29,7 @@ type SoapHeader struct {

type SoapBody struct {
Body string `xml:",innerxml"`
Fault SoapFault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault"`
Fault *SoapFault `xml:"http://schemas.xmlsoap.org/soap/envelope/ Fault,omitempty"`
}

type SoapFault struct {
Expand Down Expand Up @@ -72,6 +72,10 @@ func (s *SoapClient) Call(soapAction string, request, response interface{}) erro
//encoder.Indent(" ", " ")

err = encoder.Encode(envelope)
if err == nil {
err = encoder.Flush()
}
Log.Debug("encoded", "envelope", log15.Lazy{func() string { return buffer.String() }})
if err != nil {
return err
}
Expand Down

0 comments on commit cf53c5c

Please sign in to comment.