Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug/single client #158

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Next Next commit
..
  • Loading branch information
yves-bourgeois committed Feb 22, 2019
commit 025c77c0a5edafaa2c2a56318da922d78063ab04
2 changes: 1 addition & 1 deletion cmd/gowsdl/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ import (
"log"
"os"

gen "github.com/hooklift/gowsdl"
gen "github.com/factrylabs/gowsdl"
)

// Version is initialized in compilation time by go build.
Expand Down
4 changes: 2 additions & 2 deletions example/example.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (
"log"
"time"

"github.com/hooklift/gowsdl/example/gen"
"github.com/hooklift/gowsdl/soap"
"github.com/factrylabs/gowsdl/example/gen"
"github.com/factrylabs/gowsdl/soap"
)

func ExampleBasicUsage() {
Expand Down
2 changes: 1 addition & 1 deletion example/gen/gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"encoding/xml"
"time"

"github.com/hooklift/gowsdl/soap"
"github.com/factrylabs/gowsdl/soap"
)

// against "unused imports"
Expand Down
6 changes: 3 additions & 3 deletions gowsdl.go
Original file line number Diff line number Diff line change
Expand Up @@ -386,9 +386,9 @@ var xsd2GoTypes = map[string]string{
"byte": "int8",
"long": "int64",
"boolean": "bool",
"datetime": "time.Time",
"date": "time.Time",
"time": "time.Time",
"datetime": "*customTimestamp",
"date": "*customTimestamp",
"time": "*customTimestamp",
"base64binary": "[]byte",
"hexbinary": "[]byte",
"unsignedint": "uint32",
Expand Down
36 changes: 35 additions & 1 deletion header_tmpl.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 9 additions & 13 deletions soap/soap.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ import (
"crypto/tls"
"encoding/xml"
"io/ioutil"
"net"
"net/http"
"time"

ntlmssp "github.com/Azure/go-ntlmssp"
)

type SOAPEnvelope struct {
Expand Down Expand Up @@ -283,18 +284,13 @@ func (s *Client) Call(soapAction string, request, response interface{}) error {
req.Header.Set(k, v)
}
}
req.Close = true

client := s.opts.client
if client == nil {
tr := &http.Transport{
TLSClientConfig: s.opts.tlsCfg,
Dial: func(network, addr string) (net.Conn, error) {
return net.DialTimeout(network, addr, s.opts.timeout)
},
TLSHandshakeTimeout: s.opts.tlshshaketimeout,
}
client = &http.Client{Timeout: s.opts.contimeout, Transport: tr}
// req.Close = true YB: Don't close the request header

// YB: Use ntlmssp as a transport
client := &http.Client{
Transport: ntlmssp.Negotiator{
RoundTripper: &http.Transport{},
},
}

res, err := client.Do(req)
Expand Down