How can I create session in Amadeus web service - wsdl

I am new in Amadeus web service integration; I use a wsdl from below address:
https://nodeD1.test.webservices.amadeus.com/xxxxxxx
this web service contains below methods:
• Air_MultiAvailability
• Air_SellFromRecommendation
• DocIssuance_IssueTicket
• Fare_CheckRules
• Fare_InformativePricingWithoutPNR
• Fare_MasterPricerTravelBoardSearch
• Fare_PricePNRWithBookingClass
• Fare_PricePNRWithLowerFares
• PNR_AddMultiElements
• PNR_Retrieve
• PNR_Retrieve2
• Queue_PlacePNR
• Security_SignOut
• Ticket_CreateTSTFromPricing
But there is no method to get Security token. Do you know how can I get security token code and login to web service?

WSDL in Amadeus environment are created in a portal, you need to ask the WSAP admin of your organization to add the Security_Authenticate definition to your WSDL.
The authentication is made using an OfficeId, Username and password.

Related

Force 'Sign up with <app>' flow to reappear for Sign in with Apple in Flutter and retrieve email and fullName

The first time I signed in with Apple in my app, I received the full Create an account for <app> using your Apple ID flow. However, I was not able to see and save the email and fullName fields.
In all subsequent logins after original sign up, only the uid is given by Apple. This is expected behaviour, see Cannot get name & email with sign in with Apple on real device
{
credential = {
authorizationCode = "<FlutterStandardTypedData: 0x28195d5a0>";
authorizedScopes = (
);
email = "<null>";
fullName = {
familyName = "<null>";
givenName = "<null>";
middleName = "<null>";
namePrefix = "<null>";
nameSuffix = "<null>";
nickname = "<null>";
};
identityToken = "<FlutterStandardTypedData: 0x28195d460>";
realUserStatus = 2;
state = "<null>";
user = "my user code";
};
credentialType = ASAuthorizationAppleIDCredential;
status = authorized;
}
They advise to remove the app in my Sign in with Apple list and that it should force the original screen to show up again:
Unfortunately, for this account it does not show the original login flow after this step, but just the regular Log in screen, for when you are a returning user.
Other steps I added:
removing the record from the Authentication screen in the Users table in Firebase.
disabling, deleting and re-enabling the Apple Sign in in Firebase
flutter clean
flutter pub cache repair
deleting the app from the test device, rebooting test device and rebuilding from Android Studio.
removing and re-adding Sign in with Apple in XCode via Runner -> Signing & Capabilities
logging in with my Google Sign in and then logging out so it clears my shared preferences:
SharedPreferences preferences = await SharedPreferences.getInstance();
await preferences.clear();
Env info:
username#devicename appname % flutter doctor -v
[✓] Flutter (Channel stable, 3.3.8, on macOS 12.6.1 21G217 darwin-x64, locale en-NL)
• Flutter version 3.3.8 on channel stable at /Users/username/Development/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 52b3dc25f6 (4 weeks ago), 2022-11-09 12:09:26 +0800
• Engine revision 857bd6b74c
• Dart version 2.18.4
• DevTools version 2.15.0
[✓] Android toolchain - develop for Android devices (Android SDK version 32.0.0)
• Android SDK at /Users/username/Library/Android/sdk
• Platform android-33, build-tools 32.0.0
• Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 14.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 14B47b
• CocoaPods version 1.11.2
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2021.3)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)
[✓] Connected device (3 available)
• iPhone X (mobile) • 79f8aa15db6582019ae695924b064c727bacb88f • ios • iOS 15.6 19G71
• macOS (desktop) • macos • darwin-x64 • macOS 12.6.1 21G217 darwin-x64
• Chrome (web) • chrome • web-javascript • Google Chrome 107.0.5304.121
[✓] HTTP Host Availability
• All required HTTP hosts are available
Update:
By adding the following step to the above list, I am able to force the original login flow:
Log out apple account on test device and do not keep any associated data (probably stored data in my keychain via iCloud)
However, when running fresh, still the email and fullName fields are empty.
Turns out it was because I used an old flutter library that did not support the logout feature correctly.
I used apple_sign_in, which has been abandoned.
That package referenced the_apple_sign_in as the successor. But this package is also out of date.
As of date of posting, the package to use is sign_in_with_apple. I used 4.2.0.
If you do this, then it is enough to trigger the original sign up flow just by removing the app in my Sign in with Apple list here (https://appleid.apple.com/account/manage).

SocketException: Failed host lookup: 'www.xyz.com' (OS Error: nodename nor servname provided, or not known errno = 8)

I wrote a Flutter app which connects to a web server running on a separate machine using the dart http package. On my local machine (Mac) I added the hostname 'www.xyz.com' to /etc/hosts and everything works fine when using the IOS Simulator. I would like to test the app on a real device (iPhone SE) but don't want to jailbreak the device. Because it's not possible to edit the hosts file on the phone without jailbreaking it, I installed Weblock which allows to setup redirect rules. I am able to start the app on my phone, however, when making a request to the web server on the separate machine (in my local network) I get the following error:
SocketException: Failed host lookup: 'www.xyz.com' (OS Error: nodename nor servname provided, or not known errno = 8)
From outside the app I can access the web server via 'www.xyz.com' in my browser.
To summarize:
App running in IOS simulator on machine A and connecting to web server on machine B -> works fine
App running on real device and connecting to web server on machine B -> error
Connecting to web server on machine B via browser on Phone -> works fine
Output flutter doctor -v
[✓] Flutter (Channel stable, v1.12.13, on Mac OS X 10.15.4 19E287, locale en-DE)
• Flutter version 1.12.13 at /Users/Jonas/Documents/Programming/flutter
• Framework revision cf37c2cd07 (5 months ago), 2019-11-25 12:04:30 -0800
• Engine revision b6b54fd606
• Dart version 2.7.0
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
• Android SDK at /Users/Jonas/Library/Android/sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-R, build-tools 29.0.3
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b4-5784211)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 11.4.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 11.4.1, Build version 11E503a
• CocoaPods version 1.9.1
[✓] Android Studio (version 3.6)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 44.0.2
• Dart plugin version 192.7761
• Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b4-5784211)
[✓] IntelliJ IDEA Ultimate Edition (version 2019.3.4)
• IntelliJ at /Applications/IntelliJ IDEA.app
• Flutter plugin version 45.0.2
• Dart plugin version 193.6911.31
[!] IntelliJ IDEA Community Edition (version 2019.1.2)
• IntelliJ at /Applications/IntelliJ IDEA CE.app
✗ Flutter plugin not installed; this adds Flutter specific functionality.
✗ Dart plugin not installed; this adds Dart specific functionality.
• For information about installing plugins, see
https://flutter.dev/intellij-setup/#installing-the-plugins
[✓] Connected device (1 available)
• Jonass iPhone • 5ea0e7db176aeb6f278f88f410fb9d0fd4256658 • ios • iOS 13.4.1
! Doctor found issues in 1 category.
Thanks!

SocketException (SocketException: Failed host lookup: 'test' (OS Error: nodename nor servname provided, or not known, errno = 8))

I've looked elsewhere and every site keeps telling me this is effectively an internet connectivity error... But I know that can't be correct.
I'm using Flutter (dart) to program this for iOS (on a Mac). I've tried this on both the iOS simulator and an actual iPhone, and I'm getting the same error. Other calls to the same server work fine.
Future<Map> createTrip() async {
http.Response response = await http.post(
url,
headers: <String, String>{'authorization': basicAuth},
body: {'user_phone': user_phone, 'locationId1': locationId1, 'locationId2': locationId2},
);
info = jsonDecode(response.body);
sessionID = info['session_id'];
print (info['session_id']);
return info;
}
Works fine. In the response body it contains the session_id, and print-screen proves this variable is not empty.
BUT this:
Future<Map> getServerData(sessionID) async {
url = url + sessionID; //. <--- adding sessionID to end of a url-address
http.Response response = await http.get(
url,
headers: <String, String>{'authorization': basicAuth},
);
Map data = jsonDecode(response.body);
return data;
}
Does NOT work. Not entirely sure why. I even tried allowing unsecured data-transmission to the server in the info.plist.
My understanding or expectation is that MAYBE this is because the url I'm requesting doesn't exist on the server? It's the only thing that makes sense to me. If not, then what COULD it be?
Flutter Doctor results:
[✓] Flutter (Channel master, v1.14.2-pre.54, on Mac OS X 10.15.2 19C57, locale
en-CA)
• Flutter version 1.14.2-pre.54 at /Users/iosdev/Developer/flutter
• Framework revision da0bfd1c93 (32 hours ago), 2020-01-21 05:59:07 -0500
• Engine revision c15efb9231
• Dart version 2.8.0 (build 2.8.0-dev.3.0 f910a7575f)
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
• Android SDK at /Users/iosdev/Library/Android/sdk
• Android NDK location not configured (optional; useful for native profiling
support)
• Platform android-29, build-tools 29.0.2
• Java binary at: /Applications/Android
Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build
1.8.0_202-release-1483-b49-5587405)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 11.3.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 11.3.1, Build version 11C504
• CocoaPods version 1.8.4
[✓] Android Studio (version 3.5)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 42.1.1
• Dart plugin version 191.8593
• Java version OpenJDK Runtime Environment (build
1.8.0_202-release-1483-b49-5587405)
[✓] Connected device (2 available)
• Phillip’s iPhone • 52a4fba45a6767b88e4dddd881201205138cac0e • ios • iOS
13.3
• iPhone 11 Pro Max • 2F6FBCBE-CC96-4044-84FA-0DE39E441830 • ios •
com.apple.CoreSimulator.SimRuntime.iOS-13-3 (simulator)
• No issues found!
Make sure you have internet on your emulator or device. Check by opening your internet browser on your emulator or device to see if google.com will display successfully

iOS Flutter not getting push notifications

I'm having issues setting up push notifications for iOS on Flutter.
Another dev tried adding too - had the same problem.
TL;DR: Can anyone get pushes running on iOS Flutter with clean new build from stable channel?
I followed setup steps described here:
https://pub.dev/packages/firebase_messaging
Specifically:
Generated app ID and push Key in https://developer.apple.com/account/resources/certificates/
Added info.plist to ios/Runner folder
Turned on Push capabilities
Uploaded APNS certificate to Firebase console
Made sure bundle ID is the same in App / Runner, info.plist and GoogleService-Info.plist
Added lines in AppDelegate.swift
if #available(iOS 10.0, *) {
UNUserNotificationCenter.current().delegate = self as? UNUserNotificationCenterDelegate
}
Pushes aren't coming. Neither when app in background, not at all.
I also tried another step - sending individual push. Send code in CURL looks like this:
curl -i -X POST \
-H "Content-Type:application/json" \
-H "Authorization:key=AIza_legacy_key" \
-d \
'{
"to": "my_push_token",
"notification":
{"body": "test_body",
"title": "test_title"
},
"priority": "high",
}
' \
'https://fcm.googleapis.com/fcm/send'
And the response is always this type:
- First request is InvalidRegistration
- Second and next same calls is NotRegistered
Another person found similar problem this summer and posted on GitHub, but thread was closed:
https://github.com/flutter/flutter/issues/30486
My Flutter doctor:
[✓] Flutter (Channel unknown, v1.12.13+hotfix.7, on Mac OS X 10.15.3 19D76, locale ru-UA)
• Flutter version 1.12.13+hotfix.7 at /Users/reiven/flutter
• Framework revision 9f5ff2306b (2 weeks ago), 2020-01-26 22:38:26 -0800
• Engine revision a67792536c
• Dart version 2.7.0
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
• Android SDK at /Users/reiven/Library/Android/sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-29, build-tools 29.0.2
• Java binary at: /Applications/Android Studio 3.6 Preview.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b4-5784211)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 11.3.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 11.3.1, Build version 11C504
• CocoaPods version 1.7.5
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 3.6)
• Android Studio at /Applications/Android Studio 3.6 Preview.app/Contents
• Flutter plugin version 43.0.2
• Dart plugin version 192.7761
• Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b4-5784211)
[✓] Connected device (4 available)
• iPhone • 96c120610d684dbab7f5e4d036a7f48041755f96 • ios • iOS 12.3.1
• iPhone 11 Pro Max • 8ABC99D3-6C46-4A3D-968B-F5719AA92C97 • ios • com.apple.CoreSimulator.SimRuntime.iOS-13-3 (simulator)
• Chrome • chrome • web-javascript • Google Chrome 79.0.3945.130
• Web Server • web-server • web-javascript • Flutter Tools
p.s. Some things I've tried:
Used another developer account (100% confirmed pushes are working on another project)
Used another Firebase account
Recreated certificates, projects
Gave to try another developer to setup pushes his own (he also confirmed to be successfull in the past).
Magically things just started working yesterday evening.
So first - just try now. If not working - recreate certificates and redo initialization steps. If still not working - pray and retry another day.

Flutter Http request not being executed on iOS

This is the first request my app executes in order to log in the user. On android, every request works fine but, for some reason, on iOS they don't seem to be executed. I already have set up the developer options on the simulator to allow HTTP Services. I have also tested the code on a physical iPad, and it won't execute the request.
During testing i am not using any timeout for this and if I leave the code running for a while once I have triggered the request, i get this log (it might not be relevant for this, but since i don't know what it is, I will attach it too):
[C1.1 958047F2-81ED-4A34-AEDE-A23D2CD6B49F 172.20.129.134:51780<->216.58.211.42:443]
Connected Path: satisfied (Path is satisfied), interface: en0
Duration: 240.322s, DNS #0.002s took 0.008s, TCP #0.017s took 0.014s, TLS took 0.287s
bytes in/out: 4769/1077, packets in/out: 9/10, rtt: 0.016s, retransmitted packets: 1, out-of-order packets: 0
Here's the code:
Future<LoginResponse> login(String login, String password, AppLocalizations locale) async {
final response = await http.post(_url, body: {
"module": _moduleLogin,
"user": login,
"pass": password,
"lang": locale.localeName
});
try{
EventManager manager = EventManager.getInstance();
manager.clearAllEvents();
}catch(e){
print(e);
}
if (response.statusCode == 200) {
return LoginResponse.fromJson(jsonDecode(response.body));
} else {
throw Exception('Failed to connect to webservice');
}}
At this point I don't know what can be causing this problem. I am using the latest version of the http package.
Here's my flutter doctor output:
[✓] Flutter (Channel beta, v0.9.4, on Mac OS X 10.14 18A391, locale es-ES)
• Flutter version 0.9.4 at /Users/alex/Documents/Development/flutter
• Framework revision f37c235c32 (4 months ago), 2018-09-25 17:45:40 -0400
• Engine revision 74625aed32
• Dart version 2.1.0-dev.5.0.flutter-a2eb050044
[✓] Android toolchain - develop for Android devices (Android SDK 27.0.3)
• Android SDK at /Users/alex/Library/Android/sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-28, build-tools 27.0.3
• ANDROID_HOME = /Users/alex/Library/Android/sdk
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b01)
• All Android licenses accepted.
[✓] iOS toolchain - develop for iOS devices (Xcode 10.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 10.1, Build version 10B61
• ios-deploy 1.9.2
• CocoaPods version 1.5.3
[✓] Android Studio (version 3.1)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 26.0.1
• Dart plugin version 173.4700
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b01)
[✓] IntelliJ IDEA Ultimate Edition (version 2018.1.1)
• IntelliJ at /Applications/IntelliJ IDEA.app
• Flutter plugin version 26.0.2
• Dart plugin version 181.4445.29
[✓] VS Code (version 1.30.2)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 2.21.1
[✓] Connected devices (1 available)
• iPhone XS • 5FB9A137-7AB3-46B5-94BC-9562B0E5E752 • ios • iOS 12.1 (simulator)
• No issues found!
Figured out a solution even though I don't know why does it work.
I replaced the http package with the dio package and it worked fine on both platforms.

Resources