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

<System.Web.Script.Services.ScriptService()> _
<WebService(Namespace:="http://tempuri.org/")> _
<WebServiceBinding(ConformsTo:=WsiProfiles.BasicProfile1_1)> _
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> 
Public Class Booking
    Inherits System.Web.Services.WebService
   

<webmethod()>
<system.web.script.services.scriptmethod(usehttpget:>
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
        Try

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

                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
Posted
Updated 29-Mar-12 2:20am
v10
Comments
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