XML
JSON
Gravatar is a globally recognized avatar based on your email address. JSON
  n/a
  All
  Jul 11, 2014 @ 06:43pm
Hi Rick,

I have done nothing previously with JSON but it has started to crop up as something I will need to know about.

Previously I have interacted with web services using httpGet with XML strings.

What do you have available at West Wind for JSON in terms of:

1. Doing the equivalent of a httpGet but with JSON strings instead of XML strings.
2. Parsing the JSON strings returned from a web service.

Is actual hitting of the web service the same with JSON as with XML? For example, could your WWHHTP stuff be used or is something different required for JSON?

Thanks in advance,

Regards,

Russell.

Gravatar is a globally recognized avatar based on your email address. Re: JSON
  Rick Strahl
  Russell
  Jul 11, 2014 @ 07:46pm
Russell,

You need some different tools for JSON generation.

The West Wind Client Tools include the wwJsonSerializer class which can serialize and deserialize JSON to and from Foxpro objects. It also supports cursor serialization, but not deserialization.

http://www.west-wind.com/webconnection/wwClient_docs/?page=_1wu18owba.htm

+++ Rick ---


Hi Rick,

I have done nothing previously with JSON but it has started to crop up as something I will need to know about.

Previously I have interacted with web services using httpGet with XML strings.

What do you have available at West Wind for JSON in terms of:

1. Doing the equivalent of a httpGet but with JSON strings instead of XML strings.
2. Parsing the JSON strings returned from a web service.

Is actual hitting of the web service the same with JSON as with XML? For example, could your WWHHTP stuff be used or is something different required for JSON?

Thanks in advance,

Regards,

Russell.



Rick Strahl
West Wind Technologies

Making waves on the Web
from Maui

Gravatar is a globally recognized avatar based on your email address. Re: JSON
  n/a
  Rick Strahl
  Jul 11, 2014 @ 07:58pm

Hi Rick,

Thanks for your quick reply.

When I run the code from the link you provided I get an error "Variable 'LDDATEVAL' is not found." on the "this.cOutput = ..." line immediately after "*** ISO Format" in the WriteDate function in wwjsonserializer.prg.

With regard to actually hitting a web service with a JSON string, are you saying that I couldn't do that with your WWHTTP stuff?

Regards,

Russell.


Russell,

You need some different tools for JSON generation.

The West Wind Client Tools include the wwJsonSerializer class which can serialize and deserialize JSON to and from Foxpro objects. It also supports cursor serialization, but not deserialization.

http://www.west-wind.com/webconnection/wwClient_docs/?page=_1wu18owba.htm

+++ Rick ---


Hi Rick,

I have done nothing previously with JSON but it has started to crop up as something I will need to know about.

Previously I have interacted with web services using httpGet with XML strings.

What do you have available at West Wind for JSON in terms of:

1. Doing the equivalent of a httpGet but with JSON strings instead of XML strings.
2. Parsing the JSON strings returned from a web service.

Is actual hitting of the web service the same with JSON as with XML? For example, could your WWHHTP stuff be used or is something different required for JSON?

Thanks in advance,

Regards,

Russell.



Gravatar is a globally recognized avatar based on your email address. Re: JSON
  Rick Strahl
  Russell
  Jul 11, 2014 @ 10:44pm

You might need to get a recent version. Also you should probably use the DeserializeJson() function instead of Deserialize() if you're using more complex Json.

+++ Rick ---


Hi Rick,

Thanks for your quick reply.

When I run the code from the link you provided I get an error "Variable 'LDDATEVAL' is not found." on the "this.cOutput = ..." line immediately after "*** ISO Format" in the WriteDate function in wwjsonserializer.prg.

With regard to actually hitting a web service with a JSON string, are you saying that I couldn't do that with your WWHTTP stuff?

Regards,

Russell.


Russell,

You need some different tools for JSON generation.

The West Wind Client Tools include the wwJsonSerializer class which can serialize and deserialize JSON to and from Foxpro objects. It also supports cursor serialization, but not deserialization.

http://www.west-wind.com/webconnection/wwClient_docs/?page=_1wu18owba.htm

+++ Rick ---


Hi Rick,

I have done nothing previously with JSON but it has started to crop up as something I will need to know about.

Previously I have interacted with web services using httpGet with XML strings.

What do you have available at West Wind for JSON in terms of:

1. Doing the equivalent of a httpGet but with JSON strings instead of XML strings.
2. Parsing the JSON strings returned from a web service.

Is actual hitting of the web service the same with JSON as with XML? For example, could your WWHHTP stuff be used or is something different required for JSON?

Thanks in advance,

Regards,

Russell.






Rick Strahl
West Wind Technologies

Making waves on the Web
from Maui

Gravatar is a globally recognized avatar based on your email address. Re: JSON
  n/a
  Rick Strahl
  Jul 21, 2014 @ 02:00am

Hi Rick,

Forgetting the parsing/Deserialization stuff, should I be able to push a JSON string at a web service and get back a JSON string as a response using your wwHTTP object with a httpGet call?

Regards,

Russell.


You might need to get a recent version. Also you should probably use the DeserializeJson() function instead of Deserialize() if you're using more complex Json.

+++ Rick ---


Hi Rick,

Thanks for your quick reply.

When I run the code from the link you provided I get an error "Variable 'LDDATEVAL' is not found." on the "this.cOutput = ..." line immediately after "*** ISO Format" in the WriteDate function in wwjsonserializer.prg.

With regard to actually hitting a web service with a JSON string, are you saying that I couldn't do that with your WWHTTP stuff?

Regards,

Russell.


Russell,

You need some different tools for JSON generation.

The West Wind Client Tools include the wwJsonSerializer class which can serialize and deserialize JSON to and from Foxpro objects. It also supports cursor serialization, but not deserialization.

http://www.west-wind.com/webconnection/wwClient_docs/?page=_1wu18owba.htm

+++ Rick ---


Hi Rick,

I have done nothing previously with JSON but it has started to crop up as something I will need to know about.

Previously I have interacted with web services using httpGet with XML strings.

What do you have available at West Wind for JSON in terms of:

1. Doing the equivalent of a httpGet but with JSON strings instead of XML strings.
2. Parsing the JSON strings returned from a web service.

Is actual hitting of the web service the same with JSON as with XML? For example, could your WWHHTP stuff be used or is something different required for JSON?

Thanks in advance,

Regards,

Russell.






Gravatar is a globally recognized avatar based on your email address. Re: JSON
  Rick Strahl
  Russell
  Jul 21, 2014 @ 01:49pm

Yes.

+++ Rick ---


Hi Rick,

Forgetting the parsing/Deserialization stuff, should I be able to push a JSON string at a web service and get back a JSON string as a response using your wwHTTP object with a httpGet call?

Regards,

Russell.


You might need to get a recent version. Also you should probably use the DeserializeJson() function instead of Deserialize() if you're using more complex Json.

+++ Rick ---


Hi Rick,

Thanks for your quick reply.

When I run the code from the link you provided I get an error "Variable 'LDDATEVAL' is not found." on the "this.cOutput = ..." line immediately after "*** ISO Format" in the WriteDate function in wwjsonserializer.prg.

With regard to actually hitting a web service with a JSON string, are you saying that I couldn't do that with your WWHTTP stuff?

Regards,

Russell.


Russell,

You need some different tools for JSON generation.

The West Wind Client Tools include the wwJsonSerializer class which can serialize and deserialize JSON to and from Foxpro objects. It also supports cursor serialization, but not deserialization.

http://www.west-wind.com/webconnection/wwClient_docs/?page=_1wu18owba.htm

+++ Rick ---


Hi Rick,

I have done nothing previously with JSON but it has started to crop up as something I will need to know about.

Previously I have interacted with web services using httpGet with XML strings.

What do you have available at West Wind for JSON in terms of:

1. Doing the equivalent of a httpGet but with JSON strings instead of XML strings.
2. Parsing the JSON strings returned from a web service.

Is actual hitting of the web service the same with JSON as with XML? For example, could your WWHHTP stuff be used or is something different required for JSON?

Thanks in advance,

Regards,

Russell.









Rick Strahl
West Wind Technologies

Making waves on the Web
from Maui

Gravatar is a globally recognized avatar based on your email address. Re: JSON
  n/a
  Rick Strahl
  Jul 21, 2014 @ 03:45pm

Ok - then I must be doing something wrong.

Thanks - it helps with the debugging if I know your wwHTTP object is not the issue.

Regards,

Russell.

Yes.

+++ Rick ---


Hi Rick,

Forgetting the parsing/Deserialization stuff, should I be able to push a JSON string at a web service and get back a JSON string as a response using your wwHTTP object with a httpGet call?

Regards,

Russell.


You might need to get a recent version. Also you should probably use the DeserializeJson() function instead of Deserialize() if you're using more complex Json.

+++ Rick ---


Hi Rick,

Thanks for your quick reply.

When I run the code from the link you provided I get an error "Variable 'LDDATEVAL' is not found." on the "this.cOutput = ..." line immediately after "*** ISO Format" in the WriteDate function in wwjsonserializer.prg.

With regard to actually hitting a web service with a JSON string, are you saying that I couldn't do that with your WWHTTP stuff?

Regards,

Russell.


Russell,

You need some different tools for JSON generation.

The West Wind Client Tools include the wwJsonSerializer class which can serialize and deserialize JSON to and from Foxpro objects. It also supports cursor serialization, but not deserialization.

http://www.west-wind.com/webconnection/wwClient_docs/?page=_1wu18owba.htm

+++ Rick ---


Hi Rick,

I have done nothing previously with JSON but it has started to crop up as something I will need to know about.

Previously I have interacted with web services using httpGet with XML strings.

What do you have available at West Wind for JSON in terms of:

1. Doing the equivalent of a httpGet but with JSON strings instead of XML strings.
2. Parsing the JSON strings returned from a web service.

Is actual hitting of the web service the same with JSON as with XML? For example, could your WWHHTP stuff be used or is something different required for JSON?

Thanks in advance,

Regards,

Russell.









Gravatar is a globally recognized avatar based on your email address. Re: JSON
  Rick Strahl
  Russell
  Jul 21, 2014 @ 10:15pm
What are you doing exactly? And what does the service expect?

+++ Rick --


Ok - then I must be doing something wrong.

Thanks - it helps with the debugging if I know your wwHTTP object is not the issue.

Regards,

Russell.

Yes.

+++ Rick ---


Hi Rick,

Forgetting the parsing/Deserialization stuff, should I be able to push a JSON string at a web service and get back a JSON string as a response using your wwHTTP object with a httpGet call?

Regards,

Russell.


You might need to get a recent version. Also you should probably use the DeserializeJson() function instead of Deserialize() if you're using more complex Json.

+++ Rick ---


Hi Rick,

Thanks for your quick reply.

When I run the code from the link you provided I get an error "Variable 'LDDATEVAL' is not found." on the "this.cOutput = ..." line immediately after "*** ISO Format" in the WriteDate function in wwjsonserializer.prg.

With regard to actually hitting a web service with a JSON string, are you saying that I couldn't do that with your WWHTTP stuff?

Regards,

Russell.


Russell,

You need some different tools for JSON generation.

The West Wind Client Tools include the wwJsonSerializer class which can serialize and deserialize JSON to and from Foxpro objects. It also supports cursor serialization, but not deserialization.

http://www.west-wind.com/webconnection/wwClient_docs/?page=_1wu18owba.htm

+++ Rick ---


Hi Rick,

I have done nothing previously with JSON but it has started to crop up as something I will need to know about.

Previously I have interacted with web services using httpGet with XML strings.

What do you have available at West Wind for JSON in terms of:

1. Doing the equivalent of a httpGet but with JSON strings instead of XML strings.
2. Parsing the JSON strings returned from a web service.

Is actual hitting of the web service the same with JSON as with XML? For example, could your WWHHTP stuff be used or is something different required for JSON?

Thanks in advance,

Regards,

Russell.












Rick Strahl
West Wind Technologies

Making waves on the Web
from Maui

Gravatar is a globally recognized avatar based on your email address. Re: JSON
  n/a
  Rick Strahl
  Jul 21, 2014 @ 10:44pm

Hi Rick,

I have managed to push a JSON request, and receive a JSON reply, from the API.

I was trying to include multiple headers with my wwHTTP object with .cExtraHeaders.

When I added the headers one by one using .addheader the httpGet successfully pushed the JSON to the API and I got a valid JSON string back.

I'm not all that worried about the parsing of the JSON as I can do that by inspection in this case.

The API in question is the Betfair API-NG - it has a Visualiser which is nice, as I can see the JSON requests and responses via the JavaScript Console in Google Chrome.

Anyway, I did need to ask you another question about the wwHTTP objects httpGet function if that's ok.

The login function of the API, which will need to be used when I'm interacting programatically with the API, requires a "self signed certificate" to form part of the JSON login request.

I don't even know what a "self signed certificate" - do you know if I'd be able to have this form part of the wwHTTP object and use it in the httpGet call?

By the way, would any of your JSON stuff allow me to treat the JSON string coming back at me as an object so that I can refer to elements with myObject.myElement.Value, for example, instead of parsing the JSON string using OCCURS() and STREXTRACT() etc.?

Thanks for your help.

Regards,

Russell.


What are you doing exactly? And what does the service expect?

+++ Rick --


Ok - then I must be doing something wrong.

Thanks - it helps with the debugging if I know your wwHTTP object is not the issue.

Regards,

Russell.

Yes.

+++ Rick ---


Hi Rick,

Forgetting the parsing/Deserialization stuff, should I be able to push a JSON string at a web service and get back a JSON string as a response using your wwHTTP object with a httpGet call?

Regards,

Russell.


You might need to get a recent version. Also you should probably use the DeserializeJson() function instead of Deserialize() if you're using more complex Json.

+++ Rick ---


Hi Rick,

Thanks for your quick reply.

When I run the code from the link you provided I get an error "Variable 'LDDATEVAL' is not found." on the "this.cOutput = ..." line immediately after "*** ISO Format" in the WriteDate function in wwjsonserializer.prg.

With regard to actually hitting a web service with a JSON string, are you saying that I couldn't do that with your WWHTTP stuff?

Regards,

Russell.


Russell,

You need some different tools for JSON generation.

The West Wind Client Tools include the wwJsonSerializer class which can serialize and deserialize JSON to and from Foxpro objects. It also supports cursor serialization, but not deserialization.

http://www.west-wind.com/webconnection/wwClient_docs/?page=_1wu18owba.htm

+++ Rick ---


Hi Rick,

I have done nothing previously with JSON but it has started to crop up as something I will need to know about.

Previously I have interacted with web services using httpGet with XML strings.

What do you have available at West Wind for JSON in terms of:

1. Doing the equivalent of a httpGet but with JSON strings instead of XML strings.
2. Parsing the JSON strings returned from a web service.

Is actual hitting of the web service the same with JSON as with XML? For example, could your WWHHTP stuff be used or is something different required for JSON?

Thanks in advance,

Regards,

Russell.












Gravatar is a globally recognized avatar based on your email address. Re: JSON
  n/a
  Russell
  Jul 21, 2014 @ 10:55pm

... I have noticed that there is a tool called cURL, which says that it "supports SSL certificates" ...

I guess my question is does your wwHTTP object support SSL certificates?

If not, do you have anything else that does support them?

If I can get to the point of getting the API's login function to work with the SSL certificate, then I would also be interested in looking at purchasing your JSON deserialization stuff if that can let me deal with objects.


Hi Rick,

I have managed to push a JSON request, and receive a JSON reply, from the API.

I was trying to include multiple headers with my wwHTTP object with .cExtraHeaders.

When I added the headers one by one using .addheader the httpGet successfully pushed the JSON to the API and I got a valid JSON string back.

I'm not all that worried about the parsing of the JSON as I can do that by inspection in this case.

The API in question is the Betfair API-NG - it has a Visualiser which is nice, as I can see the JSON requests and responses via the JavaScript Console in Google Chrome.

Anyway, I did need to ask you another question about the wwHTTP objects httpGet function if that's ok.

The login function of the API, which will need to be used when I'm interacting programatically with the API, requires a "self signed certificate" to form part of the JSON login request.

I don't even know what a "self signed certificate" - do you know if I'd be able to have this form part of the wwHTTP object and use it in the httpGet call?

By the way, would any of your JSON stuff allow me to treat the JSON string coming back at me as an object so that I can refer to elements with myObject.myElement.Value, for example, instead of parsing the JSON string using OCCURS() and STREXTRACT() etc.?

Thanks for your help.

Regards,

Russell.


What are you doing exactly? And what does the service expect?

+++ Rick --


Ok - then I must be doing something wrong.

Thanks - it helps with the debugging if I know your wwHTTP object is not the issue.

Regards,

Russell.

Yes.

+++ Rick ---


Hi Rick,

Forgetting the parsing/Deserialization stuff, should I be able to push a JSON string at a web service and get back a JSON string as a response using your wwHTTP object with a httpGet call?

Regards,

Russell.


You might need to get a recent version. Also you should probably use the DeserializeJson() function instead of Deserialize() if you're using more complex Json.

+++ Rick ---


Hi Rick,

Thanks for your quick reply.

When I run the code from the link you provided I get an error "Variable 'LDDATEVAL' is not found." on the "this.cOutput = ..." line immediately after "*** ISO Format" in the WriteDate function in wwjsonserializer.prg.

With regard to actually hitting a web service with a JSON string, are you saying that I couldn't do that with your WWHTTP stuff?

Regards,

Russell.


Russell,

You need some different tools for JSON generation.

The West Wind Client Tools include the wwJsonSerializer class which can serialize and deserialize JSON to and from Foxpro objects. It also supports cursor serialization, but not deserialization.

http://www.west-wind.com/webconnection/wwClient_docs/?page=_1wu18owba.htm

+++ Rick ---


Hi Rick,

I have done nothing previously with JSON but it has started to crop up as something I will need to know about.

Previously I have interacted with web services using httpGet with XML strings.

What do you have available at West Wind for JSON in terms of:

1. Doing the equivalent of a httpGet but with JSON strings instead of XML strings.
2. Parsing the JSON strings returned from a web service.

Is actual hitting of the web service the same with JSON as with XML? For example, could your WWHHTP stuff be used or is something different required for JSON?

Thanks in advance,

Regards,

Russell.













Gravatar is a globally recognized avatar based on your email address. Re: JSON
  n/a
  Rick Strahl
  Jul 22, 2014 @ 05:19am
Hi Rick,

Regarding getting a new version of WW Client Tools, how do I go about doing this? Can I get a demo version of it to test the DeserializeJson() function prior to buying the package?

Regards,

Russell.

Yes.

+++ Rick ---


Hi Rick,

Forgetting the parsing/Deserialization stuff, should I be able to push a JSON string at a web service and get back a JSON string as a response using your wwHTTP object with a httpGet call?

Regards,

Russell.


You might need to get a recent version. Also you should probably use the DeserializeJson() function instead of Deserialize() if you're using more complex Json.

+++ Rick ---


Hi Rick,

Thanks for your quick reply.

When I run the code from the link you provided I get an error "Variable 'LDDATEVAL' is not found." on the "this.cOutput = ..." line immediately after "*** ISO Format" in the WriteDate function in wwjsonserializer.prg.

With regard to actually hitting a web service with a JSON string, are you saying that I couldn't do that with your WWHTTP stuff?

Regards,

Russell.


Russell,

You need some different tools for JSON generation.

The West Wind Client Tools include the wwJsonSerializer class which can serialize and deserialize JSON to and from Foxpro objects. It also supports cursor serialization, but not deserialization.

http://www.west-wind.com/webconnection/wwClient_docs/?page=_1wu18owba.htm

+++ Rick ---


Hi Rick,

I have done nothing previously with JSON but it has started to crop up as something I will need to know about.

Previously I have interacted with web services using httpGet with XML strings.

What do you have available at West Wind for JSON in terms of:

1. Doing the equivalent of a httpGet but with JSON strings instead of XML strings.
2. Parsing the JSON strings returned from a web service.

Is actual hitting of the web service the same with JSON as with XML? For example, could your WWHHTP stuff be used or is something different required for JSON?

Thanks in advance,

Regards,

Russell.









Gravatar is a globally recognized avatar based on your email address. Re: JSON
  Rick Strahl
  Russell
  Jul 22, 2014 @ 12:59pm

Just download the latest version from the Web site and pick out the files you need or replace your existing ones (back up - commit in source control in case you end up rolling back).

+++ Rick ---



Hi Rick,

Regarding getting a new version of WW Client Tools, how do I go about doing this? Can I get a demo version of it to test the DeserializeJson() function prior to buying the package?

Regards,

Russell.

Yes.

+++ Rick ---


Hi Rick,

Forgetting the parsing/Deserialization stuff, should I be able to push a JSON string at a web service and get back a JSON string as a response using your wwHTTP object with a httpGet call?

Regards,

Russell.


You might need to get a recent version. Also you should probably use the DeserializeJson() function instead of Deserialize() if you're using more complex Json.

+++ Rick ---


Hi Rick,

Thanks for your quick reply.

When I run the code from the link you provided I get an error "Variable 'LDDATEVAL' is not found." on the "this.cOutput = ..." line immediately after "*** ISO Format" in the WriteDate function in wwjsonserializer.prg.

With regard to actually hitting a web service with a JSON string, are you saying that I couldn't do that with your WWHTTP stuff?

Regards,

Russell.


Russell,

You need some different tools for JSON generation.

The West Wind Client Tools include the wwJsonSerializer class which can serialize and deserialize JSON to and from Foxpro objects. It also supports cursor serialization, but not deserialization.

http://www.west-wind.com/webconnection/wwClient_docs/?page=_1wu18owba.htm

+++ Rick ---


Hi Rick,

I have done nothing previously with JSON but it has started to crop up as something I will need to know about.

Previously I have interacted with web services using httpGet with XML strings.

What do you have available at West Wind for JSON in terms of:

1. Doing the equivalent of a httpGet but with JSON strings instead of XML strings.
2. Parsing the JSON strings returned from a web service.

Is actual hitting of the web service the same with JSON as with XML? For example, could your WWHHTP stuff be used or is something different required for JSON?

Thanks in advance,

Regards,

Russell.












Rick Strahl
West Wind Technologies

Making waves on the Web
from Maui

© 1996-2024