cancel
Showing results for 
Search instead for 
Did you mean: 

2 xml documents in 1 payload

Former Member
0 Kudos

Hi all,

I am trying to set up an UPS track request and the data is to be provided in the following way:

<?xml version="1.0"?>
<AccessRequest xml:lang="en-US">
 <AccessLicenseNumber>YOURACCESSLICENSENUMBER</AccessLicenseNumber>
 <UserId>YOURUSERID</UserId>
 <Password>YOURPASSWORD</Password>
</AccessRequest>
<?xml version="1.0"?>
<TrackRequest xml:lang="en-US">
 <Request>
  <TransactionReference>
   <CustomerContext>Example 2</CustomerContext>
   <XpciVersion>1.0001</XpciVersion>
  </TransactionReference>
  <RequestAction>Track</RequestAction>
  <RequestOption>none</RequestOption>
 </Request>
 <ReferenceNumber>
  <Value>CUSTOMER SUPPLIED REFERENCE NUMBER</Value>
 </ReferenceNumber>
</TrackRequest>

There is one xml document for authorization and one xml document for the actual request, but both have to be sent in one http request.

I'd like to send the data via XI using ABAP Proxy on the ERP side, but I don't figure how to set up those two xml documents in one payload.

Any idea?

Thanks,

Hans

Accepted Solutions (0)

Answers (2)

Answers (2)

moorthy
Active Contributor
0 Kudos

Hi,

You can think of doing this with the help of MultiMapping concepts i.e N:1 Mapping. for this you need to use BPM. SO you can merge 2 xml message into one and send it

For reference-

http://help.sap.com/saphelp_nw2004s/helpdata/en/0e/56373f7853494fe10000000a114084/content.htm

Regards,

Moorthy

Former Member
0 Kudos

Thank you both for your very quick answers!

However, both ideas base on wrapping the two xml documents inside an surrounding document, either <root/> or a new document created in MultiMapping.

But the structure has to be sent as shown in my first post, with other xml elements.

former_member206604
Active Contributor
0 Kudos

Hi,

If I understood correctly these XML's documents are to be sent to a ABAP proxy right.

<i>>>>But the structure has to be sent as shown in my first post, with other xml elements.</i>

You mean to say the struture is fixed as you given above. But as far as I know there cannot be a structure like that. Its not possible from my point of view to have a sunch strucutre in one Proxy interface. May me two interfaces then it is something like Moorthy said. If it is one interface then it should be as I said.

Anyways its you who is is designing the structure and the generating the Proxy in R/3 so in anyways the strucutre will be created in XI so first point is you cannot create such structure. And the given document is not at all a valid XML.

So you have to exclose it with a tag and the processing instrcution can occur only once in a XML and thats the standard.

Regards,

Prakash

Former Member
0 Kudos

Hi Prakash,

these xml documents are to be sent to an 3rd party http server and I would like to start the request from an ABAP outbound proxy and route it via XI.

I do agree with you that such a document is no valid xml.

It is explicitly said in UPS's documentation that one should not validate both xml documents together, but separately.

But, anyway, I have to send them together in one http post:

<quote from documentation>

Every XML input request is made up of two separate XML documents. These requests are concatenated and

posted to the UPS web servers using a single HTTP Post.

</quote>

Is there any chance to concatenate them using HTTP oubound adapter? Or do I have to program my own interface...

former_member206604
Active Contributor
0 Kudos

Hi,

In a standard way to my knowledge it is not possible to send two document in one request. But you can try this way... Try to use SOAP Adapter with the setting "DO Not Use SOAP Header". You define the stucure in XI like I said with a root node. Then you need to write a Adapter module where you will split those XML message into 2. Join it by treating it as string.. I mean concatenate it.

This should work.

Regards,

Prakash

Former Member
0 Kudos

Thanks for your suggestion. But then it would be easier for me to skip all Proxy/XI stuff and code the request myself using WAS http objects.

And that for a worldwide used standard interface of a worldwide leading US company...

former_member206604
Active Contributor
0 Kudos

Hi,

Yes you are right. If you are using XI only for this purpose then you can go ahead and do the same there.

Regards,

Prakash

Former Member
0 Kudos

Hi Prakash,

I found another solution reading this weblog:

<a href="/people/william.li/blog/2006/09/08/how-to-send-any-data-even-binary-through-xi-without-using-the-integration-repository: How to send any data (even binary) through XI, without using the Integration Repository</a>

I think I will create the two separate xml documents in R/3 using Transformations, then concatenate them and send the request to XI for routing purposes.

former_member206604
Active Contributor
0 Kudos

Hi Hans,

Great... actually I thought of that option before, but was wondering how would you populate the Proxy structure. There can be some way o work with proxy but not sure. The other way is you save it as a file and then use use the method of that blog.. But try it with proxy rather that doing it by file.

Regards,

Prakash

Former Member
0 Kudos

Hi Hans-Jürgen,

do you solve this problem?

If you have a solution please post it here.

Regards

Frank

Former Member
0 Kudos

Hello,

has anybody solved this problem an can post it here? I have exactly the same problem!

Thanks

Max

Former Member
0 Kudos

Was this problem solved? I am facing the exact same issue.

Thanks.

Anuradha.

former_member206604
Active Contributor
0 Kudos

Hi,

You can pass it like this

<?xml version="1.0"?>

<b><root></b>

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

<AccessLicenseNumber>YOURACCESSLICENSENUMBER</AccessLicenseNumber>

<UserId>YOURUSERID</UserId>

<Password>YOURPASSWORD</Password>

</AccessRequest>

<TrackRequest xml:lang="en-US">

<Request>

<TransactionReference>

<CustomerContext>Example 2</CustomerContext>

<XpciVersion>1.0001</XpciVersion>

</TransactionReference>

<RequestAction>Track</RequestAction>

<RequestOption>none</RequestOption>

</Request>

<ReferenceNumber>

<Value>CUSTOMER SUPPLIED REFERENCE NUMBER</Value>

</ReferenceNumber>

</TrackRequest>

<b></root></b>

Inside the ABAP Proxy split the XML into to.

Regards,

Prakash