我在Azure雲中發佈WCF REST服務時遇到問題:服務收到呼叫,但整個查詢字符串丟失,POST URL中包含的所有參數均爲空。查詢字符串在Azure雲POST請求中被阻止WCF服務
下面是服務
<ServiceContract()>
Public Interface IRestServiceImpl
<OperationContract>
<WebInvoke(Method:="POST",
BodyStyle:=WebMessageBodyStyle.Bare,
ResponseFormat:=WebMessageFormat.Json,
RequestFormat:=WebMessageFormat.Json,
UriTemplate:="sendNotification?reason={reason}&eventDate={eventDate}&originalReference={originalReference}&merchantReference={merchantReference}&" & _
"currency={currency}&pspReference={pspReference}&merchantAccountCode={merchantAccountCode}&eventCode={eventCode}&" & _
"value={value}&operations={operations}&success={success}&paymentMethod={paymentMethod}&live={live}")>
Function sendNotification(eventDate As String, reason As String, originalReference As String, merchantReference As String,
currency As String, pspReference As String, merchantAccountCode As String, eventCode As String,
value As String, operations As String, success As String, paymentMethod As String, live As String) As String
End Interface
定義的合同並在服務
Public Function sendNotification(eventDate As String, reason As String, originalReference As String, merchantReference As String, currency As String, pspReference As String, merchantAccountCode As String, eventCode As String, value As String, operations As String, success As String, paymentMethod As String, live As String) As String Implements Common.IRestServiceImpl.sendNotification
Return "Got iT!"
End Function
這裏遵循relewant配置部分各執行功能,對於webrole
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
<services>
<service name = "PaymentServiceWebRole.AdyenNotificationService"
behaviorConfiguration = "myServiceBehavior" >
<endpoint name="webHttpBinding"
address=""
binding="webHttpBinding"
contract="TripRebelCommon.ServiceContracts.IRestServiceImpl"
behaviorConfiguration="webHttp"
>
</endpoint>
</service>
以及用於發佈數據的網址:
HTTP:// * .cloudapp.net/MyService.svc/sendNotification的pspReference = 8814002409046667 & EVENTDATE = 2014-05-16T11:48:28.01Z & merchantAccountCode = TriprebelCOM &原因= 36069:1111:二千〇一十六分之六& originalReference = &值= 10 & EVENTCODE =授權& merchantReference = 33個&操作=取消,捕捉,退款&成功=真& PAYMENTMETHOD = MC &貨幣= EUR &活=假
因此,問題是當外部服務進行測試時,我只收到 「/MyService.svc/sendNotification」
根本沒有包含任何QUERYString。我使用Fiddler從本地PC執行同一個雲服務 - 這一切正常,我收到日期並處理它。
最糟糕的是 - 它已經一個星期前工作時,我做了第一次測試,現在這是推動我堅果,因爲我canno這裏看不到任何明顯的問題,但我必須失去了一些小東西,剎車這一點。
希望在解決這個問題上有任何幫助。