Consuming WCF service using jQuery

后端 未结 3 1535
自闭症患者
自闭症患者 2021-02-05 21:20

Up to now I have used Web services and it worked fine. I added a new WCF service.
I am calling the services using jQuery. This is how I used jQuery to consume the Web servic

3条回答
  •  孤街浪徒
    2021-02-05 21:57

    Try adding this into your WCF config:

    
    
      
        
        
      
    
      
        
          
            
              
            
          
        
      
    
      
        
          
            
          
        
        
          
            
            
          
        
      
    
    
    

    Also, this is from what I have working in our app here:

    $.ajax({
            url: systemServiceURL,
            data: JSON.stringify(data),
            type: "POST",
            processData: true,
            contentType: "application/json",
            timeout: 10000,
            dataType: "json",
            beforeSend: function(req) {
                req.setRequestHeader('Authorization','Basic ');                
            },
            success: function(msg) {                
                //do stuff here
            },
            error: function(msg) {
                alert('error : ' + msg.d);
            }
        });
    

    EDIT: Tried modifying the web.config edited into the Question:

    
    
      
        
          
            

提交回复
热议问题