Skip to content

Commit

Permalink
additional xmlns attributes in Envelope
Browse files Browse the repository at this point in the history
  • Loading branch information
Thaha Mohammed committed May 14, 2024
1 parent 992647b commit 241593d
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions soap/soap.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,12 @@ type SOAPEnvelopeResponse struct {
}

type SOAPEnvelope struct {
XMLName xml.Name `xml:"soap:Envelope"`
XmlNS string `xml:"xmlns:soap,attr"`
Headers []interface{} `xml:"soap:Header"`
Body SOAPBody
XMLName xml.Name `xml:"soap:Envelope"`
XmlNS string `xml:"xmlns:soap,attr"`
XmlNSWeb string `xml:"xmlns:web,attr"`
XmlNSDTO string `xml:"xmlns:dto,attr"`
Headers []interface{} `xml:"soap:Header"`
Body SOAPBody
}

type SOAPHeaderResponse struct {
Expand Down Expand Up @@ -187,6 +189,8 @@ const (
WssNsType string = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText"
mtomContentType string = `multipart/related; start-info="application/soap+xml"; type="application/xop+xml"; boundary="%s"`
XmlNsSoapEnv string = "http://schemas.xmlsoap.org/soap/envelope/"
XmlNsWebEnv string = "http://web.ws.hss.onevox.com"
XmlNsDTOEnv string = "http://dto.ws.hss.onevox.com"
)

type WSSSecurityHeader struct {
Expand Down Expand Up @@ -421,7 +425,9 @@ func (s *Client) call(ctx context.Context, soapAction string, request, response
retAttachments *[]MIMEMultipartAttachment) error {
// SOAP envelope capable of namespace prefixes
envelope := SOAPEnvelope{
XmlNS: XmlNsSoapEnv,
XmlNS: XmlNsSoapEnv,
XmlNSWeb: XmlNsWebEnv,
XmlNSDTO: XmlNsDTOEnv,
}

envelope.Headers = s.headers
Expand Down

0 comments on commit 241593d

Please sign in to comment.