function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
SImmySImmy 

Can anyone please help me with URL TOO LONG Error? I am getting this error while deserializing, please suggest.


 
String Customer_Dataa='{"version":"string","Customer_Data":{"Customer_ID":"string","Customer_Reference_ID":"string","Customer_Name":"string","Worktag_Only":"true","Submit":"true","Create_Customer_from_Financial_Institution_Reference":{"Descriptor":"string","ID":{"type":"string","#text":"string"}},"Create_Customer_from_Supplier_Reference":{"Descriptor":"string","ID":{"type":"string","#text":"string"}},"Create_Customer_from_Tax_Authority_Reference":{"Descriptor":"string","ID":{"type":"string","#text":"string"}},"Create_Customer_from_Investor_Reference":{"Descriptor":"string","ID":{"type":"string","#text":"string"}},"Customer_Category_Reference":{"Descriptor":"string","ID":{"type":"string","#text":"string"}},"Restricted_To_Companies_Reference":{"Descriptor":"string","ID":{"type":"string","#text":"string"}},"Customer_Group_Reference":{"Descriptor":"string","ID":{"type":"string","#text":"string"}},"Customer_Preferred_Locale_Reference":{"Descriptor":"string","ID":{"type":"string","#text":"string"}},"Customer_Preferred_Language_Reference":{"Descriptor":"string","ID":{"type":"string","#text":"string"}},"Payment_Terms_Reference":{"Descriptor":"string","ID":{"type":"string","#text":"string"}},"Default_Payment_Type_Reference":{"Descriptor":"string","ID":{"type":"string","#text":"string"}},"DUNS_Number":"string","Credit_Limit_Currency_Reference":{"Descriptor":"string","ID":{"type":"string","#text":"string"}},"Credit_Limit":"1000.00","Hierarchy_Credit_Limit":"1000.00","Credit_Verification_Date":"2004-02-14","Commercial_Credit_Score":"1000.00","Commercial_Credit_Score_Date":"2018-11-01+00:00","Commercial_Credit_Score_Note":"string","Composite_Risk_Score":"1000.00","Composite_Risk_Date":"2013-05-22+00:00","Composite_Risk_Note":"string","Customer_Satisfaction_Score":"1000.00","Customer_Satisfaction_Date":"2002-11-05+00:00","Customer_Satisfaction_Note":"string","Tax_Code_Reference":{"Descriptor":"string","ID":{"type":"string","#text":"string"}},"Tax_ID_Data":{"Tax_ID_Text":"string","Tax_ID_Type_Reference":{"Descriptor":"string","ID":{"type":"string","#text":"string"}},"Transaction_Tax_ID":"false","Primary_Tax_ID":"false"},"Lockbox_Reference":{"Descriptor":"string","ID":{"type":"string","#text":"string"}},"Included_Children_Reference":{"Descriptor":"string","ID":{"type":"string","#text":"string"}},"Customer_Security_Segment_Reference":{"Descriptor":"string","ID":{"type":"string","#text":"string"}},"Business_Entity_Data":{"Business_Entity_Name":"string","Business_Entity_Phonetic_Name":"string","External_Entity_ID":"string","Contact_Data":{"Address_Data":{"Formatted_Address":"string","Address_Format_Type":"string","Defaulted_Business_Site_Address":"false","Delete":"true","Do_Not_Replace_All":"true","Effective_Date":"2010-03-18","Country_Reference":{"Descriptor":"string","ID":{"type":"string","#text":"string"}},"Last_Modified":"2018-12-28T19:51:14+00:00","Address_Line_Data":{"Descriptor":"string","Type":"string","#text":"string"},"Municipality":"string","Country_City_Reference":{"Descriptor":"string","ID":{"type":"string","parent_id":"string","parent_type":"string","#text":"string"}},"Submunicipality_Data":{"Address_Component_Name":"string","Type":"string","#text":"string"},"Country_Region_Reference":{"Descriptor":"string","ID":{"type":"string","#text":"string"}},"Country_Region_Descriptor":"string","Subregion_Data":{"Descriptor":"string","Type":"string","#text":"string"},"Postal_Code":"string","Usage_Data":{"Public":"false","Type_Data":{"Primary":"true","Type_Reference":{"Descriptor":"string","ID":{"type":"string","#text":"string"}}},"Use_For_Reference":{"Descriptor":"string","ID":{"type":"string","#text":"string"}},"Use_For_Tenanted_Reference":{"Descriptor":"string","ID":{"type":"string","#text":"string"}},"Comments":"string"},"Number_of_Days":"1000.00","Municipality_Local":"string","Address_Reference":{"Descriptor":"string","ID":{"type":"string","#text":"string"}},"Address_ID":"string"},"Phone_Data":{"Area_Code":"string","Tenant_Formatted_Phone":"string","International_Formatted_Phone":"string","Phone_Number_Without_Area_Code":"string","National_Formatted_Phone":"string","E164_Formatted_Phone":"string","Workday_Traditional_Formatted_Phone":"string","Delete":"false","Do_Not_Replace_All":"false","Country_ISO_Code":"str","International_Phone_Code":"string","Phone_Number":"string","Phone_Extension":"string","Phone_Device_Type_Reference":{"Descriptor":"string","ID":{"type":"string","#text":"string"}},"Usage_Data":{"Public":"false","Type_Data":{"Primary":"false","Type_Reference":{"Descriptor":"string","ID":{"type":"string","#text":"string"}}},"Use_For_Reference":{"Descriptor":"string","ID":{"type":"string","#text":"string"}},"Use_For_Tenanted_Reference":{"Descriptor":"string","ID":{"type":"string","#text":"string"}},"Comments":"string"},"Phone_Reference":{"Descriptor":"string","ID":{"type":"string","#text":"string"}},"ID":"string"},"Email_Address_Data":{"Delete":"true","Do_Not_Replace_All":"true","Email_Address":"string","Email_Comment":"string","Usage_Data":{"Public":"false","Type_Data":{"Primary":"true","Type_Reference":{"Descriptor":"string","ID":{"type":"string","#text":"string"}}},"Use_For_Reference":{"Descriptor":"string","ID":{"type":"string","#text":"string"}},"Use_For_Tenanted_Reference":{"Descriptor":"string","ID":{"type":"string","#text":"string"}},"Comments":"string"},"Email_Reference":{"Descriptor":"string","ID":{"type":"string","#text":"string"}},"ID":"string"},"Instant_Messenger_Data":{"Delete":"false","Do_Not_Replace_All":"true","Instant_Messenger_Address":"string","Instant_Messenger_Type_Reference":{"Descriptor":"string","ID":{"type":"string","#text":"string"}},"Instant_Messenger_Comment":"string","Usage_Data":{"Public":"false","Type_Data":{"Primary":"false","Type_Reference":{"Descriptor":"string","ID":{"type":"string","#text":"string"}}},"Use_For_Reference":{"Descriptor":"string","ID":{"type":"string","#text":"string"}},"Use_For_Tenanted_Reference":{"Descriptor":"string","ID":{"type":"string","#text":"string"}},"Comments":"string"},"Instant_Messenger_Reference":{"Descriptor":"string","ID":{"type":"string","#text":"string"}},"ID":"string"},"Web_Address_Data":{"Delete":"true","Do_Not_Replace_All":"false","Web_Address":"string","Web_Address_Comment":"string","Usage_Data":{"Public":"true","Type_Data":{"Primary":"true","Type_Reference":{"Descriptor":"string","ID":{"type":"string","#text":"string"}}},"Use_For_Reference":{"Descriptor":"string","ID":{"type":"string","#text":"string"}},"Use_For_Tenanted_Reference":{"Descriptor":"string","ID":{"type":"string","#text":"string"}},"Comments":"string"},"Web_Address_Reference":{"Descriptor":"string","ID":{"type":"string","#text":"string"}},"ID":"string"}},"Business_Entity_Logo_Image_Data":{"Filename":"string","Image":"YWM="}},"Settlement_Account_Data":{"Settlement_Bank_Account_ID":"string","Country_Reference":{"Descriptor":"string","ID":{"type":"string","#text":"string"}},"Currency_Reference":{"Descriptor":"string","ID":{"type":"string","#text":"string"}},"Bank_Account_Nickname":"string","Bank_Account_Type_Reference":{"Descriptor":"string","ID":{"type":"string","#text":"string"}},"Bank_Name":"string","Routing_Transit_Number":"string","Branch_ID":"string","Branch_Name":"string","Bank_Account_Number":"string","Check_Digit":"string","Bank_Account_Name":"string","Roll_Number":"string","IBAN":"string","SWIFT_Bank_Identification_Code":"string","Accepts_Payment_Types_Reference":{"Descriptor":"string","ID":{"type":"string","#text":"string"}},"Payment_Types_Reference":{"Descriptor":"string","ID":{"type":"string","#text":"string"}},"For_Supplier_Connections_Only":"false","Requires_Prenote":"true","Payment_Type_Prenote_Reference":{"Descriptor":"string","ID":{"type":"string","#text":"string"}},"Inactive":"false","Bank_Instructions":"string","Intermediary_Bank_Data":{"Intermediary_Bank_Account_ID":"string","Intermediary_Bank_Order":"string","Country_Reference":{"Descriptor":"string","ID":{"type":"string","#text":"string"}},"Currency_Reference":{"Descriptor":"string","ID":{"type":"string","#text":"string"}},"Bank_Account_Nickname":"string","Bank_Account_Type_Reference":{"Descriptor":"string","ID":{"type":"string","#text":"string"}},"Bank_Name":"string","Routing_Transit_Number":"string","Branch_ID":"string","Branch_Name":"string","Bank_Account_Number":"string","Check_Digit":"string","Bank_Account_Name":"string","Roll_Number":"string","IBAN":"string","SWIFT_Bank_Identification_Code":"string","Inactive":"false","Bank_Instructions":"string"}},"Credit_Card_Data":{"Merchant_Customer_Profile_ID":"string","Primary_Card":"true","Merchant_Account_Reference":{"Descriptor":"string","ID":{"type":"string","#text":"string"}},"Credit_Card_Type_Reference":{"Descriptor":"string","ID":{"type":"string","#text":"string"}},"First_Name":"string","Last_Name":"string","Expiration_Date":"2016-09-11","Last_4_Digits_of_Credit_Card_Number":"stri","Customer_Profile_ID":"string"},"Approval_Status_Reference":{"Descriptor":"string","ID":{"type":"string","#text":"string"}},"Customer_Status_Data":{"Customer_Status_Value_Reference":{"Descriptor":"string","ID":{"type":"string","#text":"string"}},"Reason_for_Customer_Status_Change_Reference":{"Descriptor":"string","ID":{"type":"string","#text":"string"}},"Customer_Status_Change_Reason_Description":"string"},"Proposed_Customer_Status_Data":{"Customer_Status_Value_Reference":{"Descriptor":"string","ID":{"type":"string","#text":"string"}},"Reason_for_Customer_Status_Change_Reference":{"Descriptor":"string","ID":{"type":"string","#text":"string"}},"Customer_Status_Change_Reason_Description":"string"},"Always_Separate_Payments":"false","Currency_Reference":{"Descriptor":"string","ID":{"type":"string","#text":"string"}},"Accepted_Currencies_Reference":{"Descriptor":"string","ID":{"type":"string","#text":"string"}},"Remit-from_Customer_Reference":{"Descriptor":"string","ID":{"type":"string","#text":"string"}},"Invoice_Delivery_Method_Reference":{"Descriptor":"string","ID":{"type":"string","#text":"string"}},"Invoice_Notification_Email_Recipients_Reference":{"Descriptor":"string","ID":{"type":"string","#text":"string"}},"Statement_Delivery_Method_Reference":{"Descriptor":"string","ID":{"type":"string","#text":"string"}},"Statement_Notification_Email_Recipients_Reference":{"Descriptor":"string","ID":{"type":"string","#text":"string"}},"Dunning_Delivery_Method_Reference":{"Descriptor":"string","ID":{"type":"string","#text":"string"}},"Dunning_Letter_Notification_Email_Recipients_Reference":{"Descriptor":"string","ID":{"type":"string","#text":"string"}},"Electronic_Invoicing_Start_Date":"2018-07-19+00:00","Electronic_Invoicing_Government_Issued_Customer_ID":"string","Electronic_Invoicing_Intermediary_Vendor_ID":"string","Electronic_Invoicing_Vendor_Issued_Customer_ID":"string","Mandate_Required":"true","Direct_Debit_Payment_Type_Reference":{"Descriptor":"string","ID":{"type":"string","#text":"string"}},"Default_Mandate_Reference":{"Descriptor":"string","ID":{"type":"string","#text":"string"}},"Business_Entity_Alternate_Name_Data":{"Alternate_Name":"string","Alternate_Name_Usage_Reference":{"Descriptor":"string","ID":{"type":"string","#text":"string"}}},"Tax_Status_Data":{"Country_Reference":{"Descriptor":"string","ID":{"type":"string","#text":"string"}},"Transaction_Tax_Status_Reference":{"Descriptor":"string","ID":{"type":"string","#text":"string"}},"Withholding_Tax_Status_Reference":{"Descriptor":"string","ID":{"type":"string","#text":"string"}}},"Business_Entity_Attachment_Data":{"Content_Type":"string","Filename":"string","Encoding":"string","Compressed":"true","File_Content":"ZGVkaXQ=","Comment":"string"},"Note_Data":{"Created":"2006-12-05T12:02:31","Last_Updated":"2016-09-11T13:29:58","Worker_Reference":{"Descriptor":"string","ID":{"type":"string","#text":"string"}},"Business_Entity_Contact_Reference":{"Descriptor":"string","ID":{"type":"string","#text":"string"}},"System_User_Reference":{"Descriptor":"string","ID":{"type":"string","#text":"string"}},"Note_Content":"string"},"Followup_Date":"2005-02-02","Related_Worktags_Data":{"Replace_All":"false","Related_Worktags_by_Type_Data":{"Worktag_Type_Reference":{"Descriptor":"string","ID":{"type":"string","#text":"string"}},"Required_On_Transaction":"true","Required_On_Transaction_For_Validation":"false","Default_Worktag_Data":{"Delete_Default_Value":"true","Default_Worktag_Reference":{"Descriptor":"string","ID":{"type":"string","#text":"string"}}},"Replace_All_Allowed_Values":"true","Allowed_Worktag_Data":{"Delete_Allowed_Value":"true","Allowed_Worktag_Reference":{"Descriptor":"string","ID":{"type":"string","#text":"string"}}}}}}}';

//Here I am deserializing it to my wrapper class and I am getting the error 
comWorkdayBsvc.Customer_WWS_DataType cd=new comWorkdayBsvc.Customer_WWS_DataType();
cd=(comWorkdayBsvc.Customer_WWS_DataType)json.deserialize(Customer_Dataa,comWorkdayBsvc.Customer_WWS_DataType.class); //Here it throws the error :
Error : Line: NaN, Column: undefined
Response to EXEC was : Bad Message 414
reason: URI Too Long
. HTTP CODE[414]
 
Best Answer chosen by SImmy
SImmySImmy
I figured out that even if I was deserializing the json in wrapper class, if the json was too long then i kept encountering this error. So I reduced some json which were not required and then it resolved the issue

All Answers

AnudeepAnudeep (Salesforce Developers) 
414 URI Too Longhttps://tools.ietf.org/html/rfc7231#page-61
 
The 414 (URI Too Long) status code indicates that the server is
refusing to service the request because the request-target (Section
5.3 of [RFC7230]) is longer than the server is willing to interpret.
This rare condition is only likely to occur when a client has
improperly converted a POST request to a GET request with long query
information, when the client has descended into a "black hole" of
redirection (e.g., a redirected URI prefix that points to a suffix of
itself) or when the server is under attack by a client attempting to
exploit potential security holes.
 
See the following posts

https://salesforce.stackexchange.com/questions/195449/what-is-the-longest-uri-that-salesforce-will-accept-through-the-rest-api

https://salesforce.stackexchange.com/questions/224420/bad-message-414-reason-uri-too-long

Anudeep
SImmySImmy
Thanks Anudeep for your reply. But here I'm only deserializing it so how come it's a get request or post request? It's just a deserialization to wrapper class. Sorry it maybe a silly question but I'm really confused.
SImmySImmy
I figured out that even if I was deserializing the json in wrapper class, if the json was too long then i kept encountering this error. So I reduced some json which were not required and then it resolved the issue
This was selected as the best answer