これが以下のコードです
この呼び出しを試しましたが、機能しませんでした...この呼び出し内の関数が空であっても、5つの入力パラメーターのみを使用してこの正確な関数呼び出しを試しましたが、機能しましたか?ここで何かが怪しいです。誰かが提案できることを願っています。とにかく持っている場合は、このコードを最小化できます。つまり、パラメーターはいつでも提案のために開かれます。
以下のコード:
[WebInvoke(UriTemplate = "customer/update/customerCode={customerCode}/customerName={customerName}/customerCountry={customerCountry}/customerTelephone={customerTelephone}/customerEmail={customerEmail}/customerCreditLimit={customerCreditLimit}/customerCommission={customerCommission}/customerRank={customerRank}/contactFullname={contactFullname}/contactBusinessPhone={contactBusinessPhone}/contactTimezone={contactTimezone}/contactActive={contactActive}/contactDepartment={contactDepartment}/contactHomePhoneExtension={contactHomePhoneExtension}/shipToCountry={shipToCountry}/shipToPaymentTerm={shipToPaymentTerm}/shipToCommissionPercent={shipToCommissionPercent}/shipToTruckSize={shipToTruckSize}/shipToTaxNumber={shipToTaxNumber}/shipToRouteCode={shipToRouteCode}/shipToOpenTime={shipToOpenTime}/shipToCloseTime={shipToCloseTime}", Method = "PUT", BodyStyle = WebMessageBodyStyle.Wrapped)]
public void UpdateCustomer(string customerCode, string customerName, string customerCountry, string customerTelephone, string customerEmail,
string customerCreditLimit, string customerCommission, string customerRank, string contactFullname,
string contactBusinessPhone, string contactTimezone, string contactActive, string contactDepartment,
string contactHomePhoneExtension, string shipToCountry, string shipToPaymentTerm, string shipToCommissionPercent,
string shipToTruckSize, string shipToTaxNumber, string shipToRouteCode, string shipToOpenTime,
string shipToCloseTime)
{
// code or no code
}
これが私が上記の関数を実装する方法です:
using (HttpResponseMessage response = m_RestHttpClient.Put("customer/update/customerCode=CUST190/customerName=Ralph Lauren/customerCountry=United Kingdom/customerTelephone=1234567489/customerEmail=ralph@lauren.com/customerCreditLimit=1/customerCommission=5/customerRank=45/contactFullname=Diego Sin/contactBusinessPhone=911/contactTimezone=6/contactActive=True/contactDepartment=Sales/contactHomePhoneExtension=456/shipToCountry=Uganda/shipToPaymentTerm=NET30/shipToCommissionPercent=1/shipToTruckSize=50/shipToTaxNumber=777/shipToRouteCode=001/shipToOpenTime=10 am/shipToCloseTime=11pm", frm.CreateHttpContent()))
{
response.EnsureStatusIsSuccessful();
}
ありがとう