我的问题围绕着一个与JSONP相对应的IISWCF REST服务。 我在这一解决办法中使用了以下几类:。 并将其添加到地雷中。 事情在我的开发商工作站使用“运输网”的冒名,但当我试图进入发展服务器时,我遇到了一些安全问题。 这些问题通过以下配置和一个应用集合特性用户解决。 由于我没有机会让尼共(毛主义)成为尼泊尔共产党,我也把国际空间法学会的元数据库编成仅认证(我们正在使用国际空间法学会6,但很快将使用国际空间法研究所7,需要同时工作)。 我认为,目前的组合解决了我的安全问题,但在这个过程中,我的个人代表小组的回复被降级为Pregualar JSON/strong,这就是问题。 这里是相关组合:
<services>
<service name="IS.Core.Infrastructure.RESTRouter.Transactions" behaviorConfiguration="">
<endpoint address="" behaviorConfiguration="webHttp" binding="customBinding"
bindingConfiguration="jsonpBinding" contract="IS.Core.Infrastructure.RESTRouter.ITransactions">
</endpoint>
</service>
<service name="IS.Core.Infrastructure.RESTRouter.Queue" behaviorConfiguration="">
<endpoint address="" behaviorConfiguration="webHttp" binding="customBinding"
bindingConfiguration="jsonpBinding" contract="IS.Core.Infrastructure.RESTRouter.IQueue" />
</service>
</services>
<behaviors>
<endpointBehaviors>
<behavior name="webHttp">
<webHttp />
</behavior>
</endpointBehaviors>
</behaviors>
<bindings>
<customBinding>
<binding name="jsonpBinding">
<jsonpMessageEncoding />
<httpsTransport
manualAddressing="true"
authenticationScheme="Ntlm" />
</binding>
</customBinding>
</bindings>
<extensions>
<bindingElementExtensions>
<add name="jsonpMessageEncoding"
type="IS.Core.Infrastructure.RESTRouter.JsonpBindingExtension, RESTRouter, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" />
</bindingElementExtensions>
</extensions>
这里是接口方法定义之一:
[OperationContract]
[WebGet(UriTemplate = "{ModelPath}/{ObjectTypeName}?callback={callback}", ResponseFormat = WebMessageFormat.Json)]
[JSONPBehavior(callback = "callback")]
JSONPXml NewObject(string ModelPath, string ObjectTypeName, string callback);
执行:
[OperationBehavior(Impersonation = ImpersonationOption.Allowed)]
public JSONPXml NewObject(string ModelPath, string ObjectTypeName, string callback) {
int val = getEmployeeIdByNTUsername(OperationContext.Current.ServiceSecurityContext.PrimaryIdentity.Name);
JSONPXml jsp = null;
EntityPluginReflectorClient client = null;
try {
client = new EntityPluginReflectorClient();
string output = client.NewObject(ModelPath, ObjectTypeName);
jsp = new JSONPXml() { xml = output };
} catch (Exception e) {
InfrastructureLog.WriteException(this, "NewObject", e);
jsp = getExceptionResponse(e);
}
finally {
client.Close();
}
return (jsp);
}
这里是数据合同:
[DataContract()]
public class JSONPXml {
public JSONPXml() { }
[DataMember]
public string xml;
}
让我知道,是否需要更多信息,并对此加以研究。