这是带有ajaxcallback的WCF POST服务.它在我身边工作正常,但不在客户端工作.它给出错误 - POST http://localhost/WCFService/EService.svc/GetTIDFromRID 500(内部服务器错误).
方法:
[OperationContract]
[WebInvoke(Method = "POST",
RequestFormat = WebMessageFormat.Json,
ResponseFormat = WebMessageFormat.Json,
BodyStyle = WebMessageBodyStyle.WrappedRequest
)]
string GetTIDFromRID(string RID);
Run Code Online (Sandbox Code Playgroud)
服务Web.Config:
<system.diagnostics>
<sources>
<source name="System.ServiceModel.MessageLogging">
<listeners>
<add name="messages"
type="System.Diagnostics.XmlWriterTraceListener"
initializeData="c:\logs\northwindservices.svclog" />
</listeners>
</source>
</sources>
</system.diagnostics>
<system.serviceModel>
<diagnostics>
<messageLogging
logEntireMessage="false"
logMalformedMessages="true"
logMessagesAtServiceLevel="true"
logMessagesAtTransportLevel="false"
maxMessagesToLog="500"
maxSizeOfMessageToLog="5000"/>
</diagnostics>
</system.serviceModel>
<system.web>
<webServices>
<protocols>
<add name="HttpGet"/>
<add name="HttpPost"/>
</protocols>
</webServices>
<compilation debug="true" targetFramework="4.0"/>
<authentication mode="None"></authentication>
<pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID"/></system.web>
<appSettings>
<add key="ConStr" value="Data Source=C002;Initial Catalog=TEST;User ID=sa;Password=sa"/>
</appSettings>
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior name="EcubeBehavior"> …Run Code Online (Sandbox Code Playgroud)