help with web methods
Posted
#1
(In Topic #411)
Trainee

I tried to use httpclient of curl, but could not. I have no idea what I am doing.. 8)
If anyone has a sample code for me to debug, I'd be most grateful.
All I need to do is use some methods on the remote server.
Here is how I failed (the objective is to run IsEInvoiceUser on the server):
$ww = "<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">" &
"<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">" &
"<IsEInvoiceUser xmlns="http://tempuri.org/">" &
"<userInfo Username="Uyumsoft" Password="Uyumsoft"/>" &
"<vknTckn> 9000068418 </vknTckn>" &
"<alias/></IsEInvoiceUser>" &
"</s:Body>" &
"</s:Envelope>"
$cu.URL = "http://efatura-test.uyumsoft.com.tr/services/BasicIntegration"
$cu.User = "Uyumsoft"
$cu.Password = "Uyumsoft"
$cu.Begin()
$cu.Post("application/json", $ww)
$wRes = $cu.Peek()
Message($wRes, "OK")
$cu.Close()
Posted
Guru


Posted
Trainee

OK. Trying out your code, I get segmentation fault.. (I get it all the time in new OS installations since 2020)
It used to be because of qt. Solved it by removing qt from the code. This time, I am using gtk3.
Here is the code.. (This code is the whole program)..
' Gambas class file
Public Sub Button1_Click()
Dim hClient As HttpClient 'To create a HTTP Client
Dim sResult As String
hClient = New HttpClient As "hClient" 'Create a HTTP Client
With hClient 'With the Client..
.URL = "http://efatura-test.uyumsoft.com.tr/services/BasicIntegration/IIntegration/GetInboxInvoiceList" 'Set up the URL
.Async = False 'No Asynchronous transmission?
.TimeOut = 60 'Don't hang around waiting for more than 60 seconds
.User = "Uyumsoft"
.Password = "Uyumsoft"
.get 'Get the data
End With
If Lof(hClient) Then sResult = Read #hClient, Lof(hClient)
Message(sResult, "Tamam")
End
Posted
Guru


Posted
Trainee

The segmentation fault came up in three different computers (a few moths ago) with our erp after an os update. All with debian, one with fedora.
With debian, it happened when I installed testing (11). I solved it by switching from qt to gtk3.
This one, your code, I was using 10.4.
I believe this peculiar to me. Maybe it is connected to a bug I have discovered in the gambas IDE.
During coding, when I use this character (such as message("","")): "
Sometimes the IDE crashes while I type (for about more than a year at least). This was a most frequent issue, not a once in while thing.
So I write it somewhere else and cut / paste the text inside the "". As long as I do this: Message("","") first, then paste the text no problems either running, or coding..
It might be that this has something to do with the Turkish layout (not os language) I am using and somehow, also connected to this segmentation fault business.
Any ideas would be appreciated.
Posted
Trainee

Worked fine with debian bullseye just now. Exactly the same code. I am confused.
1 guest and 0 members have just viewed this.



