Author |
Message
|
nize |
Posted: Thu Oct 07, 2010 1:19 am Post subject: namespace and mapping node |
|
|
Voyager
Joined: 02 Sep 2009 Posts: 90
|
Hi,
I have developed a WSDL together with referenced XSDs. From the WSDL I generated a message set and deployed to a message flow. In the message flow I take the SOAP request and invoke a JMS service. The response from the JMS service is read by a MQGet node. I transform the response to SOAP using a mapping node. The SOAP response returned to the originating requester is correct. However, I would have liked to have a declaration of the namespace prefixes so that they dont need to be declared over and over again (see for example
Is there any way to do this in the mapping node or do I need to use a compute node? See this messy SOAP response!
Code: |
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<NS1:GetSparePartResponse xmlns:NS1="http://xmlns.rumbio.com/spareparts/contract/sparepart/v1">
<SparePart>
<NS2:PartId xmlns:NS2="http://xmlns.rumbio.com/spareparts/schema/sparepart/v1">1</NS2:PartId>
<NS3:PartDescription xmlns:NS3="http://xmlns.rumbio.com/spareparts/schema/sparepart/v1">GROF</NS3:PartDescription>
<NS4:SparePartWeight xmlns:NS4="http://xmlns.rumbio.com/spareparts/schema/sparepart/v1">1.389</NS4:SparePartWeight>
<NS5:Suppliers xmlns:NS5="http://xmlns.rumbio.com/spareparts/schema/sparepart/v1">
<NS5:MainSupplier>
<NS5:ShortSupplierId>9150</NS5:ShortSupplierId>
</NS5:MainSupplier>
<NS5:CurrentSupplier>
<NS5:ShortSupplierId>9150</NS5:ShortSupplierId>
</NS5:CurrentSupplier>
</NS5:Suppliers>
<NS6:CurrentWareHouse xmlns:NS6="http://xmlns.rumbio.com/spareparts/schema/sparepart/v1">
<NS6:CWStatus>1</NS6:CWStatus>
<NS6:StockBalance>0</NS6:StockBalance>
<NS6:IntroductionDate>
<NS7:Year xmlns:NS7="http://xmlns.rumbio.com/common/schema/time/v1">1996</NS7:Year>
<NS8:Month xmlns:NS8="http://xmlns.rumbio.com/common/schema/time/v1">6</NS8:Month>
</NS6:IntroductionDate>
</NS6:CurrentWareHouse>
<NS9:SubstitutionInformation xmlns:NS9="http://xmlns.rumbio.com/spareparts/schema/sparepart/v1">
<NS9:SubstitutionCode>0</NS9:SubstitutionCode>
</NS9:SubstitutionInformation>
<NS10:Purchaser xmlns:NS10="http://xmlns.rumbio.com/spareparts/schema/sparepart/v1">
<NS10:PurchaserId>R2D2</NS10:PurchaserId>
<NS10:PurchaserName>Mick</NS10:PurchaserName>
</NS10:Purchaser>
<NS11:SparePartDeveloper xmlns:NS11="http://xmlns.rumbio.com/spareparts/schema/sparepart/v1">
<NS11:SparePartDeveloperCode>4</NS11:SparePartDeveloperCode>
<NS11:SparePartDeveloperName>Ray</NS11:SparePartDeveloperName>
</NS11:SparePartDeveloper>
</SparePart>
</NS1:GetSparePartResponse>
</soapenv:Body>
</soapenv:Envelope> |
|
|
Back to top |
|
 |
kimbert |
Posted: Thu Oct 07, 2010 4:38 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
|
Back to top |
|
 |
nize |
Posted: Thu Oct 07, 2010 4:50 am Post subject: |
|
|
Voyager
Joined: 02 Sep 2009 Posts: 90
|
Thanks! Does this mean that people doesn't bother of having multiple prefix declarations or does it mean that people tend to use compute nodes? |
|
Back to top |
|
 |
mqjeff |
Posted: Thu Oct 07, 2010 5:14 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
nize wrote: |
Thanks! Does this mean that people doesn't bother of having multiple prefix declarations or does it mean that people tend to use compute nodes? |
It means that the mapping node is responsible for the way your message is being output, and does not provide the level of control over the message structure that you're looking for, and thus you need to use a compute node to accomplish your design. Because the compute node *does* provide the level of control you're looking for. |
|
Back to top |
|
 |
Vitor |
Posted: Thu Oct 07, 2010 5:32 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
nize wrote: |
does it mean that people tend to use compute nodes? |
 _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
fjb_saper |
Posted: Thu Oct 07, 2010 7:06 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
nize wrote: |
Thanks! Does this mean that people doesn't bother of having multiple prefix declarations or does it mean that people tend to use compute nodes? |
It means that XML does not care about single or multiple definition of the name space as it makes no difference to a machine driven parser/serializer.
It is us poor humans, who are looking for a more simple way.
Follow mqjeff's advice.
Have fun  _________________ MQ & Broker admin |
|
Back to top |
|
 |
mqjeff |
Posted: Thu Oct 07, 2010 8:39 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
fjb_saper wrote: |
Follow mqjeff's advice. |
Kimbert's advice.
My explanation. |
|
Back to top |
|
 |
nize |
Posted: Thu Oct 07, 2010 10:49 pm Post subject: |
|
|
Voyager
Joined: 02 Sep 2009 Posts: 90
|
Thanks for all input! It is a shame though. The mapping node has other advantages such as the implicit loop handling and the graphical interface. |
|
Back to top |
|
 |
crossland |
Posted: Fri Oct 08, 2010 12:58 am Post subject: |
|
|
Master
Joined: 26 Jun 2001 Posts: 248
|
nize wrote: |
Thanks for all input! It is a shame though. The mapping node has other advantages such as the implicit loop handling and the graphical interface. |
However, the code that has been written by a human in a Compute node SHOULD be better than that generated by the Mapping node. |
|
Back to top |
|
 |
|