Annulé webservice rebuilt using content body instead of parameter


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

Compétences : .NET, Serveur SQL Microsoft, VB.NET, Visual Basic, Services Internet

en voir plus : asp net webservice calling vb, net webservice servicedesk wrapper, net webservice post php, develop currecy converter project using net, import text file database using net, converting csv access using net, code project shoping cart using net, skills needed net webservice, save arabic sql server 2005 using net, php net webservice, axis2 client net webservice, developing electronic signature software using net, playing mp3s using net compact framework, read xml file using net insert sql server, crystal report parameter screen using net

Concernant l'employeur :
( 49 commentaires ) Walled Lake, United States

Nº du projet : #12665520

6 freelance font une offre moyenne de $54 pour ce travail

%bids___i_sum_sub_32% %project_currencyDetails_sign_sub_33% USD en 1 jour
(13 Commentaires)

Hello, Im interested to work on this. If you are interested, i will work on next 2 hours and complete the work. Thanks, Sheik

%bids___i_sum_sub_32% %project_currencyDetails_sign_sub_33% USD en 1 jour
(11 Commentaires)

I’d like to be considered for your " webservice rebuilt using content body instead of parameter" project. I'm software engineer with more than 3 years experience in Development & Designing. I'm exper Plus

%bids___i_sum_sub_35% %project_currencyDetails_sign_sub_36% USD en 0 jours
(4 Commentaires)

Dear Sir, I think my profile and experience may be a good to [login to view URL] further information i will ask you some question at interview time. I am writing to express my interest in the .NET Programmers post for your Plus

%bids___i_sum_sub_32% %project_currencyDetails_sign_sub_33% USD en 1 jour
(1 Évaluation)

Dear Client, Thanks for providing us opportunity to place bid over the project and communicate with [login to view URL] mainly deal in web development, SEO, Android App, software testing and graphic design. Our vision is to b Plus

%bids___i_sum_sub_35% %project_currencyDetails_sign_sub_36% USD en 6 jours
(0 Commentaires)


%bids___i_sum_sub_32% %project_currencyDetails_sign_sub_33% USD en 1 jour
(0 Commentaires)