[url removed, login to view] webservice rebuilt using content body instead of parameter

Цей проект отримав 6 заявок від талановитих фрілансерів з середньою заявкою у $54 USD.

Отримайте безкоштовно цінові пропозиції на схожі проекти
Бюджет проекту
$10 - $30 USD
Усього заявок
Описання проекту


I need a web service, similar to the one posted below to accepts JSON data and saves it to a MS SQL table. It must accept multiple rows and multiple columns.

IMPORTANT, it must accept the data through the body of the POST instead of a parameter. The current sample code (BELOW) works fine, but I need to submit the data through the strData parameter. I need to submit through the body. It should be something like: <HttpPost> Public Function UploadTest(<FromBody()> ByVal strInput() As clsTest) as string

I cannot give you access to my server. I will give you a sql data structure and sample code. You will deliver a full .net solution that I can test with, then I will migrate to my environment.

table structure:

CREATE TABLE [dbo].[tblTest](

[intCol1] [int] NULL,

[strCol2] [nvarchar](50) NULL,

[dteCol3] [date] NULL


Sample XML to upload:

[{"intCol1":13,"strCol2":"13 Test","dteCol3":"12/13/1997"}]

Sample Code:

<WebMethod()> _

Public Sub UploadTestData(strData As String)


If [url removed, login to view](strData) Then

[url removed, login to view]("No Data Passed")


End If

Dim lst As List(Of clsTest) = [url removed, login to view](Of List(Of clsTest))(strData)

Dim conn As New [url removed, login to view]([url removed, login to view]("ConnString2").ConnectionString)

If [url removed, login to view] <> [url removed, login to view] Then

[url removed, login to view]()

End If

Dim nCount = 0

If lst IsNot Nothing And [url removed, login to view] > 0 Then

For j = 0 To [url removed, login to view] - 1

Dim strSQL = "insert into tblTest([intCol1],[strCol2],[dteCol3]) values (" & _

lst(j).[url removed, login to view] & ",'" & lst(j).[url removed, login to view] & "','" & lst(j).[url removed, login to view] & "');"

Dim cmd As New SqlCommand(strSQL, conn)

Dim res = [url removed, login to view]()

If res = 1 Then

nCount = nCount + 1

End If


[url removed, login to view]()

[url removed, login to view]([url removed, login to view]() + " Record Successfully Added.")

End If

Catch ex As Exception

[url removed, login to view]([url removed, login to view]())

End Try

End Sub

Хочете заробити?

  • Визначте бюджет та часові рамки
  • Виділіть Вашу пропозицію
  • Отримайте оплату за Вашу роботу

Найняти фрілансерів, які також подавали заявки в цей проект

    • Forbes
    • The New York Times
    • Time
    • Wall Street Journal
    • Times Online