cancel
Showing results for 
Search instead for 
Did you mean: 

Setting a namespace for an entire message

Former Member
0 Kudos
57

Hello,

When creating a message type, it is possible to set a XML namespace for the message. But I observed that this namespace is only set for the root element an not for the entire message. The namespace is set like this in the resulting message:

<ns1:UpdateDictionaryItem xmlns:ns1 ="http://www.namespace.com">

<District>

<Name>SERV3</Name>

<RegionParent>0001</RegionParent>

</District>

</ns1:UpdateDictionaryItem>

But I would need it like this:

<ns1:UpdateDictionaryItem xmlns:ns1 ="http://www.namespace.com">

<ns1:District>

<ns1:Name>SERV3</ns1:Name>

<ns1:RegionParent>0001</ns1:RegionParent>

</ns1:District>

</ns1:UpdateDictionaryItem>

or like this:

<UpdateDictionaryItem xmlns ="http://www.namespace.com">

<District>

<Name>SERV3</Name>

<RegionParent>0001</RegionParent>

</District>

</:UpdateDictionaryItem>

Is there a way to do that?

regards,

Jens Harzer

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hello,

I tried it, but PI seems to ignore that ;). I did it like this

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.namespace.com" targetNamespace="http://www.namespace.com">

<xsd:element name="UpdateDictionaryItem">

<xsd:complexType>

<xsd:annotation>

<xsd:documentation xml:lang="EN">

UpdateDictionaryItem

</xsd:documentation>

</xsd:annotation>

<xsd:sequence>

<xsd:element name="District" xmlns="http://www.namespace.com">

<xsd:complexType>

<xsd:sequence>

<xsd:element xmlns="http://www.namespace.com" name="Key" type="xsd:integer" minOccurs="0" />

<xsd:element xmlns="http://www.namespace.com" name="Revision" type="xsd:integer" minOccurs="0" />

<xsd:element xmlns="http://www.namespace.com" name="Name" type="xsd:string" minOccurs="0" />

<xsd:element xmlns="http://www.namespace.com" name="RegionParent" type="xsd:string" minOccurs="0" />

...

and so on... Maybe I did something wrong?

stefan_grube
Active Contributor
0 Kudos

This is only possible with n external definition, which you upload to ESR/IR.