A PNR with at least one itinerary segment must be in the Sabre work area - sabre

We are working with sabre APIs such as CreateSessionRQ, GetReservationRQ, AddRemarksRQ, EndTransactionRQ, CloseSessionRQ. we have gotton the reservation details using PNR locator through GetReservationRQ after creating the session with CreateSessionRQ. We have the following doubts:
While sending the request to AddRemarksRQ and EndTransactionRQ, there is no PNR is added to the request. We don't find the PNR locator in the sample request provided in the sabre developer website. How the PNR is associated with both the request ?
In the preconditions of EndTransactionRQ API, they are mentioned as 'a PNR with at least one itinerary segment must be in the Sabre work area'. Can anyone explain this?

When you call CreateSessionRQ you receive a BinarySecurityToken which identifies a sabre session. You then pass that BinarySecurityToken in the soap header of other saber web service requests.
When you call GetReservationRQ (in stateful mode), the PNR is loaded into the session identified by the BinarySecurityToken. Then when you call AddRemarksRQ, it will add the remark to the PNR that has was loaded in the session by the previous call to GetReservationRQ. The same applies to the EndTransactionRQ service call. It's the BinarySecurityToken that identifies the session that is acted upon by the stateful web service calls.

Sabre PNRs require one segment in them to be present when the first end transaction occurs. The simplest way around this is to add an OTH segment with some generic text in it before ending the PNR.
I believe the Sell Miscellaneous Segment API is the one you want to use to accomplish this. Use the "GK" status for this as that will create a segment that does not get transmitted to any other suppliers.

Related

Better Event centric way to solve request-reply problem in Kafka or any streaming service

I am stuck in a problem while using Kafka in a microservice architecture . I am not able to understand how a microservice handling HTTP requests will be able to send a response to the user. I want to take data from HTTP and then publish it to topic named A then another validator service will validate it and publish it on another topic named B. I want to send processed data to HTTP response from subscribed data from topic B.
In my experience, one option is to respond immediately with 201 accepted, or embed a blocking validator library into your API, and properly return a 400 Bad Request.
Then future GET calls are required to read eventually consistent data that might come back from any consumer. E.g. the consumer process is Kafka Connector that writes to some database, or is a Kafka Streams/KSQL table, future API queries will return data from that. Your original client may need to make periodic HTTP calls until that data is available.

Calling external service from corda

There is a bank which creates a contract which is then accepted by the lender and the borrower. After signing the contract the lender provides fund to the borrower. The bank then creates an obligation state based on the data received by calling an external service automatically.
And Now
1) In API Layer, I am calling first flow which creates one state.
2) In API layer itself, On success of first flow , I am calling the http request to external service and get the data.
3) Now I pass the http response to the the second flow for creating the other state.
Can you please let me know if there is any issue with this approach.
Requirment is I want to trigger the first flow manually, but calling external service and initiating the second flow should happen automatically
I had referred the link given below.
Making asynchronous HTTP calls from flows
You'll make calls to an external service during the running of flows.
The best place to get started would be looking at the CorDapp samples here. In particular, take a look at the Accessing External Data section

Who is the consumer in a POST scenario?

I have read that on Pact, the consumer is the one initiating the request. I have a service (let's call it A) that is used to draw pictures that will then be submitted (via POST) to a service (let's call it B) that will process those inputs and generate albums.
My question is: If the service B is the expert on knowing which kind of inputs and in which format should receive in order to create albums, how come is service A the consumer and therefore the one that will be writing the contract? Shouldn't it be the service B that specifies what kind of data should be receiving?
From [1]:
A component that initiates a HTTP request to another component (the service Provider). Note that this does not depend on the way the data flows - whether it is a GET or a PUT / POST / PATCH, the Consumer is the initiator of the HTTP request.
But I think your question is really asking about consumer driven contract testing [2]. You're conflating who is building the service with expertise / understanding of the requirements for its existence. The Consumer knows what it needs from the service, and the Provider knows how to implement it.
Consumer driven contracts reverses the typical API design process of creating an API first and then consumers coming along to use it. First, the consumer specifies what it requires, publishes the expectations as a contract and the Provider then implements it.
Pact generally assumes this mode, but it's not strictly necessary (i.e. the Provider API can exist in advance).
[1] https://docs.pact.io/documentation/how_does_pact_work.html
[2] https://martinfowler.com/articles/consumerDrivenContracts.html

Biztalk ESB itinerary combine data source

I am struggling to transfer my data in my itinerary in my Biztalk ESB solution, I'm using Message-based instead of Orchestration. My itinerary scenario in Biztalk ESB is:
Receive request CreatePayment with 2 parameters: Claim Object and
Payment Object
Send Claim Object to external service to Verify Claim
Receive result from step 2, then combine the result with Payment Object in request at step 1, then send it to external service to Create Task
My problem is at step 3, I don't know how to combine data from 2 resources. Is there any knowledge that I missing in Biztalk ESB. I just started learning Biztalk for a few weeks. Now I got trouble and I really wait for feedback from you.
Sorry I have to post my itinerary picture to OneDrive since I cannot post it to this: https://onedrive.live.com/redir?resid=584F1A7DD6FCBF77!961&authkey=!ANQVuaTflyExPTo&v=3&ithint=photo%2cPNG
If you can switch to Orchestration, then setting some unique fields as correlationId will solve your problem.
If you are limited to use Message-based instead of Orchestration. below is 2 possible approach you may try.
If you can control the external service, change it to accept your payment object and return it as-is in its response.
If you cannot change the external service, what you can do is wrap the service such as an external assembly. then call this service in a mapping using script functoid.
Your problem seems like that of an Enrichment Scenario.
Check out the sample provided in ESB Toolkit samples:
https://learn.microsoft.com/en-us/biztalk/esb-toolkit/installing-and-running-the-message-enrichment-sample
You will have to use an Orchestration extender in your itinerary.

Biztalk client defined subscription items

I am designing a Biztalk solution which requires client applications to subscribe and receive only a certain subset of event messages depending on their user permissions. Subscription will be done through topic or content based routing. The client will subscribe once and receive many messages until they choose to unsubscribe.
Client applications will number in the 100s and subscribed topics could change on a regular basis, so defining an individual send port from Biztalk for each reciever isn't a viable solution.
I have thought I could build an additional message broker service which holds the individual client subscriptions and distributes messages sent from a biztalk port.
I have also seen that a recipient list pattern can be build using orchestrations. This appears to me to still follow a request-response pattern though and I am after 1 way subscribe message to many returned event messages.
My message broker solution seems to me to be doubling up on what Biztalk should be good at so I imagine I am missing some important functionality somewhere. Has anyone tried such an application before and can give some pointers? Should I be investingating the ESB toolkit as a solution? I have had a look on the net but nothing makes it very clear for this type of topic-subscription model.
Thanks,
Phil
Do take a look at the ESB Toolkit. You can use the itinerary functionality that it adds to BizTalk, either with one of the built-in resolvers (e.g., UDDI) or with your own custom resolver. This allows you to route messages based on configuration (stored in Business Rules or elsewhere).
You will find a developer-oriented overview video of the ESB Toolkit on MSDN, which is a decent introduction to the design process and tooling. There are several other helpful videos there as well.
Your specific scenario can accomplished with a single itinerary, as described here. Use a receive pipeline with the ESB Dispatch Disassembler component, configure multiple resolvers, and for each resolver a new message is produced.
There are also two samples to look at:
The Itinerary On-Ramp Sample - builds a set of SOAP headers that contain the itinerary that you create in the test client, loads the specific message file from disk, appends the itinerary headers to the message, and submits it to the ESB through an Itinerary on-ramp for processing.
The Scatter-Gather Sample - Also appends SOAP headers containing the itinerary to the message, which is submitted to the ESB through an on-ramp for processing. A Broker orchestration analyzes the settings for its itinerary step, retrieves a collection of resolvers associated with the itinerary step, and for each of those resolvers resolves the service endpoint. After that, the orchestration activates the proper ServiceDispatcher orchestration instances to dispatch the outbound request messages.
You should also look at "How to: Route a Single Message to Multiple Recipients Using an Itinerary Routing Slip" or perhaps look into creating a custom itinerary message service (documentation is here).

Resources