From 4ffe90a02e78e8b36d7c27c058085a97d2bfc860 Mon Sep 17 00:00:00 2001 From: Aashish KC Date: Fri, 19 Aug 2022 13:42:11 +0545 Subject: [PATCH] fix: use right targetNamespace duing request marshal During request marshal the namespace is not set correctly. Instead of using from xsd:schema targetNamespace, it now uses the namespace from wsld definitions. Fixes: #48 --- encode.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/encode.go b/encode.go index 8487ea0..233bea7 100644 --- a/encode.go +++ b/encode.go @@ -31,7 +31,7 @@ func (c process) MarshalXML(e *xml.Encoder, _ xml.StartElement) error { namespace := "" if c.Client.Definitions.Types != nil { schema := c.Client.Definitions.Types[0].XsdSchema[0] - namespace = schema.TargetNamespace + namespace = c.Client.Definitions.TargetNamespace if namespace == "" && len(schema.Imports) > 0 { namespace = schema.Imports[0].Namespace }