--Updated with Stack Trace Error--
I'm struggling trying to get the following code to process correctly:
curl -v -u SD4FWFCF-ASD2-32FD-AF34-F34A4FA4CA34:CO0I0MM0-2349-OIJC-3409-234F098JJ3F4 -H "Accept: application/json" -H "Content-type: application/json" -X POST -d '{"email":"[email protected]","amountPaid":19.99,"systemName":"test-purchase","recipientPhoneNumber":"5558884321","senderPhoneNumber":"8005551234","deliveryDate":null,"paymentType":5,"scriptValues":[{"key":"fname","value":"john"},{"key":"lname","value":"doe"},{"key":"width","value":"medium"},{"key":"length","value":"large"},{"key":"city","value":"Fairbanks"},{"key":"state","value":"alaska"}]}' -k "https://api.example.com/processorder" -o output.html
Every time I run this, I receive a 500 Internal Server Error
.
Here is an example of that error:
Server Error in '/' Application.
Sequence contains no elements
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.InvalidOperationException: Sequence contains no elements
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[InvalidOperationException: Sequence contains no elements]
System.Linq.Enumerable.Single(IEnumerable1 source) +371
1 source, Expression
System.Linq.Queryable.Single(IQueryable1 predicate) +590
2 parameters) +248
Example.Web.Areas.Api.Controllers.ApiController.ProcessOrder(JsonProcessOrder model) in C:\Example.Web\Areas\Api\Controllers\ApiController.cs:1221
lambda_method(Closure , ControllerBase , Object[] ) +127
System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary2 parameters) +39
1 continuation) +640
System.Web.Mvc.<>c__DisplayClass15.<InvokeActionMethodWithFilters>b__12() +125 System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func
System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodWithFilters(ControllerContext controllerContext, IList1 filters, ActionDescriptor actionDescriptor, IDictionary
2 parameters) +312
System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) +691
System.Web.Mvc.Controller.ExecuteCore() +162
System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext) +305 Example.Web.DataController.Execute(RequestContext requestContext) in C:\Example.Web\DataController.cs:180
System.Web.Mvc.<>c_DisplayClassb.b_5() +62
System.Web.Mvc.Async.<>c_DisplayClass1.b_0() +20
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +469 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +375Version Information: Microsoft .NET Framework Version:4.0.3; ASP.NET Version:4.0.3
I've tried to alter the json, but I can't figure it out for the life of me.
ProcessOrder
method? – Abe MiesslerSingle
on an empty sequence, but without seeing the code it's anyone's guess. Is it possible that you left a required parameter out? Perhaps inscriptValues
? – Abe Miessler