Click here to Skip to main content
15,880,037 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: vb.net desktop app zoom feature Pin
Eddy Vluggen23-Aug-17 9:57
professionalEddy Vluggen23-Aug-17 9:57 
SuggestionRe: vb.net desktop app zoom feature Pin
Richard MacCutchan23-Aug-17 21:17
mveRichard MacCutchan23-Aug-17 21:17 
QuestionHow to connect Excell 2017 to Oracle DB to get Data by using VBA code. Pin
hmanhha20-Aug-17 22:15
hmanhha20-Aug-17 22:15 
AnswerRe: How to connect Excell 2017 to Oracle DB to get Data by using VBA code. Pin
Richard MacCutchan21-Aug-17 0:39
mveRichard MacCutchan21-Aug-17 0:39 
GeneralRe: How to connect Excell 2017 to Oracle DB to get Data by using VBA code. Pin
hmanhha21-Aug-17 15:49
hmanhha21-Aug-17 15:49 
GeneralRe: How to connect Excell 2017 to Oracle DB to get Data by using VBA code. Pin
Mycroft Holmes21-Aug-17 19:59
professionalMycroft Holmes21-Aug-17 19:59 
QuestionMapWinGIS and Visual Basic Pin
Member 1336786618-Aug-17 15:20
Member 1336786618-Aug-17 15:20 
QuestionTrying to connect to SAP Pin
A_Griffin18-Aug-17 5:15
A_Griffin18-Aug-17 5:15 
SO I'm trying to connect to a SAP Business One Service Layer - according to their documentation:


> Before you perform any operation in Service Layer, you first need to log into Service Layer.
> Send this HTTP request for login:
> POST https://<server name="" ip="">:<port>/b1s/v1/Login
{"CompanyDB": "US506", "UserName": "manager", "Password": "1234"}

So, using the code from MS docs[^]

Dim request As WebRequest = WebRequest.Create("https://xxxxxxxx:port/b1s/v1/Login")
request.Method = "POST"
Dim postData As String = "{""CompanyDB"": ""XXXX"", ""UserName"": ""XXXX"", ""Password"": ""XXXX""}"
' have alternbatively tried the below - no difference in the result though
' Dim postData As String = New JavaScriptSerializer().Serialize("{""CompanyDB"": ""XXXX"", ""UserName"": ""XXXX"", ""Password"": ""XXXX""}")
Dim byteArray As Byte() = Encoding.UTF8.GetBytes(postData)
request.ContentType = "application/json; charset=utf-8"
request.ContentLength = byteArray.Length
Dim dataStream As Stream = request.GetRequestStream()
dataStream.Write(byteArray, 0, byteArray.Length)
dataStream.Close()
Dim response As WebResponse = request.GetResponse()
Console.WriteLine(CType(response, HttpWebResponse).StatusDescription)
dataStream = response.GetResponseStream()
Dim reader As New StreamReader(dataStream)
Dim responseFromServer As String = reader.ReadToEnd()
Console.WriteLine(responseFromServer)
reader.Close()
dataStream.Close()
response.Close()


And all I get back is "The remote server returned an error: (400) Bad Request.". Why??

I know a connection is possible, because I can connect using the Chrome extension Postman, using the same JSON data.

....

[edit] bugger something's come up and I have to pop out for a couple of hours. Apologies in advance if someone does answer and I'm not here....

modified 18-Aug-17 11:49am.

AnswerRe: Trying to connect to SAP Pin
Dave Kreskowiak18-Aug-17 7:18
mveDave Kreskowiak18-Aug-17 7:18 
GeneralRe: Trying to connect to SAP Pin
A_Griffin18-Aug-17 8:08
A_Griffin18-Aug-17 8:08 
GeneralRe: Trying to connect to SAP Pin
Richard Deeming18-Aug-17 8:18
mveRichard Deeming18-Aug-17 8:18 
GeneralRe: Trying to connect to SAP Pin
A_Griffin18-Aug-17 8:31
A_Griffin18-Aug-17 8:31 
GeneralRe: Trying to connect to SAP Pin
Dave Kreskowiak20-Aug-17 7:38
mveDave Kreskowiak20-Aug-17 7:38 
GeneralRe: Trying to connect to SAP Pin
A_Griffin20-Aug-17 8:45
A_Griffin20-Aug-17 8:45 
Questionvb.net desktop increase display size of app Pin
dcof16-Aug-17 4:03
dcof16-Aug-17 4:03 
AnswerRe: vb.net desktop increase display size of app Pin
Eddy Vluggen16-Aug-17 5:06
professionalEddy Vluggen16-Aug-17 5:06 
AnswerRe: vb.net desktop increase display size of app Pin
Graham Irons16-Aug-17 21:09
Graham Irons16-Aug-17 21:09 
GeneralRe: vb.net desktop increase display size of app Pin
Mycroft Holmes16-Aug-17 21:34
professionalMycroft Holmes16-Aug-17 21:34 
GeneralRe: vb.net desktop increase display size of app Pin
Graham Irons16-Aug-17 21:43
Graham Irons16-Aug-17 21:43 
GeneralRe: vb.net desktop increase display size of app Pin
Mycroft Holmes16-Aug-17 21:56
professionalMycroft Holmes16-Aug-17 21:56 
QuestionHTTPS WebRequest failing with ThreadAbortException Pin
Peter R. Fletcher4-Aug-17 5:45
Peter R. Fletcher4-Aug-17 5:45 
SuggestionRe: HTTPS WebRequest failing with ThreadAbortException Pin
Richard Deeming4-Aug-17 5:59
mveRichard Deeming4-Aug-17 5:59 
GeneralRe: HTTPS WebRequest failing with ThreadAbortException Pin
Peter R. Fletcher4-Aug-17 7:49
Peter R. Fletcher4-Aug-17 7:49 
GeneralRe: HTTPS WebRequest failing with ThreadAbortException Pin
Peter R. Fletcher5-Aug-17 5:09
Peter R. Fletcher5-Aug-17 5:09 
QuestionWinhttp and p12 certificate Pin
Crazy Joe Devola24-Jul-17 19:12
Crazy Joe Devola24-Jul-17 19:12 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.