Giter VIP home page Giter VIP logo

Comments (9)

DerMika avatar DerMika commented on May 24, 2024

I can only imagine that at the moment you do your signout call, you no longer have the session in context.

You should review when the client gets initialized in your code, and what its lifespan is.

I can assure you this is working just fine - this library has been around 5 years now.

from amadeus-ws-client.

dil-hf avatar dil-hf commented on May 24, 2024

Hi,
Thank you for fast reply.

I have edited my questiong by adding a log file.
Also see how I am doing in my code.

I have a trait class with this:

`
public $params;
public function sendPnrRetrieveCall($pnr)
{
$client = new Client($this->params);
$pnrResult = $client->pnrRetrieve(
new PnrRetrieveOptions(['recordLocator' => $pnr])
);
if ($pnrResult->status === Result::STATUS_OK) {
$pnrResult = $this->sendDisplayTstCall($client); // send TSTrequest for price
}else{
$pnrResult = $client->securitySignOut(); //Terminates an active stateful session.
}
}

public function sendDisplayTstCall(Client $client)
{
    // $client = new Client($this->params);
    return $client->ticketDisplayTST(
        new TicketDisplayTstOptions([
            'displayMode' => TicketDisplayTstOptions::MODE_ALL
        ]),
        ['endSession' => true]
    );
}`

from amadeus-ws-client.

dil-hf avatar dil-hf commented on May 24, 2024

You should review when the client gets initialized in your code, and what its lifespan is.

Yes, I checked this too.
I just made a test by calling SecuritySignOut() directly after a PNR retrieve call and having the same issue.
I am maybe doing something wrong.

from amadeus-ws-client.

dil-hf avatar dil-hf commented on May 24, 2024

Hi @DerMika

Please have a look at the below comments.
I have tested in all manner but SecuritySignOut still creates a new session without closing the previous one.

Thank you for your help.

from amadeus-ws-client.

DerMika avatar DerMika commented on May 24, 2024

Make sure you validate that your initial call actually succeeds in signing in.

If your initial call fails to sign in, i'm not sure what the result will be.

from amadeus-ws-client.

dil-hf avatar dil-hf commented on May 24, 2024

Thank you for your reply @DerMika .

I just tested when pnr_retrieve call succeed and SecuritySignOut call work perfectly by closing the session.
But when the pnr_retrieve call failed, I mean by sending a wrong PNR, the SecuritySignOut call creates a new session by sending TransactionStatusCode="start".

So my problem is when the previous call failed. I still have session ID and I want to close that session by sending a SecuritySignOut call.
I am dealing with only three messages: pnrRetrieve ,ticketDisplayTST and SecuritySignOut .

from amadeus-ws-client.

DerMika avatar DerMika commented on May 24, 2024

Since it's been years i've worked with PHP and no longer have access to Amadeus, I suggest the best course of action is for you to either avoid this problem by checking if you have an active session before sending a signout (check $client->getSessionData();) or by investigating yourself and providing a PR that fixes the problem.

from amadeus-ws-client.

dil-hf avatar dil-hf commented on May 24, 2024

I suggest the best course of action is for you to either avoid this problem by checking if you have an active session before sending a signout (check $client->getSessionData();)

I checked that but it still sending a TransactionStatusCode="start".

I will try to investigate the library.

Thank you @DerMika for your time.

from amadeus-ws-client.

DerMika avatar DerMika commented on May 24, 2024

Closing this as you've created a new issue for the same problem

from amadeus-ws-client.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.