the content type 'application/json; charset=utf-8' was not the expected type 'text/xml; charset=utf-8'

前端 未结 2 765
面向向阳花
面向向阳花 2020-12-17 01:50

When using firebug, I got this wired error \"NetworkError: 415 Cannot process the ...xt/xml; charset=utf-8\'. - http://localhost:59899/wsccc1/wscccService.svc/RunTts

相关标签:
2条回答
  • 2020-12-17 02:16

    Go to your web.config endpoint tag and check if bindingConfiguration is properly present or not and also make sure the address is spelled correctly.

    <endpoint address="/YourName".../>
    
    0 讨论(0)
  • 2020-12-17 02:20

    You need to use the WebServiceHostFactory, instead of the regular ServiceHostFactory in your code. That will configure the endpoint with the appropriate binding (webHttpBinding) and behavior (webHttp) to honor the [WebInvoke] attribute.

    <serviceHostingEnvironment >
       <serviceActivations>
         <add factory="System.ServiceModel.Activation.WebServiceHostFactory"
              relativeAddress="./wsccc1/wscccService.svc" 
              service="service.wservice"/>
      </serviceActivations>
    </serviceHostingEnvironment>
    
    0 讨论(0)
提交回复
热议问题