Web Connection
Error while testing JSON REST Service
Gravatar is a globally recognized avatar based on your email address. Error while testing JSON REST Service
  Michele
  All
  Apr 19, 2018 @ 08:57am

I was trying what explained in documentation "Step by Step", accepting JSON parameters and trying it with a downloaded copy of websurge...I don't understan if my error is in what i insert in my class or in the way i use websurge... These are my code and websurge parameters... Sure i missed something..

Gravatar is a globally recognized avatar based on your email address. re: Error while testing JSON REST Service
  Rick Strahl
  Michele
  Apr 19, 2018 @ 06:56pm

Not sure based on what you're posting here.

You'll get that error if your Process class doesn't have a method named Customer:

The method should accept a single parameter:

FUNCTION Customer(lvParameter)
RETURN lvParameter  && just echo back what was passed as an object

IOW, you need to match your methods to your URLs just like standard Web Connection process classes.

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: Error while testing JSON REST Service
  Michele
  Rick Strahl
  Apr 20, 2018 @ 01:41am

SOLVED using foxpro to test my rest API instead of websurge...

Gravatar is a globally recognized avatar based on your email address. re: Error while testing JSON REST Service
  Rick Strahl
  Michele
  Apr 20, 2018 @ 12:29pm

Hmmm... the HTTP client you use really shouldn't have any effect on the behavior of the server.

One thing you should do with REST requests that post data is to always provide:

Content-Type: application/json

which makes content detection easier. OTOH WebSurge adds that automatically if not specified and there's a content body.

The error was most likely a missing method - did you end up fixing that?

+++ Rick ---

© 1996-2024