Any suggestions on where to start looking?
2. Tell us the content type header being sent by the requesting
client.
it will return JSON
Sorry because this code is C# but you can change to VB.NET easy.
Return CreateDataTable(parms)
End Function
#2. I'm just testing it in VS.
> > > Any suggestions on where to start looking?- Hide quoted text -
>
> - Show quoted text -
I am trying to serialize the DataTable into a String as JSON. Here's
the code:
Using memStream As New MemoryStream
Dim serializer As New
DataContractJsonSerializer(lTable.GetType)
serializer.WriteObject(memStream, lTable)
Dim bytes As Byte() = memStream.GetBuffer()
returnValue = Encoding.UTF8.GetString(bytes, 0,
bytes.Length).Trim
End Using
I now have two problems.
1. The String returnValue contains XML, not JSON.
2. My web method appears to be returning the String as an XML document
containing a single string value that contains the text of
returnValue.
Thanks
On Dec 15, 3:45 am, Chikelue Oji <chike_...@yahoo.com> wrote:
> Hello Jtaylor,
>
> The easiest way I know to implement this is using Jayrock api/library.
> You can get more information by googling Jayrock.
>
> One sacrifice you may have to make is to rewrite and rebuild your webservice using Jayrock's template which I believe is implemented as a custom http handler. They provide a very simple example that will get you up and running quickly and it is not really complicated to use and won't be much work if the web service code you will need to rewrite is not enormous.
>
> I hope this becomes of help to you. Please let us all know if it is.
>
> Cheers.
>
> Chike
>
> ________________________________
> From: jtaylor <jtay...@lorencook.com>
> dotnetdevelopm...@googlegroups.com
> For more options, visit this group athttp://groups.google.com/group/dotnetdevelopment?hl=en?hl=en
Isn't that instantiating a new HttpContext object? Is that not the
right way to do it?