工作,我有一個服務需要幫忙的getJSON通過SSL
[OperationContract]
[WebGet(ResponseFormat = WebMessageFormat.Json, RequestFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Wrapped)]
public Customer GetCustomer(string customerNumber)
{
return _service.GetCustomer(customerNumber);
}
,我從使用jQuery
var customerNumber = '123456';
$.getJSON('/JsonServices/B2BServiceJson.svc/GetCustomer', { customerNumber: customerNumber }, customerSelected);
這裏網頁調用對於的getJSON調用回調:
// HELP! result is null when SSL is enabled
function customerSelected(result) {
var customer = result.GetCustomerResult;
var email = customer.Email;
// other stuff
}
這裏是配置
<system.serviceModel>
<services>
<service name="B2B.JsonServices.B2BServiceJson">
<endpoint address="" binding="webHttpBinding" contract="B2B.JsonServices.B2BServiceJson"
behaviorConfiguration="ajaxBehavior" />
</service>
</services>
<behaviors>
<endpointBehaviors>
<behavior name="ajaxBehavior">
<webHttp />
</behavior>
</endpointBehaviors>
</behaviors>
<!-- other stuff -->
這工作得很好,直到我在我的服務器上啓用了SSL。現在getJSON調用成功,但返回null。 請幫我通過SSL獲取此工作。由於
我的環境是淨3.5,IIS 7
您是否在服務上啓用了SSL? http://stackoverflow.com/questions/425978/enable-ssl-for-my-wcf-service – 2012-01-13 00:34:10
該服務是爲整個站點啓用了SSL的大型網站的一部分。我是否需要明確地爲服務本身做些事情? – Sisiutl 2012-01-13 03:44:43
有關於您的配置的快速問題?您的配置顯示服務類名稱和合同名稱是相同的「B2B.JsonServices.B2BServiceJson」。是否正確,是否在沒有SSL的情況下使用相同的配置 – Rajesh 2012-01-13 09:49:55