c# send SOAP request with headers

Viewed 25

I need to send an custom header mentioned below and get response from the proxy client. could some please share some basic sample code to achive the same.

<soap:Envelope 
    xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" 
    xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xmlns:ses="http://xml.amadeus.com/2010/06/Session_v3">
    <soap:Header>
        <add:MessageID xmlns:add="http://www.w3.org/2005/08/addressing">0685482c-7f32-46b6-b27f-3149935b9307</add:MessageID>
        <add:Action xmlns:add="http://www.w3.org/2005/08/addressing">http://webservices.amadeus.com/Hotel_MultiSingleAvailability_10.0</add:Action>
        <add:To xmlns:add="http://www.w3.org/2005/08/addressing">https://noded5.test.webservices.amadeus.com/1ASIWPOC1A</add:To>
        <link:TransactionFlowLink xmlns:link="http://wsdl.amadeus.com/2010/06/ws/Link_v1" />
        <oas:Security xmlns:oas="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
            <oas:UsernameToken xmlns:oas1="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" oas1:Id="UsernameToken-1">
                <oas:Username></oas:Username>
                <oas:Nonce EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">RjJmUSsjczI=</oas:Nonce>
                <oas:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest">ZmJhZTdhY2E0YzdkYjIyODFkNDY2Y2RjZDYxN2MyZDlkYTE5NWJkYg==</oas:Password>
                <oas1:Created>2022-09-08T18:27:59.86Z</oas1:Created>
            </oas:UsernameToken>
        </oas:Security>
        <AMA_SecurityHostedUser xmlns="http://xml.amadeus.com/2010/06/Security_v1">
            <UserID AgentDutyCode="SU" POS_Type="1" PseudoCityCode="" RequestorType="U" />
        </AMA_SecurityHostedUser>
    </soap:Header>
</soap:Envelope>
0 Answers
Related