B4J Question No-ip and B4j

Discussion in 'B4J Questions' started by micro, Aug 16, 2015.

  1. micro

    micro Well-Known Member Licensed User

    Hi to all,
    I used dynamicip.bas for android with same modify for B4j.
    I set up a free account on noip.com and my host is xxxxxx.ddns.net.
    Now when i launch program, the ceck currently ip is correct but when run Sub "SendNoIpUpdateRequest" Job.Success return false.
    This is code in Main:
    Code:
    Private dinip As Dynamicip
    ...................
    Sub Inizializza
        
    Dim ni As NoIpValues
        ni.Initialize
        ni.Host = 
    "http://xxxxxx.ddns.net"
        ni.Username = 
    "yyyyyyyyyy"
        ni.Password = 
    "zzzzzzzzzzzz"
        dinip.Initialize(ni)
    End Sub
    and attached bas module.
     

    Attached Files:

  2. Erel

    Erel Administrator Staff Member Licensed User

    Check the logs. There should be more information.
     
  3. micro

    micro Well-Known Member Licensed User

    Log:
    Program started.
    badauth
    Error: (no-ip) Unauthorized

    The Host is active on no-ip site.
    Is correct the request in Sub "SendNoIpUpdateRequest"?
    (Why current ip is not sent to no-ip site?)

    Code:
    Sub SendNoIpUpdateRequest
        
    Dim j As HttpJob
        j.Initialize(
    "no-ip", Me)
        j.Download2(
    "http://dynupdate.no-ip.com/nic/update"Array As String("hostname", ni.Host))
        
    Dim su As StringUtils
        
    Dim usernameAndPassword As String = ni.Username & ":" & ni.Password
        j.GetRequest.SetHeader(
    "Authorization""Basic " & su.EncodeBase64(usernameAndPassword.GetBytes("UTF8")))
        j.GetRequest.SetHeader(
    "User-Agent""Test B4j " & ni.Username)
    End Sub
     
    Last edited: Aug 16, 2015
  4. Erel

    Erel Administrator Staff Member Licensed User

    Can you post the link to their API documentation?
     
  5. micro

    micro Well-Known Member Licensed User

    https://www.noip.com/integrate/request

    Thanks for your interest.

    P.S.
    I used their example update request but not work.
     
  6. Erel

    Erel Administrator Staff Member Licensed User

    The user agent doesn't look correct.
     
  7. micro

    micro Well-Known Member Licensed User

    But into module bas?
    This?
    ni.Username
    I include the mail and not username?
     
    Last edited: Aug 18, 2015
  8. micro

    micro Well-Known Member Licensed User

    strangely password is wrong, now reset and correct.
    Now Job.Success return true but Job.GetString is always empty.
    I added myipbublic in J.Dounload2 but it is always the same result.
    Code:
    Dim j As HttpJob
        j.Initialize(
    "no-ip", Me)
        j.Download2(
    "https://dynupdate.no-ip.com/nic/update"Array As String("hostname", ni.Host, "myip", myPublicIp))
    Thanks for your help.
     
  9. Erel

    Erel Administrator Staff Member Licensed User

    Maybe the server doesn't return any response except of the status code.
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice