calling a web service using WCF over Http and Https

后端 未结 4 1144
感情败类
感情败类 2020-12-24 09:20

In our project we have a java web service that runs over http and https. We want to use http internally and https for the external version of our web app.

So we\'ve

4条回答
  •  伪装坚强ぢ
    2020-12-24 09:40

    I found an answer digging around MSDN.

    In my case, I was using a custom binding:

    
        
            
            
        
    
    

    That was referenced in the service

    
        
            
        
    
    

    Adding a second binding that used httpsTransport and then a second service that used that binding did the trick. Final output:

        
            
                
                
            
        
        
            
                
                    
                    
                
                
                    
                    
                
            
        
    

    May not be ideal, but it works. These were the only changes I made to make SSL work. Since it is all in the binding & transport, the code remains the same.

    Relevant MSDN links:

    1. Custom Binding: http://msdn.microsoft.com/en-us/library/ms731377.aspx
    2. HttpTransport: http://msdn.microsoft.com/en-us/library/system.servicemodel.channels.httptransportbindingelement.aspx
    3. HttpsTransport: http://msdn.microsoft.com/en-us/library/system.servicemodel.channels.httpstransportbindingelement.aspx

提交回复
热议问题