Click here to Skip to main content
15,891,423 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
Hi All,

I have a WCF service hosted on a server which is configured with the SSL certificate.
I have two endpoints added for this service :
C#
<services>
     <service name="" behaviorConfiguration="ServiceBehavior">
       <endpoint address="" binding="wsHttpBinding"
           bindingConfiguration="wsHttpBindingConfig" contract="IService">
         <identity>
           <dns value="https://serverName/service.svc" />
         </Identity>
       </endpoint>
       <host>
         <baseAddresses>
           <add baseAddress="https://ServerName/service.svc"></add>
         </baseAddresses>
       </host>
     </service>

<service name="Scheduler" behaviorConfiguration="SchedulerBehavior">
       <endpoint address="" binding="wsHttpBinding"
           bindingConfiguration="wsHttpBindingConfig" contract="IService2">
         <identity>
           <dns value="https://ServerName/Service.svc" />
         </identity>
       </endpoint>
       <host>
         <baseAddresses>
           <add baseAddress="https://ServerName/Service1.svc"></add>
         </baseAddresses>
       </host>
     </service>

   </services>


Want to use the two different endpoints ,
when I am adding service reference in visual studio receiving following error message:

C#
There was an error downloading 'https://BaseAddress/Service.svc/_vti_bin/ListData.svc/$metadata'.
The server committed a protocol violation. Section=ResponseHeader Detail=CR must be followed by LF
Metadata contains a reference that cannot be resolved: 'https://BaseAddress/Service.svc'.
The server committed a protocol violation. Section=ResponseHeader Detail=CR must be followed by LF
The server committed a protocol violation. Section=ResponseHeader Detail=CR must be followed by LF
If the service is defined in the current solution, try building the solution and adding the service reference again.


Please help me to resolve this issue.

Thanks in advance for your response.

--Avinash

What I have tried:

The server committed a protocol violation
Posted
Updated 6-May-16 3:52am
Comments
Kornfeld Eliyahu Peter 4-May-16 9:49am    
http://mehdi.me/a-tale-of-debugging-the-linkedin-api-net-and-http-protocol-violations/

1 solution

Open IIS -> Click HTTP Response Headers and Remove the X-Content-Type-Options=nosniff ... It worked for me... Courtesy Babu Arumugam
 
Share this answer
 
v2
Comments
Avinash6474 6-May-16 10:03am    
Thank you

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900