WCF REST: Maximum number of strings which can be passed in a webInvoke method?

Here is the code below

I tried this call but it didnt work... even if the function inside this call is empty i tried this exact function call with only 5 input parameters and it worked? Something is fishy here hopefully someone can suggest and if you have anyway i can minimize this code meaning the parameters passes im open for suggestions anytime.

Code below:

 [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
        }

This is how I implement the function above:

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();
            }

Thanks

Answers


You don't have a body parameter, PUT requires a body.

Beyond that, PUT is not equivalent to doing an Update stored procedure. Don't try and do this, it does not make any sense. All those parameters need to go in the body.

There are physical limits to URL length, so you may be running into an issue because of that.


Need Your Help

Is there any way to FORCIBLY allow the usage of '<' and/or '>' in XML files?

c# xml xmldocument

I have written a C# application that loads XML files, parses them and uses the information to run SQL queries and send the results to email distribution lists.

Swap 2 char of a C++ array

c++ arrays for-loop char c-strings

I have a problem with memory access. When i = 0, Visual Studio throws an exception with reference to a line as labelled in the following code.