API Forum

This forum is in read-only mode.
Please refer to our API support in case you have any questions.
We can be reached at api@e-conomic.com
e-conomic API developer forum

App Identifier X-EconomicAppIdentifier

0
Is it possible to add the header in the app.config or web.config files in endpoint? If not - how can it be done in c#?
created Sep 24, 2015 by jhross
10% Accept Rate
Q 10 A 1 C 2

1 Answer

0

Hi jhross

Adding the header in C# is done like so:

using (var operationScope = new OperationContextScope(session.InnerChannel))
{
    // Add a HTTP Header to an outgoing request
    var requestMessage = new HttpRequestMessageProperty();
    requestMessage.Headers["X-EconomicAppIdentifier"] = "MyCoolIntegration/1.1 (http://example.com/MyCoolIntegration/; MyCoolIntegration@example.com) BasedOnSuperLib/1.4";
    OperationContext.Current.OutgoingMessageProperties[HttpRequestMessageProperty.Name] = requestMessage;

    session.Connect(<agreement>, <user>, <password>);
}

 

http://techtalk.e-conomic.com/e-conomic-soap-api-now-requires-you-to-specify-a-custom-x-economicappidentifier-header/

answered Oct 5, 2015 by olej
Visma e-conomic A/S
...