Five Stars

How to use Hmap - JSON to XML

How to setup HMap to be able to create the XML from the following JSON?

Untitled.png

 

Input JSON

{
	"documentSection":{
		"documentStatus": 1,
		"documentNumber": "9300806055"
	},
	"partnerSection": {
		"partner_role_ag": {
			"partnerRole": "AG",
			"contactFirstName": "Mario"
		},
		"partner_role_lf": {
			"partnerRole": "LF",
			"contactFirstName": "Anna"
		},
		"partner_role_we": {
			"partnerRole": "WE",
			"contactFirstName": "Mia"
		}
	}
}

Output XML:

<ORDER>
	<HEAD>
		<DOC_STATUS>1</DOC_STATUS>
		<DOC_NO>9300806055</DOC_NO>
		<PARTY>
			<PARTNER_ROLE>AG</PARTNER_ROLE>
			<NAME1>Mario</NAME1>
		</PARTY>
		<PARTY>
			<PARTNER_ROLE>LF</PARTNER_ROLE>
			<NAME1>Anna</NAME1>
		</PARTY>
		<PARTY>
			<PARTNER_ROLE>WE</PARTNER_ROLE>
			<NAME1>Mia</NAME1>
		</PARTY>
	</HEAD>
</ORDER>

 

  • ESB
1 ACCEPTED SOLUTION

Accepted Solutions
Seven Stars

Re: How to use Hmap - JSON to XML

I enclosed a map and a job to do this transform.

4 REPLIES
Seven Stars

Re: How to use Hmap - JSON to XML

Hi,

 

How do you get this JSON input ? Do you read it on a file system ? Does it come from a webservice call ? ...

 

Eric

Five Stars

Re: How to use Hmap - JSON to XML

web service call, but why does that matter?

Seven Stars

Re: How to use Hmap - JSON to XML

I enclosed a map and a job to do this transform.

Five Stars

Re: How to use Hmap - JSON to XML

Are there any good example & documentation on how to use tHMap? I remember that 6 months ago there were almost no examples.