Skip to content

Commit

Permalink
Merge pull request #19 from swordbeta/correctly_format_package_names
Browse files Browse the repository at this point in the history
Strip out any dots in the WSDL binding for the package name.
  • Loading branch information
fiorix authored Nov 24, 2016
2 parents 94417da + 526199f commit 236b28c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion wsdlgo/encoder.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ func (ge *goEncoder) encode(w io.Writer, d *wsdl.Definitions) error {
ge.cacheFuncs(d)
ge.cacheMessages(d)
ge.cacheSOAPOperations(d)
pkg := strings.ToLower(d.Binding.Name)
pkg := ge.formatPackageName(d.Binding.Name)
if pkg == "" {
pkg = "internal"
}
Expand Down Expand Up @@ -200,6 +200,10 @@ func (ge *goEncoder) encode(w io.Writer, d *wsdl.Definitions) error {
return err
}

func (ge *goEncoder) formatPackageName(pkg string) string {
return strings.Replace(strings.ToLower(pkg), ".", "", -1)
}

func (ge *goEncoder) importParts(d *wsdl.Definitions) error {
err := ge.importRoot(d)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion wsdlgo/testdata/memcache.wsdl
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
</operation>
</portType>

<binding name="MemoryService" type="tns:MemoryServicePortType">
<binding name="Memory.Service" type="tns:MemoryServicePortType">
<soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="Get">
<soap:operation soapAction="Get"/>
Expand Down

0 comments on commit 236b28c

Please sign in to comment.