Click here to Skip to main content
14,826,949 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I need to receive three parmeter into an webservice in an json format , from an android apps . here is my code .
Imports System.Web
Imports System.Web.Services
Imports System.Web.Services.Protocols

<System.Web.Script.Services.ScriptService()> _
<WebService(Namespace:="")> _
<WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _
Public Class Booking
    Inherits System.Web.Services.WebService

ResponseFormat:=Script.Services.ResponseFormat.Json)> _
  Public Function MobileBooking(ByVal Pickuplocation As String, ByVal Droplocation As String, ByVal latitude As String) As String
 Dim conObj As New ConnectionCls
        Dim clsConObj As New ConnectionCls
        Dim dts As String
        Dim ob(2) As Object
        ob(0) = Pickuplocation
        ob(1) = Droplocation
        ob(2) = latitude

dts =test.DataAccess.ExecuteNonQuery(clsConObj.getConnectionString, "Web_MobileBookingInsert", ob)
            If dts.ToString = -1 Then
                Return "Insert Failed"

                Return "Insert Sucessful"
            End If

The parameter will be passed from the android to the webservice in an jason format,is the above is corect for receiving the parameter
Updated 29-Mar-12 2:20am
Tejas Vaishnav 29-Mar-12 3:55am
provide proper tags
Nelek 29-Mar-12 4:13am
You forgot the code snippet tags ;)
ashok_89 29-Mar-12 4:28am
u mean the android code
Keith Barrow 29-Mar-12 6:46am
it looks OK, given a quick glance. You can test it using a .net client: if it works for .net it *should* work for any JSON based call, ignoring so odd edge cases it doesn't look like you have

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900