Android Question iam getting error when i try to delete customer id

Makumbi

Well-Known Member
Licensed User
Good morning iam failing to pass parameter to web service when i try i get error . Note i want to delete one customer with number 103 from the database please help me
java.lang.NullPointerException: Attempt to invoke virtual method 'void anywheresoftware.b4a.http.HttpClientWrapper$HttpUriRequestWrapper.InitializeGet(java.lang.String)' on a null object reference


B4X:
    Dim Job As HttpJob
    Dim Job2 As HttpJob

    Job.Username="..."
    Job.Password="..."
    Job2.Username="..."
    Job2.Password="..."
 Dim k As String
    k="103"
    'Job.Download("https://xy.xy.com/api/barcode/1?barcode=" & BC & "&customer=kro")
    'Job.Download("http://192.168.1.239/WebServicesula/Service.asmx/Update?customerId=123&")
    'Job.Download2("http://192.168.1.239/WebServicesula/Service.asmx/delete?customerId=123&", Array As String(k))
    'Job.GetRequest.SetContentType("application/json")
    
    'Job2.PostString("http://192.168.1.239/WebServicesula/Service.asmx/Delete",jsonstring)
    'Job2.GetRequest.SetContentType("application/json")
    ProgressDialogShow2("Fetching data...", False)
    'Job2.Download2("http://192.168.1.239/WebServicesula/Service.asmx/delete?customerId=123&", Array As String("customerId","103"))
    Job.Download2("http://192.168.1.239/WebServicesula/Service.asmx/delete", Array As String("customerId","103"))
 

DonManfred

Expert
Licensed User
Dim Job As HttpJob
Dim Job2 As HttpJob

Job.Username=
"..."

You are NOT initializing the job!

HERE you did...
Dim Job As HttpJob
Dim Job2 As HttpJob

Job.Username=
"..."
Job.Password="..."
Job2.Username="..."
Job2.Password="..."
Dim k As Int
k=
"103"
'Job.Download("https://xy.xy.com/api/barcode/1?barcode=" & BC & "&customer=kro")
'Job.Download("http://192.168.1.239/WebServicesula/Service.asmx/Update?customerId=123&")
'Job.Download2("http://192.168.1.239/WebServicesula/Service.asmx/delete?customerId=123&", Array As String(k))
'Job.GetRequest.SetContentType("application/json")


'Send a POST request
Job2.Initialize("Job2", Me)
Job2.PostString(
"http://192.168.1.239/WebServicesula/Service.asmx/Delete?customerId=123&", k)
 
Upvote 0

Makumbi

Well-Known Member
Licensed User
Good morning iam failing to pass parameter to web service when i try i get error . Note i want to delete one customer with number 103 from the database please help me
java.lang.NullPointerException: Attempt to invoke virtual method 'void anywheresoftware.b4a.http.HttpClientWrapper$HttpUriRequestWrapper.InitializeGet(java.lang.String)' on a null object reference


B4X:
    Dim Job As HttpJob
    Dim Job2 As HttpJob

    Job.Username="..."
    Job.Password="..."
    Job2.Username="..."
    Job2.Password="..."
 Dim k As String
    k="103"
    'Job.Download("https://xy.xy.com/api/barcode/1?barcode=" & BC & "&customer=kro")
    'Job.Download("http://192.168.1.239/WebServicesula/Service.asmx/Update?customerId=123&")
    'Job.Download2("http://192.168.1.239/WebServicesula/Service.asmx/delete?customerId=123&", Array As String(k))
    'Job.GetRequest.SetContentType("application/json")
   
    'Job2.PostString("http://192.168.1.239/WebServicesula/Service.asmx/Delete",jsonstring)
    'Job2.GetRequest.SetContentType("application/json")
    ProgressDialogShow2("Fetching data...", False)
    'Job2.Download2("http://192.168.1.239/WebServicesula/Service.asmx/delete?customerId=123&", Array As String("customerId","103"))
    Job.Download2("http://192.168.1.239/WebServicesula/Service.asmx/delete", Array As String("customerId","103"))
 
Upvote 0
Top