Results 1 to 3 of 3

Thread: Unable to use HTTP API from inside a web service

  1. #1

    Thread Starter
    Hyperactive Member mbutler755's Avatar
    Join Date
    May 2008
    Location
    Peoria, AZ
    Posts
    417

    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:
    1. If variance <> 0 Then
    2.             Try
    3.                 Dim ut As New SveDsTableAdapters.UserTextingTableAdapter
    4.                 For Each row As DataRow In ut.GetPhonesToTextByCompanyId(CompanyId).Rows
    5.                     'MsgBox(row.Item("PhoneToText").ToString())
    6.                     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")
    7.                 Next
    8.  
    9.             Catch ex As Exception
    10.  
    11.             End Try
    12.         End If
    Regards,

    Matt Butler, MBA, BSIT/SE, MCBP
    Owner, Intense IT, LLC
    Find us on Facebook
    Follow us on Twitter
    Link up on LinkedIn
    mb (at) i2t.us

    CODE BANK SUBMISSIONS: Converting Images to Base64 and Back Again

  2. #2
    Smooth Moperator techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,538

    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
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  3. #3

    Thread Starter
    Hyperactive Member mbutler755's Avatar
    Join Date
    May 2008
    Location
    Peoria, AZ
    Posts
    417

    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.
    Regards,

    Matt Butler, MBA, BSIT/SE, MCBP
    Owner, Intense IT, LLC
    Find us on Facebook
    Follow us on Twitter
    Link up on LinkedIn
    mb (at) i2t.us

    CODE BANK SUBMISSIONS: Converting Images to Base64 and Back Again

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width