Failing to access the server from VBA (1 Viewer)

nector

Member
Local time
Today, 08:18
Joined
Jan 21, 2020
Messages
404
Hello

Whenever I try to communicate with the server it return the response as below which is clearly an error:

Code:
{"timestamp":"2024-02-03T14:23:38.333+00:00","status":404,"error":"Not Found","path":"/nector/"}

Below is my VBA code

Code:
Private Sub CmdInitializer_Click()
Dim n As Integer
Dim Request As Object
Dim stUrl As String
Dim Response As String
Dim requestBody As String
stUrl = "http://localhost:8080/nectorserverdf/"
Set Request = CreateObject("MSXML2.XMLHTTP")
requestBody = "{ ""Tax Pin"": ""1002623668"", " & _
    """BranchID"": ""012300"", " & _
    """fvcSrLno"": ""nec60000005""}"
    With Request
        .Open "POST", stUrl, False
        .setRequestHeader "Content-type", "application/json"
        .send requestBody
        Response = .responsetext
    End With
If Request.Status <> 200 Then
MsgBox Request.responsetext, vbCritical, "Internal Audit Manager"
n = FreeFile()
Open "C:\Users\necto\Desktop\Testing\test.txt" For Output As #n
Print #n, Request.responsetext
Close #n
Exit Sub
End If
End Sub

I do not believe that the code has anything to do with this , any idea here? I have run out of ideas now
 

cheekybuddha

AWF VIP
Local time
Today, 06:18
Joined
Jul 21, 2014
Messages
2,378
What are you using to run your server? A node application?
 

nector

Member
Local time
Today, 08:18
Joined
Jan 21, 2020
Messages
404
Its Apache tomcat, this is done via JAVA runtime with the deployed WAR files in Apache tomcat
 

Edgar_

Active member
Local time
Today, 00:18
Joined
Jul 8, 2023
Messages
444
Well, your server is responding, which is why you got that pretty error. So you CAN access your server. That error suggests you should check the URL and its requestBody. Can you do the POST request from some other place?
 

gemma-the-husky

Super Moderator
Staff member
Local time
Today, 06:18
Joined
Sep 12, 2006
Messages
15,749
404 is webpage not found.
Are you sure about the strurl
I just tried pasting it on my phone and got a standard error message. Try it on your system and see what happens.
 

nector

Member
Local time
Today, 08:18
Joined
Jan 21, 2020
Messages
404
its seams like the client server they changed the path , I have to contact them on Monday next week
 

Users who are viewing this thread

Top Bottom