Documente Academic
Documente Profesional
Documente Cultură
Implementation Guide
.NET Framework
Implementation Guidelines and Known Issues
Index
Introduction ......................................................................................................................... 4
Code Generation ................................................................................................................. 5
System Configuration ................................................................................................... 5
Generation ................................................................................................................... 5
Generated Proxy Use (.NET 3.0).................................................................................. 6
Security Authenticate ............................................................................................... 6
Cryptic Command .................................................................................................... 7
Security Sign-Out..................................................................................................... 7
Generated Proxy Use (.NET 3.0 with message contracts)............................................ 7
Security Authenticate ............................................................................................... 7
Cryptic Command .................................................................................................... 8
Security Sign-Out..................................................................................................... 8
Generated Proxy Use (.NET 2.0).................................................................................. 8
Security Authenticate ............................................................................................... 8
Cryptic Command .................................................................................................... 9
Security Sign-Out..................................................................................................... 9
Known Issues...................................................................................................................... 9
.Net 2.0 Session Handling (Session ID)........................................................................ 9
Improving Performance ................................................................................................ 9
Wrong Name Table Buffer Size - No WSDL Impact...................................................... 9
Fields not being set in XML ........................................................................................ 10
Soap Fault 500........................................................................................................... 10
Manual SOAP/HTTP Handling............................................................................... 10
Proxy-generated Handling ..................................................................................... 10
Double Sequences ..................................................................................................... 11
© 2006 Amadeus IT Group SA
Document control
Security level
Company Amadeus
Department API Consulting & Services
Author Cedric Counotte
Reviewed by Guillaume Cardon Date DD / MM / YYYY
Approved by Guillaume Cardon Date DD / MM / YYYY
Version Date Change Comment By
0.1 31 / 03 / 2009 Cedric Counotte
0.2 03 / 06 / 2009 Updated Known Issues Cedric Counotte
Soap Fault management
0.3 21 / 07 / 2009 Cedric Counotte
(Http Error 500)
0.4 17 / 12 / 2009 Updated known issues Cedric Counotte
© 2006 Amadeus IT Group SA
Introduction
This document describes implementation guidelines and known issues when using .NET
framework to access Amadeus Web Services.
© 2006 Amadeus IT Group SA
Code Generation
System Configuration
Minimum requirement is to have Microsoft Visual Studio 2005 or above installed on your
system. Express editions can also be used.
You have downloaded the WSDL package (.NET version, including all XSDs) for your
services and extracted its content on a local hard drive.
Express editions can be downloaded from here.
Generation
From within a Visual Studio project, you can generate a client proxy as follows:
1. Create a project based on either version of the .NET framework.
2. Right-click on the project name and select either ‘Add Web Reference’ (.NET 2.0)
or ‘Add Service Reference’ (.NET 3.0 or above).
3. In the ‘Address’ text box, enter the location of the WSDL file and press the ‘Go’
button. If everything goes well you should get a screen like this, in .NET 3.0:
© 2006 Amadeus IT Group SA
Security Authenticate
Security_Authenticate sec_auth = new Security_Authenticate();
new Security_AuthenticateSystemDetailsOrganizationDetails();
sec_auth.systemDetails.organizationDetails.organizationId = "1A";
Security_AuthenticateReply sec_auth_reply;
String sessionid = pt_client.Security_Authenticate(sec_auth, out sec_auth_reply);
return sessionid;
Cryptic Command
Command_Cryptic cryptic_cmd = new Command_Cryptic();
cryptic_cmd.longTextString = new Command_CrypticLongTextString();
cryptic_cmd.longTextString.textStringDetails = cmd;
return ccr.longTextString.textStringDetails;
Security Sign-Out
Security_SignOut sec_signout = new Security_SignOut();
Security Authenticate
Security_Authenticate sec_auth = new Security_Authenticate();
return sec_response.SessionId;
Cryptic Command
Command_Cryptic cryptic_cmd = new Command_Cryptic();
cryptic_cmd.longTextString = new Command_CrypticLongTextString();
cryptic_cmd.longTextString.textStringDetails = cmd;
return ccresp.Command_CrypticReply.longTextString.textStringDetails;
Security Sign-Out
Security_SignOut sec_signout = new Security_SignOut();
Security_SignOutRequest sec_req = new Security_SignOutRequest();
sec_req.Security_SignOut = sec_signout;
sec_req.SessionId = sessionid;
Security Authenticate
Security_Authenticate sec_auth = new Security_Authenticate();
Cryptic Command
Command_Cryptic cryptic_cmd = new Command_Cryptic();
cryptic_cmd.longTextString = new Command_CrypticLongTextString();
cryptic_cmd.longTextString.textStringDetails = cmd;
return ccr.longTextString.textStringDetails;
Security Sign-Out
Security_SignOut sec_signout = new Security_SignOut();
pt_client.Security_SignOut(sec_signout);
Known Issues
.Net 2.0 Session Handling (Session ID)
In .NET 2.0, the session id is handled using a single common object. Thus in a multi-
threaded environment, developers must synchronize service calls, so that only one thread
makes service calls at a time.
Improving Performance
It has been noted that on .NET 2.0 / 3.0 framework, the first web service call is very slow.
This is mainly due to the framework attempting to configure the proxy automatically!
To improve performance, add the following line to your code:
System.Net.WebRequest.DefaultWebProxy = null;
or
MyRequest.Proxy = null;
Proxy-generated Handling
In .NET 3.0, the detail of the exception will be contained in an object of type
© 2006 Amadeus IT Group SA
Double Sequences
You may get this error message at run-time:
error CS0029: Cannot implicitly convert type…
It appears that the code generator for .NET performs auto-optimization on code generation
for the following types of WSDL fragment (a sequence containing a single sequence):
<xs:element name="name1" …>
<xs:complexType>
<xs:sequence>
</xs:sequence>
</xs:complexType>
</xs:element>
It results in a two dimensional table (definition [] []) instead of a one dimensional table
containing one single element. To solve this issue, an optional dummy element should be
added to the top sequence:
<xs:element name="name2" …/>
<xs:element name="Dummy.NET" minOccurs="0" maxOccurs="0"/>
To ensure you have generated the code properly, make sure you can’t find any “[][]” inside
your solution directory (usually in a reference.* file).
AmadeusWebServiceTest.zip
© 2006 Amadeus IT Group SA