NetTalk Central

Author Topic: NetWebServiceMethod  (Read 135 times)

rupertvz

  • Sr. Member
  • ****
  • Posts: 336
    • View Profile
    • Email
NetWebServiceMethod
« on: April 30, 2026, 01:09:47 PM »
Hi Guys,

I?m working with NetTalk WebServer and using a NetWebServiceMethod procedure.

I can successfully call the endpoint and the procedure executes, but I?m struggling to get a JSON response to return in the browser. Currently, the request runs, but the response is blank when JSON is selected.

I have:

A queue defined for return (Q)
JSON enabled in the template
ServiceMethod populating the queue

However, it seems like the JSON branch in BuildResult / BuildResultFields is not being generated or executed.

My questions:

Is there a recommended example app or webinar showing a working NetWebServiceMethod returning JSON?
Should JSON responses for queues be handled purely via template, or is manual handling (e.g. AddJSONFromQueue) expected?
Is there a standard pattern for returning simple JSON (without queues)?

Any guidance or working example would be appreciated.

seanh

  • Jr. Member
  • **
  • Posts: 99
    • View Profile
    • Email
Re: NetWebServiceMethod
« Reply #1 on: April 30, 2026, 06:24:55 PM »
have you set the content type?
net.ContentType = 'application/json'

Jane

  • Sr. Member
  • ****
  • Posts: 426
  • Expert on nothing with opinions on everything.
    • View Profile
    • Email
Re: NetWebServiceMethod
« Reply #2 on: April 30, 2026, 09:17:53 PM »
Are you trying to send JSON to a web browser or to a client of some sort?

There's a NetTalk example WebServiceRequiresXFiles (77) that includes two apps - a client and a web server.

It's also often useful to use the netdemo example program as a web client to debug what you're doing.