Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Message "Security_Authenticate #147

Closed
AmiinosEddagh opened this issue Feb 14, 2018 · 16 comments
Closed

Message "Security_Authenticate #147

AmiinosEddagh opened this issue Feb 14, 2018 · 16 comments

Comments

@AmiinosEddagh
Copy link

AmiinosEddagh commented Feb 14, 2018

hi,
i'm starting to use your sdk but i always get this error message

Fatal error:  Uncaught exception 'Amadeus\Client\InvalidMessageException' with message 'Message "Security_Authenticate" is not in WDSL' in /home/dev/work/amadeus/vendor/amabnl/amadeus-ws-client/src/Amadeus/Client/RequestCreator/Base.php:108
Stack trace:
-0 /home/dev/work/amadeus/vendor/amabnl/amadeus-ws-client/src/Amadeus/Client/RequestCreator/Base.php(88): Amadeus\Client\RequestCreator\Base->checkMessageIsInWsdl('Security_Authen...')
-1 /home/dev/work/amadeus/vendor/amabnl/amadeus-ws-client/src/Amadeus/Client.php(1197): Amadeus\Client\RequestCreator\Base->createRequest('Security_Authen...', Object(Amadeus\Client\RequestOptions\SecurityAuthenticateOptions))
-2 /home/dev/work/amadeus/vendor/amabnl/amadeus-ws-client/src/Amadeus/Client.php(192): Amadeus\Client->callMessage('Security_Authen...', Object(Amadeus\Client\RequestOptions\SecurityAuthenticateOptions), Array, false)
-3 /home/dev/work/amadeus/test.php(31): Amadeus\Client->securityAuthenticate()
-4 {main}
  thrown in /home/dev/work/amadeus/vendor/amabnl/amadeus-ws-client/src/Amadeus/Client/RequestCreator/Base.php on line 108

thanks in advance

@DerMika
Copy link
Collaborator

DerMika commented Feb 14, 2018

Hi,

Do you have the Security_Authenticate message in your WSDL?

However, often it's not necessary to call Security_Authenticate explicitly when you have a WSAP configured with SoapHeader 4. If that is the case, just call the message you want to call, and the library will handle authentication and session management automatically.

@AmiinosEddagh
Copy link
Author

hi,

i've got from amadeus only the credentials to access the extranet.
i'm new to this, can you help me with an example to start with?

@DerMika
Copy link
Collaborator

DerMika commented Feb 14, 2018

Well, what do you want to do?

Do you want to build an online booking engine? In that case you can look at this comment I made previously, which gives some recommendations on how to start building one.

@AmiinosEddagh
Copy link
Author

AmiinosEddagh commented Feb 14, 2018

ok
so now i'm having this error

Fatal error: Uncaught exception 'Amadeus\Client\Session\Handler\InvalidSessionException' with message 'No active session' in /home/dev/work/amadeus/vendor/amabnl/amadeus-ws-client/src/Amadeus/Client/Session/Handler/SoapHeader2.php:68 
Stack trace: #0 /home/dev/work/amadeus/vendor/amabnl/amadeus-ws-client/src/Amadeus/Client/Session/Handler/Base.php(191): Amadeus\Client\Session\Handler\SoapHeader2->prepareForNextMessage('Air_MultiAvaila...', Array) 
#1 /home/dev/work/amadeus/vendor/amabnl/amadeus-ws-client/src/Amadeus/Client.php(1199): Amadeus\Client\Session\Handler\Base->sendMessage('Air_MultiAvaila...', Object(Amadeus\Client\Struct\Air\MultiAvailability16), Array) 
#2 /home/dev/work/amadeus/vendor/amabnl/amadeus-ws-client/src/Amadeus/Client.php(630): Amadeus\Client->callMessage('Air_MultiAvaila...', Object(Amadeus\Client\RequestOptions\AirMultiAvailabilityOptions), Array) 
#3 /home/dev/work/amadeus/test.php(56): Amadeus\Client->airMultiAvailability(Object(Amadeus\Client\RequestOptions\AirMultiAvailabilityOptions)) 
#4 {main} in /home/dev/work/amadeus/vendor/amabnl/amadeus-ws-client/src/Amadeus/Client/Session/Handler/SoapHeader2.php on line 68

@DerMika
Copy link
Collaborator

DerMika commented Feb 14, 2018

You have configured your client to use SoapHeader 2. For SoapHeader 2, you have to send your own authentication message.

Are you sure the WSDL that was given to you is a SoapHeader 2 WSDL? You can ask Amadeus which SoapHeader version it uses.

if the WSDL is for SoapHeader 4, you have to configure the client to use SoapHeader 4: https://github.com/amabnl/amadeus-ws-client/blob/master/docs/about-get-started.rst#set-up-a-test-client:

    'soapHeaderVersion' => Client::HEADER_V4,

@AmiinosEddagh
Copy link
Author

i'm waiting for their response

@AmiinosEddagh
Copy link
Author

AmiinosEddagh commented Feb 14, 2018

and i have this error

Fatal error:  Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing Schema: can't import schema from '/home/dev/work/amadeus/WSDL/Ticket_ValidateCreditCard_05_3_1A.xsd' in /home/dev/work/amadeus/vendor/amabnl/amadeus-ws-client/src/Amadeus/Client/SoapClient.php:59
Stack trace:
#0 /home/dev/work/amadeus/vendor/amabnl/amadeus-ws-client/src/Amadeus/Client/SoapClient.php(59): SoapClient->SoapClient('WSDL/1ASIWPOC1A...', Array)
#1 /home/dev/work/amadeus/vendor/amabnl/amadeus-ws-client/src/Amadeus/Client/Session/Handler/Base.php(401): Amadeus\Client\SoapClient->__construct('WSDL/1ASIWPOC1A...', Array, Object(Psr\Log\NullLogger))
#2 /home/dev/work/amadeus/vendor/amabnl/amadeus-ws-client/src/Amadeus/Client/Session/Handler/Base.php(378): Amadeus\Client\Session\Handler\Base->initSoapClient('7d6b99d4')
#3 /home/dev/work/amadeus/vendor/amabnl/amadeus-ws-client/src/Amadeus/Client/Session/Handler/SoapHeader4.php(93): Amadeus\Client\Session\Handler\Base->getSoapClient('Air_MultiAvaila...')
#4 /home/dev/work/amadeus/vendor/amabnl/amadeu in /home/dev/work/amadeus/vendor/amabnl/amadeus-ws-client/src/Amadeus/Client/SoapClient.php on line 59

@DerMika
Copy link
Collaborator

DerMika commented Feb 14, 2018

Looks like your WSDL file is including an XSD file which it can't find.

You have to extract the zip file you got from Amadeus, put it somewhere the client can read it, and make sure all the XSD's in the zip file are also present as they were in the zip file.

It's also possible that the XSD you mention just isn't present in the WSDL:

  • ask Amadeus to fix this and give you a new WSDL
  • meanwhile, remove the import of this XSD from your WSDL so you can start testing.

EDIT: also, you're working with the POC (Proof of Concept) WSDL? You might have some issues with that one, because as far as I know, it includes tens of messages nobody ever uses. You might want to ask for a dedicated WSDL for your application.

@AmiinosEddagh
Copy link
Author

AmiinosEddagh commented Feb 14, 2018

thanks but now i have an error when using

$opt = new AirMultiAvailabilityOptions([
    'actionCode' => AirMultiAvailabilityOptions::ACTION_AVAILABILITY,
    'requestOptions' => [
        new RequestOptions([
            'departureDate' => \DateTime::createFromFormat('Ymd-His', '20180320-000000', new \DateTimeZone('UTC')),
            'from' => 'BRU',
            'to' => 'LIS',
            'requestType' => RequestOptions::REQ_TYPE_NEUTRAL_ORDER
        ])
    ]
]);

$availabilityResult = $client->airMultiAvailability($opt);

object(Amadeus\Client\Result)#36 (4) {
  ["status"]=>
  string(5) "FATAL"
  ["messages"]=>
  array(1) {
    [0]=>
    object(Amadeus\Client\Result\NotOk)#37 (3) {
      ["code"]=>
      string(3) " 12"
      ["text"]=>
      string(29) "soap message header incorrect"
      ["level"]=>
      string(12) "Presentation"
    }
  }
  ["response"]=>
  NULL
  ["responseXml"]=>
  string(166) "soap:Client 12|Presentation|soap message header incorrectSI:muxDZ2"
}

@DerMika
Copy link
Collaborator

DerMika commented Feb 14, 2018

Have you provided the password correctly (base_64 encoded)?

This error is also returned when it's an authentication failure.

@DerMika
Copy link
Collaborator

DerMika commented Feb 21, 2018

Do you have an update for me?

@AmiinosEddagh
Copy link
Author

Hi and sorry for the late reply,
i'm waiting for the new WSDL files from Amadeus.
will keep you posted if there is any news.
thank you

@AmiinosEddagh
Copy link
Author

hi @DerMika
i have got the new WSDL files from Amadeus.

i have a couple of questions for you if you don't mind;
-the userId and passwordData are the credentials to access the Extranet?
-which Message should i start with? the FareMasterPricerTbSearch ?

thank you

@DerMika
Copy link
Collaborator

DerMika commented Mar 5, 2018

Yes, they are the credentials.

I don't know, what do you want to do? Build an on-line booking engine? If so, then the Fare_MasterPricerTravelBoardSearch is probably the best message to start with.

But before you start doing that, maybe ask Amadeus some directions. They have some implementation guides and flowcharts they can provide that you can use as a guideline.

@DerMika
Copy link
Collaborator

DerMika commented Mar 31, 2018

Is your problem fixed now? If so, can you close this issue?

@AmiinosEddagh
Copy link
Author

yes thank you for your support.
i'm moving forward with the development.
i'll open a ticket if i encounter other issues.
best regards.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants