錯誤:無法找到帶有參數{part = {...},storeId = {...},contractId = {...}}的Web服務操作....調用.NET Web Service的ColdFusion 9 - 無法找到帶參數的Web服務操作。幫幫我!
我創建了一個.NET Web服務,與ColdFusion頁面交談。當用戶在零件號字段中輸入零件號然後選中它時,會調用Web服務以獲得該零件的適當定價。它如何得到定價在幕後完成,是無關緊要的,而且爲了我想要達到的目的,這裏顯得太複雜了。
這是我竟能導通我有ColdFusion頁傳遞3個變量:部分,STOREID,並contractId。
<cfset vars = structNew()> <cfset vars["contractId"] = "#Trim(Attributes.contract)#"> <cfset vars["part"] = "#Trim(Attributes.part)#"> <cfset vars["storeId"] = "#Trim(Attributes.store)#"> <cfinvoke webservice = "http://compassnetdev/Services/CustomerContractPartPrice.asmx?wsdl" method = "GetCustomerContractPrice" returnVariable = "price" argumentCollection = "#vars#"> </cfinvoke>
之前,我剛結束了contractId和部分傳遞中,和它的工作很大。沒問題。但自從我在STOREID補充,它拋出此錯誤消息了:
Error Occurred While Processing Request Web service operation GetCustomerContractPrice with parameters {part={BV410070},storeId={001},contractId={21}} cannot be found. The error occurred in C:\inetpub\wwwroot\CustomTags\fn_get_price_2.cfm: line 58 56 : method = "GetCustomerContractPrice" 57 : returnVariable = "price" 58 : argumentCollection = "#vars#"> 59 : 60 :
正如你可以看到它變得我傳遞就好值。
我確信的:
我確信上面指出的Web服務地址是電流(意思是,我確信,這是包含我的新參數的最新版本)。
我手動轉到Web服務,並顯示wsdl(如預期)。
我可以通過轉到Web服務URL來手動調用Web服務。我可以輸入3個變量並單擊Invoke,並返回正確的值。
這裏是我的web服務代碼:
public class CustomerContractPartPrice : System.Web.Services.WebService { [WebMethod] public decimal GetCustomerContractPrice(string part, string storeId, int contractId) { var context = new PricingBLL(); decimal price = context.GetCustomerContractPartPrice(contractId, part, storeId); return price; } }
這是寫給業務對象和做的工作,並返回結果。最終我認爲這是一個ColdFusion/.NET互操作性問題。思考?
太棒了,我認爲這是我的問題的根源!感謝您的迴應。當我發現答案時,請參閱上面的答案! – 2011-04-06 13:59:05