Skip to content

Commit

Permalink
add xml.Name to structs with Wsdl.TargetNamespace
Browse files Browse the repository at this point in the history
  • Loading branch information
tgulacsi committed Sep 2, 2014
1 parent 6d3eed0 commit 666555d
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
"os"
"runtime"

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

const version = "v0.0.1"
Expand Down
1 change: 1 addition & 0 deletions generator/gowsdl.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ func (g *GoWsdl) genTypes() ([]byte, error) {
"stripns": stripns,
"replaceReservedWords": replaceReservedWords,
"makePublic": makePublic,
"getTargetNamespace": func() string { return g.wsdl.TargetNamespace },
}

//TODO resolve element refs in place.
Expand Down
2 changes: 2 additions & 0 deletions generator/header_tmpl.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ package {{.}}
// Do not modify
// Copyright (c) 2014, Cloudescape. All rights reserved.
import (
"encoding/xml"
"time"
gowsdl "github.com/cloudscape/gowsdl/generator"
Expand All @@ -16,4 +17,5 @@ import (
// against "unused imports"
var _ time.Time
var _ xml.Name
`
2 changes: 1 addition & 1 deletion generator/soap.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ type SoapHeader struct {
}

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

Expand Down
1 change: 1 addition & 0 deletions generator/types_tmpl.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ var typesTmpl = `
{{$name := replaceReservedWords .Name}}
{{with .ComplexType}}
type {{$name}} struct {
XMLName xml.Name ` + "`xml:\"{{getTargetNamespace}} {{$name}}\"`" + `
{{if ne .ComplexContent.Extension.Base ""}}
{{template "ComplexContent" .ComplexContent}}
{{else if ne .SimpleContent.Extension.Base ""}}
Expand Down
2 changes: 1 addition & 1 deletion generator/xsd.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

type XsdSchema struct {
XMLName xml.Name `xml:"schema"`
Tns string `xml:"xmlns tns",attr`
Tns string `xml:"xmlns tns,attr"`
Xs string `xml:"xmlns xs,attr"`
Version string `xml:"version,attr"`
TargetNamespace string `xml:"targetNamespace,attr"`
Expand Down

0 comments on commit 666555d

Please sign in to comment.