ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » XML Mapping

Post new topic  Reply to topic
 XML Mapping « View previous topic :: View next topic » 
Author Message
prasad.gh789
PostPosted: Mon May 16, 2016 3:38 am    Post subject: XML Mapping Reply with quote

Novice

Joined: 06 Aug 2014
Posts: 20

REQUEST XML:

Code:
<?xml version="1.0" encoding="UTF-8"?>
<precardpymnt:EAIServices xmlns:card="http://www.mwcdm.cardmgmt.com" xmlns:cdmt="http://www.mwcdm.cdmTypes.com" xmlns:ch="http://www.mwcdm.header.com" xmlns:precardpymnt="http://www.mwcdm.cardmgmt.com/prepaidCardPayment" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.mwcdm.cardmgmt.com/prepaidCardPayment PrepaidCardPayment.xsd ">
  <precardpymnt:EAIHeader>
    <ch:SrcAppId>ch:SrcAppId</ch:SrcAppId>
    <ch:SrcMsgId>ch:SrcMsgId</ch:SrcMsgId>
    <ch:SrcAppTimestamp>2001-12-31T12:00:00</ch:SrcAppTimestamp>
    <ch:SrvCode>ch:SrvCode</ch:SrvCode>
    <ch:SrvName>ch:SrvName</ch:SrvName>
    <ch:TrackingId>ch:TrackingId</ch:TrackingId>
    <ch:Language>ch:Language</ch:Language>
    <ch:BankId>ch:BankId</ch:BankId>
    <ch:RetryFlag>ch:RetryFlag</ch:RetryFlag>
    <ch:RetryCount>0</ch:RetryCount>
    <ch:ESBResponseTimestamp>2001-12-31T12:00:00</ch:ESBResponseTimestamp>
    <ch:SecurityInfo/>
    <ch:AdditionalData/>
  </precardpymnt:EAIHeader>
  <precardpymnt:EAIBody>
    <precardpymnt:PrepaidCardPaymentReq>
      <card:CardNo>card:CardNo</card:CardNo>
      <card:TransactionAmount>0.0</card:TransactionAmount>
      <card:BatchNumber>card:BatchNumber</card:BatchNumber>
      <card:BankCode>card:BankCode</card:BankCode>
      <card:CBSPayment>
        <card:DebitDetails>
          <card:AccountNo>card:AccountNo</card:AccountNo>
          <card:CurrencyCode>card:CurrencyCode</card:CurrencyCode>
          <card:Amount>0.0</card:Amount>
        </card:DebitDetails>
        <card:CreditDetails>
          <card:AccountNo>card:AccountNo</card:AccountNo>
          <card:CurrencyCode>card:CurrencyCode</card:CurrencyCode>
          <card:Amount>0.0</card:Amount>
        </card:CreditDetails>
        <card:TransactionParticulars>card:TransactionParticulars</card:TransactionParticulars>
        <card:TransactionRemarks>card:TransactionRemarks</card:TransactionRemarks>
        <card:ValueDate>2001-12-31T12:00:00</card:ValueDate>
      </card:CBSPayment>
      <card:SkipCBS>true</card:SkipCBS>
    </precardpymnt:PrepaidCardPaymentReq>
    <precardpymnt:ReturnStatus/>
  </precardpymnt:EAIBody>
</precardpymnt:EAIServices>


Expected Response:

Code:
<?xml version="1.0"?>

-<FundTransfer:EAIServices xsi:schemaLocation="http://www.mwcdm.accountmgmt.com/FundTransfer FundTransfer.xsd " xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ch="http://www.mwcdm.header.com" xmlns:cdmt="http://www.mwcdm.cdmTypes.com" xmlns:acct="http://www.mwcdm.accountmgmt.com" xmlns:FundTransfer="http://www.mwcdm.accountmgmt.com/FundTransfer">


-<FundTransfer:EAIHeader>

<ch:SrcAppId>IVR</ch:SrcAppId>

<ch:SrcMsgId>98467875767</ch:SrcMsgId>

<ch:SrcAppTimestamp>2001-12-31T12:00:00</ch:SrcAppTimestamp>

<ch:SrvCode>FUNDTRANS</ch:SrvCode>

<ch:SrvName>FundTransfer</ch:SrvName>

<ch:TrackingId>333333</ch:TrackingId>

<ch:Language>Eng</ch:Language>

<ch:BankId>000100</ch:BankId>

<ch:RetryFlag>Y</ch:RetryFlag>

<ch:RetryCount>0</ch:RetryCount>

<ch:ESBResponseTimestamp>2001-12-31T12:00:00</ch:ESBResponseTimestamp>


-<ch:SecurityInfo>

<ch:UserId enc=""/>

<ch:Password enc=""/>

</ch:SecurityInfo>


+<ch:AdditionalData>







</FundTransfer:EAIHeader>


-<FundTransfer:EAIBody>


-<FundTransfer:FundTransferReq>

<acct:TransactionType>T</acct:TransactionType>

<acct:TransactionSubType>BI</acct:TransactionSubType>

<acct:TransactionParticulars>Test Transactions</acct:TransactionParticulars>

<acct:TransactionRemarks>Test Transactions</acct:TransactionRemarks>

<acct:ValueDate>2001-12-31T12:00:00</acct:ValueDate>


-<acct:TransactionRecord>

<acct:AccountNo>0602320010000007</acct:AccountNo>

<acct:CreditDebitFlag>D</acct:CreditDebitFlag>


-<acct:TransactionAmount>

<acct:Amount>100</acct:Amount>

<acct:CurrencyCode>INR</acct:CurrencyCode>

</acct:TransactionAmount>

</acct:TransactionRecord>


-<acct:TransactionRecord>

<acct:AccountNo>0602320010000017</acct:AccountNo>

<acct:CreditDebitFlag>C</acct:CreditDebitFlag>


+<acct:TransactionAmount>

</acct:TransactionRecord>

</FundTransfer:FundTransferReq>


-<FundTransfer:ReturnStatus>

<ch:ReturnCode>a</ch:ReturnCode>

<ch:ReturnDescription>a</ch:ReturnDescription>

<ch:ProviderReturnCodes>a</ch:ProviderReturnCodes>

<ch:ProviderReturnDescription>a</ch:ProviderReturnDescription>

<ch:ProviderRefNo>a</ch:ProviderRefNo>

</FundTransfer:ReturnStatus>

</FundTransfer:EAIBody>

</FundTransfer:EAIServices>


Here creditdebitflag is constant 'D' for Debit and 'C' for credit.
Can anyone help me out for this mapping
Thank you
Back to top
View user's profile Send private message
prasad.gh789
PostPosted: Mon May 16, 2016 3:50 am    Post subject: Reply with quote

Novice

Joined: 06 Aug 2014
Posts: 20


Expected Request:

<FundTransfer:EAIHeader>
<ch:SrcAppId>IVR</ch:SrcAppId>
<ch:SrcMsgId>98467875767</ch:SrcMsgId>
<ch:SrcAppTimestamp>2001-12-31T12:00:00</ch:SrcAppTimestamp>
<ch:SrvCode>FUNDTRANS</ch:SrvCode>
<ch:SrvName>FundTransfer</ch:SrvName>
<ch:TrackingId>333333</ch:TrackingId>
<ch:Language>Eng</ch:Language>
<ch:BankId>000100</ch:BankId>
<ch:RetryFlag>Y</ch:RetryFlag>
<ch:RetryCount>0</ch:RetryCount>
<ch:ESBResponseTimestamp>2001-12-31T12:00:00</ch:ESBResponseTimestamp>
-
<ch:SecurityInfo>
<ch:UserId enc=""/>
<ch:Password enc=""/>
</ch:SecurityInfo>
-
<ch:AdditionalData>
-
<ch:Group GroupId="">
<ch:nameValue Value="" Name=""/>
</ch:Group>
</ch:AdditionalData>
</FundTransfer:EAIHeader>
-
<FundTransfer:EAIBody>
-
<FundTransfer:FundTransferReq>
<acct:TransactionType>T</acct:TransactionType>
<acct:TransactionSubType>BI</acct:TransactionSubType>
<acct:TransactionParticulars>Test Transactions</acct:TransactionParticulars>
<acct:TransactionRemarks>Test Transactions</acct:TransactionRemarks>
<acct:ValueDate>2001-12-31T12:00:00</acct:ValueDate>
-
<acct:TransactionRecord>
<acct:AccountNo>0602320010000007</acct:AccountNo>
<acct:CreditDebitFlag>D</acct:CreditDebitFlag>
-
<acct:TransactionAmount>
<acct:Amount>100</acct:Amount>
<acct:CurrencyCode>INR</acct:CurrencyCode>
</acct:TransactionAmount>
</acct:TransactionRecord>
-
<acct:TransactionRecord>
<acct:AccountNo>0602320010000017</acct:AccountNo>
<acct:CreditDebitFlag>C</acct:CreditDebitFlag>
-
<acct:TransactionAmount>
<acct:Amount>100</acct:Amount>
<acct:CurrencyCode>INR</acct:CurrencyCode>
</acct:TransactionAmount>
</acct:TransactionRecord>
</FundTransfer:FundTransferReq>
-
<FundTransfer:ReturnStatus>
<ch:ReturnCode>a</ch:ReturnCode>
<ch:ReturnDescription>a</ch:ReturnDescription>
<ch:ProviderReturnCodes>a</ch:ProviderReturnCodes>
<ch:ProviderReturnDescription>a</ch:ProviderReturnDescription>
<ch:ProviderRefNo>a</ch:ProviderRefNo>
</FundTransfer:ReturnStatus>
</FundTransfer:EAIBody>undefined</FundTransfer:EAIServices>
Back to top
View user's profile Send private message
maurito
PostPosted: Mon May 16, 2016 4:27 am    Post subject: Reply with quote

Partisan

Joined: 17 Apr 2014
Posts: 358

Can you please explain what your question is ?.
Are you using a mapping node ?, JCN, ESQL ? what have you tried ?
what problems have you found?. Do not expect us to write the mapping for you.
Back to top
View user's profile Send private message
prasad.gh789
PostPosted: Mon May 16, 2016 9:47 pm    Post subject: Reply with quote

Novice

Joined: 06 Aug 2014
Posts: 20

I have to use ESQL for this..

Q: In Request message We have separate complex types for DEBITDETAILS and CREDITDETAILS.
but we have same complex type TransactionRecord in response message for both and we have creditdebitflag field under that.
creditdebitflag value 'D' for debitdetails 'C' for Creditdetails.
I confused to map this outputroot.
Could you please help me out to do it.
Thank you
Back to top
View user's profile Send private message
mqjeff
PostPosted: Tue May 17, 2016 3:52 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

If they are different complex types within the same XML Schema, then they will either have : separate names, separate namespaces, or both.

You can use ESQL to check the name or namespace of an element.

This will tell you what to populate.
_________________
chmod -R ugo-wx /
Back to top
View user's profile Send private message
prasad.gh789
PostPosted: Tue May 17, 2016 4:36 am    Post subject: Reply with quote

Novice

Joined: 06 Aug 2014
Posts: 20

The Request and Expected response XML's are constant. unable to change it.

only thing is we should do the mapping as per provided.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Tue May 17, 2016 4:49 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

prasad.gh789 wrote:
The Request and Expected response XML's are constant. unable to change it.


I didn't say you needed to change it.

I said you can examine the message elements, after the input message is parsed.
_________________
chmod -R ugo-wx /
Back to top
View user's profile Send private message
mayheminMQ
PostPosted: Tue May 17, 2016 7:43 am    Post subject: Reply with quote

Voyager

Joined: 04 Sep 2012
Posts: 77
Location: UK beyond the meadows of RocknRoll

I am sorry but are you looking for help on mapping or have you tried mapping the fields from source to target but facing a problem? With the Transformation options present in IIB, you can do them in any number of ways and there is no restriction on picking a value from say field a.b.c. and placing it in say x.y. Is this what you were looking for?
_________________
A Colorblind man may appear disadvantaged but he always sees more than just colors...
Back to top
View user's profile Send private message
timber
PostPosted: Tue May 17, 2016 1:44 pm    Post subject: Reply with quote

Grand Master

Joined: 25 Aug 2015
Posts: 1292

We are all confused. Please think carefully about what you are trying to do, and then explain your question far more clearly.
Back to top
View user's profile Send private message
prasad.gh789
PostPosted: Tue May 17, 2016 9:26 pm    Post subject: Reply with quote

Novice

Joined: 06 Aug 2014
Posts: 20

Thank you all for your support.

My actual problem here is in ESQL mapping only.

Requset XML fields:

<precardpymnt:PrepaidCardPaymentReq>
<card:CardNo>card:CardNo</card:CardNo>
<card:TransactionAmount>0.0</card:TransactionAmount>
<card:BatchNumber>card:BatchNumber</card:BatchNumber>
<card:BankCode>card:BankCode</card:BankCode>
<card:CBSPayment>
<card:DebitDetails>
<card:AccountNo>card:AccountNo</card:AccountNo>
<card:CurrencyCode>card:CurrencyCode</card:CurrencyCode>
<card:Amount>0.0</card:Amount>
</card:DebitDetails>
<card:CreditDetails>
<card:AccountNo>card:AccountNo</card:AccountNo>
<card:CurrencyCode>card:CurrencyCode</card:CurrencyCode>
<card:Amount>0.0</card:Amount>
</card:CreditDetails>
<card:TransactionParticulars>card:TransactionParticulars</card:TransactionParticulars>
<card:TransactionRemarks>card:TransactionRemarks</card:TransactionRemarks>
<card:ValueDate>2001-12-31T12:00:00</card:ValueDate>
</card:CBSPayment>
<card:SkipCBS>true</card:SkipCBS>
</precardpymnt:PrepaidCardPaymentReq>


Expected Response Fields:]

<FundTransfer:FundTransferReq>
<acct:TransactionType>T</acct:TransactionType>
<acct:TransactionSubType>BI</acct:TransactionSubType>
<acct:TransactionParticulars>Test Transactions</acct:TransactionParticulars>
<acct:TransactionRemarks>Test Transactions</acct:TransactionRemarks>
<acct:ValueDate>2001-12-31T12:00:00</acct:ValueDate>
-
<acct:TransactionRecord>
<acct:AccountNo>0602320010000007</acct:AccountNo>
<acct:CreditDebitFlag>D</acct:CreditDebitFlag>
-
<acct:TransactionAmount>
<acct:Amount>100</acct:Amount>
<acct:CurrencyCode>INR</acct:CurrencyCode>
</acct:TransactionAmount>
</acct:TransactionRecord>
-
<acct:TransactionRecord>
<acct:AccountNo>0602320010000017</acct:AccountNo>
<acct:CreditDebitFlag>C</acct:CreditDebitFlag>
-
<acct:TransactionAmount>
<acct:Amount>100</acct:Amount>
<acct:CurrencyCode>INR</acct:CurrencyCode>
</acct:TransactionAmount>
</acct:TransactionRecord>
</FundTransfer:FundTransferReq>

Here CreditDebitFlag is ""constant"" 'D' for Debit datials 'C' for credit Details

In request XML we have separate type for DebitDetails and creditdetails but in response we single unbounded complex type (TransactionRecord) for both.

we need map request DebitDetails to the TransactionRecord type with creditdebitflag "D"
and request CreditDetails to the TransactionRecord type with creditdebitflag "C"
Back to top
View user's profile Send private message
maurito
PostPosted: Tue May 17, 2016 10:41 pm    Post subject: Reply with quote

Partisan

Joined: 17 Apr 2014
Posts: 358

Repeating what you had already said does not help.
Why don't you start by telling us what you have done, what results you are getting and what problems you have found ?
Back to top
View user's profile Send private message
mayheminMQ
PostPosted: Wed May 18, 2016 6:00 am    Post subject: Reply with quote

Voyager

Joined: 04 Sep 2012
Posts: 77
Location: UK beyond the meadows of RocknRoll

I read through his lines for long and with an eagle eye and this is what I believe he is asking?

I have 2 separate complex elements in my request but I have only one complex element in my response with cardinality as n . How can I map this in IIB?

Pseudo code:

declare abc reference to Resp.acct:TransactionRecord
If present(Req.<card:DebitDetails> ) then
map to abc
end if

if present(Req.<card:CreditDetails> ) then
create sibling to abc
map to abc
end if

You can create siblings and then map or you can do a slightly boring way of assiging array counters like resp.blhablah[1] and resp.blahblah[2] and so on..

Read :
https://www.ibm.com/support/knowledgecenter/SSMKHH_10.0.0/com.ibm.etools.mft.doc/ak04950_.htm?lang=en
_________________
A Colorblind man may appear disadvantaged but he always sees more than just colors...
Back to top
View user's profile Send private message
mqjeff
PostPosted: Wed May 18, 2016 6:34 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

mayheminMQ wrote:
you can do a slightly boring way of assiging array counters like resp.blhablah[1] and resp.blahblah[2] and so on..


This is probably boring. It can also end up being terribly slow. You should always try to code using references instead of counters. It does a lot to prevent your code from application developer 'whoops!'.

mayheminMQ wrote:
Read :
https://www.ibm.com/support/knowledgecenter/SSMKHH_10.0.0/com.ibm.etools.mft.doc/ak04950_.htm?lang=en

_________________
chmod -R ugo-wx /
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » XML Mapping
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.