NachoCheez
NachoCheez

Reputation: 1

Amadeus soap request keeps causing error about wrong headers

I am creating a Fare_TravelBoardSearch request for amadeus enterprise flight api. I have created a request in C# using amadeus's wsdl and when that didn't work i took the simpler option of creating one in soapui. both of them are giving similar errors:

soap:

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
   <soap:Body>
      <soap:Fault>
         <faultcode>soap:Client</faultcode>
         <faultstring>12|Presentation|soap message header incorrect</faultstring>
         <faultactor>SI:muxDZ1</faultactor>
      </soap:Fault>
   </soap:Body>
</soap:Envelope>

C# exception:

{" 12|Presentation|soap message header incorrect"}

This is my C# code:

AmadeusWebServices.AmadeusWebServicesPTClient client = new AmadeusWebServices.AmadeusWebServicesPTClient("AmadeusWebServicesPort");

client.ClientCredentials.UserName.UserName = "UserName";
client.ClientCredentials.UserName.Password = "Password";

AmadeusWebServices.Session session = new AmadeusWebServices.Session();
AmadeusWebServices.AMA_SecurityHostedUser securityHostedUser = new AmadeusWebServices.AMA_SecurityHostedUser()
                {
                    UserID = new AmadeusWebServices.AMA_SecurityHostedUserUserID()
                    {
                        AgentDutyCode = "DC",
                        PseudoCityCode = "CityCode",
                        POS_Type = "1"
                    },
                    WorkstationID = "WorkstationId"
                };

AmadeusWebServices.TransactionFlowLinkType transactionFlowLinkType = new AmadeusWebServices.TransactionFlowLinkType();
AmadeusWebServices.Fare_MasterPricerTravelBoardSearch fare_MasterPricerTravelBoardSearch = new AmadeusWebServices.Fare_MasterPricerTravelBoardSearch();

var result = client.Fare_MasterPricerTravelBoardSearch(ref session, ref transactionFlowLinkType, securityHostedUser, fare_MasterPricerTravelBoardSearch);

Console.WriteLine($"Result: {result}");

And here is my request from soapUI :

enter image description here

Upvotes: 0

Views: 388

Answers (0)

Related Questions