Still an issue with SSL

SteveBee

Member
Licensed User
Longtime User
Having got my web service client to work on a simple WS, I turned to SSL
I am now trying to connect to "https://sendem.com/ASP/Smart_Dev.asmx" - and I got the error that referred to in a tutorial.

So I installed hc.InitializeAcceptAll("hc") in HttpUtilsService, but now I get a different error:
"java.net.UnknownHostException: sendem.com"

Clearly Sendem.com DOES exist....
Grateful for any insights..

Steve
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
I've just tried the following code and it works correctly:
B4X:
Sub Process_Globals
    Dim hc As HttpClient
End Sub
Sub Globals
    
End Sub

Sub Activity_Create(FirstTime As Boolean)
    If FirstTime Then
        hc.InitializeAcceptAll("hc")
    End If
    Dim req As HttpRequest
    req.InitializeGet("https://sendem.com/ASP/Smart_Dev.asmx")
    hc.Execute(req, 1)
End Sub
Sub hc_ResponseSuccess (Response As HttpResponse, TaskId As Int)
    Log("Success: " & Response.GetString("UTF8"))
    Response.Release
End Sub

Sub hc_ResponseError (Response As HttpResponse, Reason As String, StatusCode As Int, TaskId As Int)
    Log("Error: " & Reason & " " & StatusCode)
    If Response <> Null Then
        Log(Response.GetString("UTF8"))
        Response.Release
    End If
End Sub

java.net.UnknownHostException means that it failed to resolve the host name. Usually because it failed to connect to the dns server.


B4X:
LogCat connected to: HT9CXP804731
** Activity (main) Create, isFirst = true **


109
** Activity (main) Resume **
** Activity (main) Create, isFirst = true **
389
** Activity (main) Resume **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = false **
** Activity (main) Create, isFirst = true **


** Activity (main) Resume **


Success: 





<html>



    <head><link rel="alternate" type="text/xml" href="/ASP/Smart_Dev.asmx?disco" />



    <style type="text/css">

    

        BODY { color: #000000; background-color: white; font-family: Verdana; margin-left: 0px; margin-top: 0px; }

        #content { margin-left: 30px; font-size: .70em; padding-bottom: 2em; }

        A:link { color: #336699; font-weight: bold; text-decoration: underline; }

        A:visited { color: #6699cc; font-weight: bold; text-decoration: underline; }

        A:active { color: #336699; font-weight: bold; text-decoration: underline; }

        A:hover { color: cc3300; font-weight: bold; text-decoration: underline; }

        P { color: #000000; margin-top: 0px; margin-bottom: 12px; font-family: Verdana; }

        pre { background-color: #e5e5cc; padding: 5px; font-family: Courier New; font-size: x-small; margin-top: -5px; border: 1px #f0f0e0 solid; }

        td { color: #000000; font-family: Verdana; font-size: .7em; }

        h2 { font-size: 1.5em; font-weight: bold; margin-top: 25px; margin-bottom: 10px; border-top: 1px solid #003366; margin-left: -15px; color: #003366; }



        h3 { font-size: 1.1em; color: #000000; margin-left: -15px; margin-top: 10px; margin-bottom: 10px; }

        ul { margin-top: 10px; margin-left: 20px; }

        ol { margin-top: 10px; margin-left: 20px; }

        li { margin-top: 10px; color: #000000; }

        font.value { color: darkblue; font: bold; }

        font.key { color: darkgreen; font: bold; }

        font.error { color: darkred; font: bold; }

        .heading1 { color: #ffffff; font-family: Tahoma; font-size: 26px; font-weight: normal; background-color: #003366; margin-top: 0px; margin-bottom: 0px; margin-left: -30px; padding-top: 10px; padding-bottom: 3px; padding-left: 15px; width: 105%; }

        .button { background-color: #dcdcdc; font-family: Verdana; font-size: 1em; border-top: #cccccc 1px solid; border-bottom: #666666 1px solid; border-left: #cccccc 1px solid; border-right: #666666 1px solid; }

        .frmheader { color: #000000; background: #dcdcdc; font-family: Verdana; font-size: .7em; font-weight: normal; border-bottom: 1px solid #dcdcdc; padding-top: 2px; padding-bottom: 2px; }

        .frmtext { font-family: Verdana; font-size: .7em; margin-top: 8px; margin-bottom: 0px; margin-left: 32px; }

        .frmInput { font-family: Verdana; font-size: 1em; }

        .intro { margin-left: -15px; }

           

    </style>



    <title>

    Smart_Dev Web Service

</title></head>



  <body>



    <div id="content">



      <p class="heading1">Smart_Dev</p><br>



      



      <span>



          <p class="intro">The following operations are supported.  For a formal definition, please review the <a href="Smart_Dev.asmx?WSDL">Service Description</a>. </p>

          

          

              <ul>

            

              <li>

                <a href="Smart_Dev.asmx?op=ListMonitorJobs_all">ListMonitorJobs_all</a>

                

                

              </li>

              <p>

            

              <li>

                <a href="Smart_Dev.asmx?op=ListMonitorJobs_complete">ListMonitorJobs_complete</a>

                

                

              </li>

              <p>

            

              <li>

                <a href="Smart_Dev.asmx?op=ListMonitorJobs_incomplete">ListMonitorJobs_incomplete</a>

                

                

              </li>

              <p>

            

              </ul>

            

      </span>



      

      



    <span>

        

    </span>

    

      



      



    

  </body>

</html>
 
Upvote 0

SteveBee

Member
Licensed User
Longtime User
Tx for the sample Erel... I made a new app, put your code in, linked in HTTP - and I still get the same error.

** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
Error: java.net.UnknownHostException: sendem.com -1


But I can access the Web Service from FireFox without problem.

So there's something in this whole Androidian infrastructure that isn't functioning properly... hmm - where to start looking?

S.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…