-
Mar 12th, 2015, 05:21 PM
#1
Thread Starter
Hyperactive Member
Unable to use HTTP API from inside a web service
I have built a web service using VB.NET and the thing is rock-solid on my IIS server. Recently, I signed up for Click-a-tell (SMS Messaging service) and they have an API where I can send messages via HTTP. I'm can kick this off without issue in a Windows Forms environment, but from within the web service it isn't working.
Does anybody know how I can kick off an HTTP call from inside of a web service. Ideally, I would like to make the call and then if a browser window must open to do so - close it automatically.
Here's my added code to my web service:
VB Code:
If variance <> 0 Then
Try
Dim ut As New SveDsTableAdapters.UserTextingTableAdapter
For Each row As DataRow In ut.GetPhonesToTextByCompanyId(CompanyId).Rows
'MsgBox(row.Item("PhoneToText").ToString())
Process.Start("http://api.clickatell.com/http/sendmsg?user=xxxxxxx&password=xxxxxxxxxxxx&api_id=xxxxxxxxxxxx&to=" & row.Item("PhoneToText").ToString() & "&text=Variance of " & variance.ToString & " found at Store " & StoreId.ToString & "&mo=1&from=1xxxxxx713")
Next
Catch ex As Exception
End Try
End If
-
Mar 12th, 2015, 05:43 PM
#2
Re: Unable to use HTTP API from inside a web service
That's not how you should be invoking it. there's no reason to launch a browser... where would it display anyways? It's not like you're logged in... anyways... you should be using an HTTPWebRequest...
-tg
-
Mar 12th, 2015, 06:31 PM
#3
Thread Starter
Hyperactive Member
Re: Unable to use HTTP API from inside a web service
I have always used the process.start in the past and it didn't occur to me that it wouldn't work in a webservice. It's one of those facepalm moments.
I set it up as you recommended using an HTTP Web Request and it's working beautifully. Thank you so much for your help.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|