Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Multiple namespaces in XML document - cannot create structure

Hi,

I have a requirement to create a data type with the following structure :

<?xml version="1.0" encoding="UTF-8" ?>

- <ng0:SX3_XML_DOCUMENT <b>xmlns:ng0="http://www.sx3.com/sx3document" xmlns:ng1="http://www.sx3.com/CREATE_SRQ"</b> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.sx3.com/sx3document create_srq_request.xsd">

- <ng0:SX3_HEADER>

<ng0:API>String</ng0:API>

</ng0:SX3_HEADER>

<ng0:SX3_SOAP_HEADER />

- <ng0:SX3_BODY>

- <ng1:CreateSrq>

+ <ng1:cross_ref_info>

<ng1:xref_system>String</ng1:xref_system>

<ng1:xref_group>String</ng1:xref_group>

<ng1:xref_id_list>String</ng1:xref_id_list>

<ng1:xref_id>String</ng1:xref_id>

</ng1:cross_ref_info>

- <ng1:SRQ>

<ng1:PropertyReference>127WILM</ng1:PropertyReference>

<ng1:ServiceRequestNo xsi:nil="true" />

<ng1:ContactTel />

<ng1:Email />

- <ng1:Defects>

- <ng1:Defect>

<ng1:DefectCode>DATALOAD</ng1:DefectCode>

<ng1:DefectQuantity>1</ng1:DefectQuantity>

<ng1:DefectPriority>MIG</ng1:DefectPriority>

<ng1:DefectLocation />

<ng1:DefectNotes />

</ng1:Defect>

</ng1:Defects>

- <ng1:Sors>

- <ng1:Sor>

<ng1:SorCode>001101</ng1:SorCode>

<ng1:SorQuantiy>1</ng1:SorQuantiy>

<ng1:SorLocation />

</ng1:Sor>

</ng1:Sors>

<ng1:AccessAm>NNYYYNN</ng1:AccessAm>

<ng1:AccessPm>NNYYYNN</ng1:AccessPm>

<ng1:Description />

<ng1:LocationNotes>TEST</ng1:LocationNotes>

<ng1:AccessNotes />

<ng1:LocationCode />

<ng1:AccessCode />

<ng1:CausedBy />

<ng1:Role />

<ng1:ReportedBy />

<ng1:HomeTel />

<ng1:ReportedDate xsi:nil="true" />

<ng1:ReportedMethod />

<ng1:Priority>MIG</ng1:Priority>

<ng1:Notes />

<ng1:AlternativeReference />

<ng1:RtrIndicator>Y</ng1:RtrIndicator>

<ng1:RechargeApplicable>Y</ng1:RechargeApplicable>

<ng1:LegacyReference />

<ng1:VariableWarning>Y</ng1:VariableWarning>

<ng1:CreatedBy />

</ng1:SRQ>

</ng1:CreateSrq>

</ng0:SX3_BODY>

</ng0:SX3_XML_DOCUMENT>

As you can see there are two namespaces. One for the common header fields (ng0) and one for the body fields (ng1)

How should this be represented in the XML namespace on the Message Type ?

Also how should the elements be named on the data type to make sure they know which namespace they belong to ?

For example: how should the field Role be set in the data type bearing in mind in belongs to the ng1 namespace.

Hope this is clear.

Any help appreciated.

Cheers

Colin.

Not what you were looking for? View more on this topic or Ask a question