This will be easier with SFG v6 as you can use the REST API Client for all calls except the document get plus you have the JSON Transform service to convert between the JSON input/output and ProcessData XML. The challenge with the document get is that you need to save the Logon and Token keys from the HTTP Response Headers - I suggest opening an RFE to be able to get the HTTP Response Headers from a REST call passed into ProcessData - for now if you use the HTTP POST Client with rawresponse set to Yes then you can do this (wrap the request with a HTTP Session Begin and Session End service) although you'll then need to use MIME to extract the document from the response.
Even in 5.2.6.x you can do this but for each REST call you need to use a HTTP Session Begin, HTTP POST, and then an HTTP Session End service call. You can build/parse the JSON using some code in via Java task service call.
Note that the USPS implementation isn't the best as it only supports one connection per userid so you'd have to a) use the lock service to ensure only 1 instance of your BP runs at a time, and b) serialise the downloads of the files - i.e. you can't initiate multiple parallel downloads, and each document is provided as a single HTTP response with no option to retrieve in chunks nor restart.
You'll need to build a BP, or set of BPs, to logon, get a list of files to download, download the files one by one and write them to a mailbox, and then logout. Either just schedule the BP or create a listening producer that uses it as a custom protocol.
Definitely best to work with a business partner to do this.
------------------------------
RICHARD CROSS
------------------------------
Original Message:
Sent: Tue November 19, 2019 09:50 AM
From: Len Sasso
Subject: Sterling B2B CI/CD Deployments
Richard:
I have attached the USPS Documentation. I have no experience with JASON or REST APIs.
Thank You,
Len
------------------------------
Len Sasso
Original Message:
Sent: Tue November 19, 2019 09:38 AM
From: RICHARD CROSS
Subject: Sterling B2B CI/CD Deployments
Hi Len,
Depends what's available from USPS. Do you mean retrieve the file via a REST call to USPS? If so then you'd need to use the HTTP Client adapters to connect to and issue the relevant HTTP calls to get the file from USPS's REST server. The Client GET (or POST) service will store the response as a document in your BP. You may then need to use something like the MIME service to extract the file and store it to a mailbox from which normal SFG routing is triggered. It's easier from 6.0.1 as there's now a REST API Client adapter: https://www.ibm.com/support/knowledgecenter/en/SS3JSW_6.0.1/integrating/integrating/integrator/REST_Client_Adapter.html
If on the other hand you mean is there a REST API to trigger for example an SFTP PULL from USPS then you can implement that by setting up an HTTP Server Adapter with a URI that triggers a BP that does the SFTP PULL and again stores it to a mailbox from which SFG routing is triggered. There are plans for a REST Server adapter but as of the last I heard that's planned for next year some time...as always roadmap plans are subject to change :-)
------------------------------
RICHARD CROSS
Original Message:
Sent: Tue November 19, 2019 09:14 AM
From: Len Sasso
Subject: Sterling B2B CI/CD Deployments
Hi Richard!
I'm looking for a REST API to access a Producer Site (United States Postal Service) and PULL a file to SFG and send to the Consumer (us).
Is this possible?
Thanks,
Len
------------------------------
Len Sasso
Original Message:
Sent: Tue November 19, 2019 08:21 AM
From: RICHARD CROSS
Subject: Sterling B2B CI/CD Deployments
Hi Len,
I believe you can use the export/import utilities to export a code list from one environment and then import to another.
REST APIs including code list APIs have been available since 5.2.6.1 but each new version introduces more for example v6.0.2 brought in myFileGateway 2.0 which required adding a bunch of mailbox and document handling APIs. The B2Bi REST APIs in 5.2.6.1 are documented here: https://www.ibm.com/support/knowledgecenter/en/SS4TGX_2.2.0/com.ibm.help.sfg_reference.doc/B2B_APIs_avail.html
If you follow the "Reference" breadcrumb at the top of the page you will also see a link to the partner onboarding REST APIs page. You can also change version to see APIs in newer or your particular version. 6.0.2 is the current version with 6.0.3 due out before the end of the year.
Regards,
Richard.
------------------------------
RICHARD CROSS
Original Message:
Sent: Tue November 19, 2019 07:57 AM
From: Len Sasso
Subject: Sterling B2B CI/CD Deployments
Questions:
1. Is it possible to copy an existing Code List?
2. Are there REST APIs for Sterling File Gateway? If so, could you please provide a link(s)?
Thank You,
Len
------------------------------
Len Sasso
Original Message:
Sent: Wed November 13, 2019 06:18 AM
From: RICHARD CROSS
Subject: Sterling B2B CI/CD Deployments
Hi Len,
To convert ABC.CYC123.xyz to DAILY.CHECKS.CYC123 you need to do something like this:
- Define your producer file structure regular expression as (.+)/.(.+)/.(.+) and under facts specify myFilePrefix, myFilePart,myFileSuffix; each section in brackets () is extracted and stored as a "fact" which you can then reference later
- Define your consumer file structure as DAILY.CHECKS.${myFilePart}
To add a .dat suffix is easy i.e. just add the literal .dat to the end of the name in the consumer file structure so for example to take the original filename and add .dat just use ${ProducerFilename}.dat
To convert the entire filename to lowercase you may need to create a customer delivery protocol (as referenced in an earlier answer) which uses xpath or a Java task service (i.e. Java String toLowerCase method) to convert the name to lowercase before delivering the file e.g. in an SFTP PUT or C:D Send service or a Mailbox Add if they're not a listening consumer.
------------------------------
RICHARD CROSS
Original Message:
Sent: Tue November 12, 2019 03:45 PM
From: Len Sasso
Subject: Sterling B2B CI/CD Deployments
I understand we "use SFG for transmitting and naming of the files." I would like to know if it is possible to name a consumer's file with:
1. Lowercase letters
2. ".dat" as the tail
Ex. Original Filename: ABC.123.xyz Consumer Filename: abcd.dat
I would also like to know if it is possible to extract a portion of the original filename and use it in the consumer's filename.
Ex. Original Filename: ABC.CYC123.xyz Consumer Filename: DAILY.CHECKS.CYC123
Any help you could provide would be greatly appreciated.
Thanks !
------------------------------
Len Sasso
Original Message:
Sent: Tue November 12, 2019 12:33 PM
From: MOHAMMED HAJI
Subject: Sterling B2B CI/CD Deployments
Len,
here is the link for the documentation for SFG RCT
_https://www.ibm.com/support/knowledgecenter/en/SS4TGX_2.2.0/com.ibm.help.sfg_route_prov.doc/SFGCreateRoutgChannels.html
i am not entirely following your question
Question: Is it possible to create the Internal file name in lowercase and suffix it with ".dat"? If so, how?
in SFG RCT is only meant for file naming , zipping and encryption etc., you might be creating a file some where else , you use SFG for transmitting and naming of the files.
------------------------------
MOHAMMED HAJI
Original Message:
Sent: Tue November 12, 2019 08:21 AM
From: Len Sasso
Subject: Sterling B2B CI/CD Deployments
Thank you so much!
Question: Is it possible to create the Internal file name in lowercase and suffix it with ".dat"? If so, how?
Also, are there manuals/User Guides available? If so, could you please provide links?
I also need to know how to extract a string from the original file name and use it in the consumer's filename.
I really appreciate any additional help you could provide.
Thanks !
------------------------------
Len Sasso
Original Message:
Sent: Mon November 11, 2019 05:06 PM
From: MOHAMMED HAJI
Subject: Sterling B2B CI/CD Deployments
Len,
You will be updating file name under consumer tab under Consumer File Structure of your RCT ,
i have attached word doc with screen shot of how to update the consumer file name with date time stamp and also zipping and encrypting in a single RCT , hope that will help...
------------------------------
MOHAMMED HAJI
Original Message:
Sent: Mon November 11, 2019 01:52 PM
From: Len Sasso
Subject: Sterling B2B CI/CD Deployments
1. I have a RCT to compress a file into GZIP format.
2. I have a RCT that renames a file - placing the year, month and day at the end of the filename.
How do I code a RCT to do both?
Any help or manuals you could provide would be greatly appreciated.
Thanks !
------------------------------
Len Sasso
Original Message:
Sent: Tue November 05, 2019 03:06 AM
From: Marcus Langford
Subject: Sterling B2B CI/CD Deployments
Len - Try clicking on the image, it will expand and then you can read the example.
------------------------------
Marcus Langford
Original Message:
Sent: Mon November 04, 2019 09:43 AM
From: Len Sasso
Subject: Sterling B2B CI/CD Deployments
I am unable to read it - far too small.
------------------------------
Len Sasso
Original Message:
Sent: Mon November 04, 2019 09:38 AM
From: MOHAMMED HAJI
Subject: Sterling B2B CI/CD Deployments
you can achieve this using SFG Template , here is the example matching to your use case..
------------------------------
MOHAMMED HAJI
Original Message:
Sent: Fri November 01, 2019 11:50 AM
From: Len Sasso
Subject: Sterling B2B CI/CD Deployments
How to use IBM Connect:Direct to transfer a file to SFG and change the file name using the contents in Text2 Box: $OFNAME_$MM ?
------------------------------
Len Sasso
Original Message:
Sent: Tue October 29, 2019 10:32 PM
From: Kishore Reddy
Subject: Sterling B2B CI/CD Deployments
Hello,
What are your thoughts on integrating Sterling B2B with devops tools( like azure devops or IBM UrbanCode) to achieve continuous integration and continuous deployment. Is it possible by using the B2bi API's? We are trying to automate our deployment of maps,codelists & business processes. Are they any other ways to automate deployments in Sterling B2B and ITXA?
------------------------------
Kishore Reddy
------------------------------
#B2BIntegration
#SupplyChain