Skip to content

Commit f3f3922

Browse files
giautmtiaguinho
authored andcommitted
fix: support import schema
close #73
1 parent 8779acb commit f3f3922

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

encode.go

+5-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,11 @@ func (c process) MarshalXML(e *xml.Encoder, _ xml.StartElement) error {
3030

3131
namespace := ""
3232
if c.Client.Definitions.Types != nil {
33-
namespace = c.Client.Definitions.Types[0].XsdSchema[0].TargetNamespace
33+
schema := c.Client.Definitions.Types[0].XsdSchema[0]
34+
namespace = schema.TargetNamespace
35+
if namespace == "" && len(schema.Imports) > 0 {
36+
namespace = schema.Imports[0].Namespace
37+
}
3438
}
3539

3640
tokens.startEnvelope()

0 commit comments

Comments
 (0)