cancel
Showing results for 
Search instead for 
Did you mean: 

How to combine 2 xmls in a single message ?

Former Member
0 Kudos

Hi Guys,

I have a requirement where i need to do the HTTP post and the xml request should be as below

The AddressValidationRequest message consists of two complete XML documents. The first document is an AccessRequest. It is immediately followed by an AddressValidationRequest.

<?xml version="1.0" ?>

<AccessRequest xml:lang='en-US'>

<AccessLicenseNumber>YOURACCESSLICENSENUMBER</AccessLicenseNumber>

<UserId>YOURUSERID</UserId>

<Password>YOURPASSWORD</Password>

</AccessRequest>

<?xml version="1.0" ?><AddressValidationRequest xml:lang='en-US'>

<Request>

<TransactionReference>

<CustomerContext /><XpciVersion>1.0001</XpciVersion>

</TransactionReference>

<RequestAction>XAV</RequestAction>

<RequestOption>3</RequestOption>

</Request>

<MaximumListSize>3</MaximumListSize>

<AddressKeyFormat>

<ConsigneeName>UPS Capital</ConsigneeName>

<BuildingName>Business Credit</BuildingName>

<AddressLine>425 Day Hill Road</AddressLine>

<AddressLine>P.O. Box 400</AddressLine>

<AddressLine>Main Office</AddressLine>

<PoliticalDivision2>Windsor</PoliticalDivision2>

<PoliticalDivision1>CT</PoliticalDivision1>

<PostcodePrimaryLow>06095</PostcodePrimaryLow>

<CountryCode>US</CountryCode>

</AddressKeyFormat>

</AddressValidationRequest>

I know it is invalid to have the second xml declaration, but the 3rd party system expects in this manner. Is there any way i can insert the xml verion tag either with DOM ?

any help or suggestions would be appreciated and awarded.

Thanks,

Srini

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hey

Try to play around with the prolog or epilog property of HTTP adapter,i once had a issue of adding an extra carraige return after XML and epilog worked for me.

Thanx

Aamir

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

You can try that in Java Mapping without using any Parser. You have to use Java input and output stream and construct this as normal string of this format and send it to end system.

PS: by using io streams the performance will be reduced, but it will fulfill your requirement

thanks

amit

Edited by: Craig Cmehil on Jul 10, 2008 9:27 AM