Results for:

Suppor Center

Configuration

Configuration

.NET – Service Configuration and web.config

.NET – Service Configuration and web.config

To configure WCF in .NET applications, you have to add SDK MainStreaming Service Reference to your project.

By clicking Advanced you can access to configuration and you have to configure:

Access level for generated classes: Public
Dictionary collection type: System.Collections.Generic.Dictionary
Reuse types in referenced assemblies
Reuse types in all referenced assemblies

Configuration web.config

Web.config file of the application that will execute webservice requests must be modified as follows. If web service is imported in an external libyrary, the configuration must be applied to the project that executes the requests, not in the library.

<system.serviceModel>
    
        <bindings>
          <webHttpBinding>
            <binding name="xmlWebHttpBinding">
              <security mode="Transport">
                <transport clientCredentialType="None"></transport>
              </security>
            </binding>
          </webHttpBinding>
        </bindings>
        <behaviors>
          <endpointBehaviors>
            <behavior name="webhttp">
              <webHttp defaultBodyStyle="WrappedRequest" faultExceptionEnabled="true" defaultOutgoingResponseFormat="Xml"></webHttp>
            </behavior>
          </endpointBehaviors>
        </behaviors>

        <client>
          <endpoint address="https://video.mainstreaming.tv/sdk/13/WCFMSApi.svc/" 
                    name="xmlEndpoint"
                    binding="webHttpBinding" 
                    contract="WCFMSApi.IWCFMSApi"
                    bindingConfiguration="xmlWebHttpBinding"
                    behaviorConfiguration="webhttp"/>
        </client>

    </system.serviceModel>
                

.NET – API calls C#

.NET – API Calls C#

To execute a API Call in .NET is important to create an object of the service as follows:

WCFMSApi.WCFMSApiClient api = new WCFMSApi.WCFMSApiClient("xmlEndpoint");
                    

To execute the service calls you have to call the methods available in the service object. All the calls need the token as first parameter and we suggest to store it in a variable/ constant/external settings so you can modify it only once if you need to.

Now we show an example to catch the list of not-published video of your collection, sorted by UPLOAD Date Desc, limited to 100 lines.

You can access to more informations in the Methods sections.

List<WCFMSApi.VodContentDTO> vodContents = api.ListVodContentUnPublished(MAINSTREAMING_TOKEN, "SORT_UPLOAD_DATE", "DESC", 0, 100);
                
keyboard_arrow_up