Layer7 API Management

Expand all | Collapse all

.Net Custom Binding Implementation

Jump to Best Answer
  • 1.  .Net Custom Binding Implementation

    Posted 04-24-2017 02:58 AM

    Hi guys,


    We are facing a problem while consuming a web service.


    We have a VPN Connection with a company and trying to consume their web services.


    I have the following custom binding in my application(.Net) and it works without problem.


    However when I publish this service on our API Gateway, the service returns 415 error.


    Any help would be appreciated.



    <?xml version="1.0" encoding="utf-8"?><configuration>    
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.1" />  

               <binding name="myUsernameOverHttpBinding02">    
                    <textMessageEncoding messageVersion="Soap12WSAddressingAugust2004" />      
                  <security authenticationMode="UserNameOverTransport" allowInsecureTransport="False " /> 
                       <httpsTransport />       

              <endpoint address="https://***" binding="customBinding"
    bindingConfiguration="myUsernameOverHttpBinding02" contract="yyy.myContract"
    name="myUsernameOverHttpBinding02" />    

        <defaultProxy enabled="false" useDefaultCredentials="false">   
            <add address="https://***"></add>   

  • 2.  Re: .Net Custom Binding Implementation
    Best Answer

    Broadcom Employee
    Posted 04-24-2017 09:41 AM



    A response code of 415 means that the media type is unsupported. The most likely case is that you are either missing the Content-Type header in your request, or it's incorrect.




  • 3.  Re: .Net Custom Binding Implementation

    Posted 04-24-2017 10:01 AM

    I have tried various content types(text/xml, application/xml, etc.), but no luck.


    What should I do in this case?

    Should I track the requests via fiddler and find the correct content-type which .Net generates?


    When using custom bindings, if I choose gateway not to modify headers, does gateway pass these configurations to the provider service?

  • 4.  Re: .Net Custom Binding Implementation

    Broadcom Employee
    Posted 05-04-2017 12:35 AM

    Tracking the request payload and headers with tools like Fiddler or Wireshark help expose what is being sent through to the endpoint. From reviewing the code it appears that you are using WS Addressing in the message along with Username and Password at the transport layer (Authentication Header).


    As for the modification of headers if you choose to route all HTTP Headers in the HTTP Routing assertion then everything sent it should be transmitted to the back-end minus a few outlined on this documentation page ( Route via HTTP(S) Assertion - CA API Gateway - 9.2 - CA Technologies Documentation[Headers]Tab).




    Stephen Hughes

    Director, CA Support