Sunday, October 9, 2011

Handling positional/delimited flat files with Oracle B2B 11g


After a long time I am blogging again and this time topic is “Handling positional/delimited flat files with Oracle B2B 11g”. From past couple of weeks, many B2B developers posted question on this topic and hence I thought of posting a blog on the same.

So this is what I will cover in this blog –
  1. Modeling an ecs for a sample positional flat file
  2. Configuring Oracle B2B for a PFF document
  3. Testing the outbound and inbound transaction

Step#1 Modeling an ecs for a sample positional flat file:-
First of all we have to create an ecs for a sample positional flat file (PFF) document. I created below ecs for this blog –



I created this ecs for transferring personal information. I have added two records in this ecs with 5 fields. First record represents the headers and hence can occur once at max in the doc. Second record represents the data and hence can occur infinite times in a doc. 

To uniquely identify the document, I have added a tag value “SERIALNUM” for header field “SERIALNO” –




I will configure the same value in B2B to identify the document uniquely.

Now we need to perform the most important and unique step for PFF doc type – generating the parser schema for the ecs. To generate a parser schema for your ecs, open your ecs in B2B doc editor, go to Tools -> Generate Parser Schema, accept the defaults and provide the file name as well as location to save for ecs parser file –




Once you will click on “Save” it will automatically generate a parser schema for your ecs. Parser schema for my ecs looks like –






Once ecs and parser ecs is created, you need to export XSD (File -> Export -> Oracle B2B 2.0) out of it. Also generate test data out of ecs to test the inbound and outbound flows. This activity is same as what we do for any other type of document.


Step#2 Configuring Oracle B2B for a PFF document:-

Now we will configure Oracle B2B with the files we have generated in previous step. 

First of all copy the parser ecs file in the directory $Oracle_SOA_Home\soa\thirdparty\edifecs\XEngine\config\schema (for eg. - D:\OFMW11g\PS3MWHome\Oracle_SOA1\soa\thirdparty\edifecs\XEngine\config\schema)

And add an entry for this parser ecs in $Oracle_SOA_Home\soa\thirdparty\edifecs\XEngine\config\XERegistry.xml. To add this entry, edit the XERegistry.xml in a text editor and add an entry like below in “Positional flat parser schemas” list –

${XERoot}/config/schema/PARSER_ECS_NAME.ecs





Save the changes after adding entry, close the file XERegistry.xml and restart all the servers.
Now create a Document Protocol Version, Document Type and Document Definition under “PositionalFlatFile” on Oracle B2B console –





Use the XSD and transaction set ecs we created in step#1, while creating document definition.

In Identification tab, we will configure the following values to let B2B uniquely identify this document-

Identification Value = SERIALNUM
Identification Start Position = 1
Identification End Position = 9





Now configure both inbound and outbound agreement for same doc-def –






As you can see, I have kept validation and translation enabled in both the agreements. 

Validation option is used to indicate B2B to validate the incoming/outgoing native format document against the ecs configured in respective document definition. Translation option is used to indicate B2B to translate the incoming flat file to XML or to translate an outgoing XML to flat file.

Save, validate and deploy both the agreements.


Step#3 Testing the outbound and inbound transaction:-

Now first of all we will test an outbound case. Drop the XML file, generated from ecs using Document Editor’s Data Generator tool, into the directory of internal listening channel. Make sure that the XML contains the Internal Properties -




Go to Oracle B2B reports section and make sure that message state is “MSG_COMPLETE”. If transaction completes successfully, you will see a positional flat file on the remote trading partner side –





Similarly, to test an inbound flow, pass the positional flat file to B2B through an external listening channel. Go to Oracle B2B reports section and make sure that message state is “MSG_COMPLETE”. If transaction completes successfully, you will see a corresponding XML file on the host trading partner side (in internal delivery channel). You may check Application Message Report to see the content of translated XML.

Now go ahead and experiment more with it.

24 comments:

  1. Superb !! But, I think When we create a document definition for a positional flat file, we can set various parameters. Right?

    ReplyDelete
  2. Your blogs and every other content is so entertaining and useful It makes me come back again.
    payday advance

    ReplyDelete
  3. HI Anuj,

    Thanks for your post Anuj.I have few questions ,i want to send data from one TP to another through xml gateway and and both the sides we need xml payload and its the custom doc protocol .Can you please tell me step by step how to do it .This is the first time i am working on b2b .Please help me ...please

    Do i need ecs file for this ?
    I want to add custom headers (remote TP need those ) ,how to add those if i don't use .ecs file ?

    ReplyDelete
    Replies
    1. https://forums.oracle.com/forums/thread.jspa?threadID=2454556&tstart=0

      Delete
  4. Hi Anuj,

    Am a newbie for B2B, I have requirement which enforces me to use the a custom WSDL and receive data from partner at B2B and from B2B to the other partner.

    As a part of this , trying to receive data from a trading partner at B2B.How to invoke the B2B as a web service from SOAP UI? What are the necessary configuration apart from creating regular, tp, listing channel and agreement?. or Please let us know is case there is any other approach.

    Regards,
    YRH

    ReplyDelete
  5. Is it possible to handle the delimited file in oracle 10g B2B ? If so is there an equivalent XERegistry.xml in 10g b2b ?
    Thanks.

    ReplyDelete
  6. Smartmind Online Training provides complete knowledge regarding all core concepts and it gives enough confidence about Oracle OSB . We can say Smartmind Online Training  is the best Oracle OSB Training platform for freshers because here we start every concept from the ground level and we explain concepts by taking real time scenarios, so Students get good understanding about subject. Smartmind Online Training  helps you to gain depth knowledge on Oracle OSB and it makes you ready to become a real time Software Developers
    SAP OSB Online Training

    ReplyDelete
  7. Hi Anuj,
    We are trying an inbound flow in B2B with positional flat file as input.We are getting the error "Agreement not found for trading partners: FromTP null, ToTP ABC with document type 4915-V2-INBOUND".
    We have followed the steps for parsar schema and 'XERegistry.xml' file as per your blog. In Identification tab, we have configured the values to let B2B uniquely identify this document.The transaction will have version 4915. Please let us know the steps for setting up the inbound transaction so that it can identify the FromTP and hence the agreement.
    Thanks a lot.

    ReplyDelete
  8. Great post. Online Training provides complete knowledge. Thanks for sharing.
    S&M consultants

    ReplyDelete
  9. Hi Anuj,

    I have the requirment, in the flat file


    userid:123
    username:scott

    i need to identify the value from column 2 , could you please help me how to identify document based on column 2 value.

    Thanks and Regards,
    Vinay Kumar.

    ReplyDelete
  10. I have followed all the steps which mentioned in the blog. I am trying to implement the outbound process XML to Flatfile. it is not converting it. i m getting the same XML file in trading partner location. Please guide me.
    Translate check box is enabled in agreement.

    ReplyDelete
  11. Hi Anuj,

    I am trying to convert the flat file (.dat) to .ecs file using B2B document EDitor but not able to find the option.
    Can you Please help me in that?

    Thanks,

    Tanu

    ReplyDelete
  12. Hi Anuj,

    Can B2B handle SWIFT format payment files? Is there any workaround? I heard somewhere that B2B can handle SWIFT files as positional flat files. Can you please throw some light on the same with examples?

    Thanks,
    Ramu

    ReplyDelete
  13. Hi Anuj,

    We have a custom Functional Acknowledgement (997) SOA Composite deployed on SOA side. Whenever a 997 inbound message comes in, B2B hands it over to the default (IP_IN_QUEUE) from where this message is picked up by 997 SOA Composite and process the message further.

    The issue that we are facing is that, the 997 custom composite suddenly stops polling the messages from IP_IN_QUEUE. The message is shown as MSG_COMPLETE state in B2B, but no MDN is sent back. Also, when we checked in the soa server logs after changing log level to finest (Trace 32). We see the below message:

    [2016-10-02T12:23:58.066-05:00] [soapd1_soa_server1] [TRACE] [] [oracle.soa.b2b.engine] [tid: Workmanager: , Version: 0, Scheduled=false, Started=false, Wait time: 0 ms\r\n] [userId: ] [ecid: c6379c8418721c82:778eefd3:157822b8a92:-8000-000000000001c007,0] [APP: soa-infra] [SRC_CLASS: oracle.tip.b2b.system.DiagnosticService] [SRC_METHOD: log] oracle.tip.b2b.msgproc.MessageHandler: deliverMessageToFabric: There is no deployed composite in Fabric to receive inbound doc
    [2016-10-02T12:23:58.066-05:00] [soapd1_soa_server1] [TRACE] [] [oracle.soa.b2b.engine] [tid: Workmanager: , Version: 0, Scheduled=false, Started=false, Wait time: 0 ms\r\n] [userId: ] [ecid: c6379c8418721c82:778eefd3:157822b8a92:-8000-000000000001c007,0] [APP: soa-infra] [SRC_CLASS: oracle.tip.b2b.system.DiagnosticService] [SRC_METHOD: log] oracle.tip.b2b.msgproc.MessageHandler: doDeliverMessageToDestination: Cannot deliver to Fabric, composite not found

    Any help or head up from your side will be appreciated.

    Regards,
    Anuj

    ReplyDelete
  14. BlueHost is one of the best web-hosting company with plans for all of your hosting needs.

    ReplyDelete
  15. Thanks for sharing, it was informative. We play a small role in upskilling people providing the latest tech courses. Join us to upgradeORACLE B2B ONLINE TRAINING

    ReplyDelete
  16. Hi Anuj,
    Nice post. I have to read MT940 file in segments in OIC. Can you help me with creating schema for the same. I can share the sample file if needed.

    ReplyDelete