calling a simple WCF Service from jQuery

后端 未结 3 1868
臣服心动
臣服心动 2021-01-03 03:49

I have a very simple WCF Service called pilltrkr.svc. I\'m trying to call this service from jQuery via the following code:

    var jsondata = JSON.stringif         


        
3条回答
  •  执念已碎
    2021-01-03 04:09

    I figured out how to finally call my simple WCF service from jQuery. I found some source code after reading this link:

    http://www.west-wind.com/weblog/posts/2009/Sep/15/Making-jQuery-calls-to-WCFASMX-with-a-ServiceProxy-Client. This link doesn't provide the source but it was another page that referenced this link.

    Anyway, I downloaded the code and started to compare my code versus this working project that was calling a WCF Service via jQuery. What I found was that my web.config file was way too complicated so I shorted that up considerably. Then I also realized that my methods were not public. So I made them public and then after a few more tweaks (i.e. taking out the namespaces) the page started to return the simple string I was trying to return.

      
        
          
                    
          
        
        
          
            
              
              
            
          
          
            
              
            
          
        
        
      
    

提交回复
热议问题