Quantcast
Channel: Chilkat Forum - latest questions
Viewing all 1061 articles
Browse latest View live

OAuth2 Sample for Desktop Applications


xcode 8 error while linking chilkat

$
0
0

Hello, I installed Xcode 8 and got the newest Chilkat lib for iOS and objective-c v9.5.0.59. I created two static libs for simulator and iOS device. The linker always shows this message: Undefined symbols for architecture i386: "CkTaskU::inject(void)", referenced from: PevCallbackRouter::pevTaskCompleted(ClsTask) in libchilkatSimIos.a(PevCallbackRouter.o) "CkTaskU::CkTaskU()", referenced from: PevCallbackRouter::pevTaskCompleted(ClsTask) in libchilkatSimIos.a(PevCallbackRouter.o) "CkTaskU::~CkTaskU()", referenced from: PevCallbackRouter::pevTaskCompleted(ClsTask) in libchilkatSimIos.a(PevCallbackRouter.o) I only use the crypt module. Any ideas? Sina

FTP2 Progress Callbacks

$
0
0

Hi,

I got up and running with the FTP2 framework in minutes really happy customer here, but getting progress callbacks to work has me stumped! I have read the post below and tried subclassing CkoFtp2Progress added the required header files to my project but I just get a bunch of missing object errors. Any chance on a better example that also includes what headers I need in my project.

Just to confirm are the call backs in real time so I can hook up a loading bar to reflect the current state of an upload?

https://www.example-code.com/objc/ftp_download_with_progress.asp

Thanks,

Norm

ClearTo Not Working

$
0
0

Hello, I'm using the 64bit ActiveX control (version 9.5.0.59) to send emails to an Office365 SMTP server from SQL Server 2012. It all works well except that the To address is not cleared out after each Send(). I'm creating a single instance of the MailMan and Email objects and just re-populating the From, To, Subject and Message, see the sample code below.

    DECLARE @lQuit bit
SET @lQuit = 0

DECLARE @hr int
DECLARE @sErrorMsg nvarchar(4000)

--  The mailman object is used for sending and receiving email.
DECLARE @mailman int
EXEC @hr = sp_OACreate 'Chilkat_9_5_0.MailMan', @mailman OUT
IF @hr<> 0
BEGIN
   RAISERROR('Unable To create mail control.',16,1)
   RETURN
END

-- unlock the control
DECLARE @success int
EXEC sp_OAMethod @mailman, 'UnlockComponent', @success OUT, 'xxxxxxxxx'
IF STR(@success) <> 1
  BEGIN
    EXEC sp_OAGetProperty @mailman, 'LastErrorText', @sErrorMsg OUT
    RAISERROR(@sErrorMsg,16,2)
    EXEC @hr = sp_OADestroy @mailman
    RETURN
  END

-- set SMTP settings
EXEC sp_OASetProperty @mailman, 'SmtpHost', 'smtp.office365.com'
EXEC sp_OASetProperty @mailman, 'SmtpPort', 587
EXEC sp_OASetProperty @mailman, 'StartTLS', 1

--  Set the SMTP login/password
EXEC sp_OASetProperty @mailman, 'SmtpUsername', 'user_name'
EXEC sp_OASetProperty @mailman, 'SmtpPassword', 'password'

--  Create an email object
DECLARE @email int
EXEC @hr = sp_OACreate 'Chilkat_9_5_0.Email', @email OUT
IF @hr<> 0
BEGIN
    RAISERROR('Unable To create the email object.',16,3)
    EXEC @hr = sp_OADestroy @mailman
    RETURN
END

-- send the first email
EXEC sp_OAMethod @email, 'ClearTo', @success OUT
EXEC sp_OAMethod @email, 'RemoveHtmlAlternative', @success OUT
EXEC sp_OAMethod @email, 'RemovePlainTextAlternative', @success OUT

-- code to send out the email
EXEC sp_OASetProperty @email, 'Subject', 'This is the first email'
EXEC sp_OAMethod @email, 'SetHtmlBody', NULL, '<html><body>1. this is the HTML body</body></html>'
EXEC sp_OAMethod @email, 'AddPlainTextAlternativeBody', @success OUT, 'this is the plain text version of the body'
EXEC sp_OASetProperty @email, 'From', 'from_email'
EXEC sp_OAMethod @email, 'AddTo', @success OUT, 'support', 'email_address1'

EXEC sp_OAMethod @mailman, 'SendEmail', @success OUT, @email

-- send the second email
EXEC sp_OAMethod @email, 'ClearTo', @success OUT
EXEC sp_OAMethod @email, 'RemoveHtmlAlternative', @success OUT
EXEC sp_OAMethod @email, 'RemovePlainTextAlternative', @success OUT

-- code to send out the email
EXEC sp_OASetProperty @email, 'Subject', 'This is the second email'
EXEC sp_OAMethod @email, 'SetHtmlBody', NULL, '<html><body>2. this is the HTML body</body></html>'
EXEC sp_OAMethod @email, 'AddPlainTextAlternativeBody', @success OUT, 'this is the plain text version of the body'
EXEC sp_OASetProperty @email, 'From', 'from_email'
EXEC sp_OAMethod @email, 'AddTo', @success OUT, 'support', 'email_address2'

EXEC sp_OAMethod @mailman, 'SendEmail', @success OUT, @email

-- send the third email
EXEC sp_OAMethod @email, 'ClearTo', @success OUT
EXEC sp_OAMethod @email, 'RemoveHtmlAlternative', @success OUT
EXEC sp_OAMethod @email, 'RemovePlainTextAlternative', @success OUT

-- code to send out the email
EXEC sp_OASetProperty @email, 'Subject', 'This is the third email'
EXEC sp_OAMethod @email, 'SetHtmlBody', NULL, '<html><body>3. this is the HTML body</body></html>'
EXEC sp_OAMethod @email, 'AddPlainTextAlternativeBody', @success OUT, 'this is the plain text version of the body'
EXEC sp_OASetProperty @email, 'From', 'from_email'
EXEC sp_OAMethod @email, 'AddTo', @success OUT, 'support', 'email_address3'

EXEC sp_OAMethod @mailman, 'SendEmail', @success OUT, @email

IF STR(@success) <> 1
  BEGIN
    -- got an error
    EXEC sp_OAGetProperty @mailman, 'LastErrorText', @sErrorMsg OUT
    SET @sErrorMsg = 'Unable to send the email';
    RAISERROR(@sErrorMsg,16,4)
    SET @lQuit = 1
  END
EXEC @hr = sp_OADestroy @mailman
EXEC @hr = sp_OADestroy @email

When i execute the code from SSMS, it sends out 3 emails, however i see from Outlook that the first email has one To address, the second email has two To addresses, and the third email has all three To addresses. So it appears that the ClearTo() is not working. No errors are returned by the LastErrorText() method when placed right after the ClearTo() method.

Thanks for developing a great product! it generally works flawlessly!!

NuGet package chilkat-x64 version 9.5.0.59 not updated for the 4.6 Framework

$
0
0

Hi Matt,

The NuGet package for chilkat-x64 version 9.5.0.59 contains an incorrect version (9.5.0.58) of the class library for the 4.6 Framework (and 4.6.1).

It might simply be incorrect file information, since I haven't tried to query the version from any of the internal methods. However the same NuGet package contains the correct version 9.5.0.59 for the other versions of .NET Framework. Hence my guess is that the class library for 4.6 was not updated.

java: android: crash: when using Proguard / minifyEnabled

$
0
0

Hi,

tried to get Proguard working in my AndroidStudio build but unfortunately I was not able to get rid of this application crash as soon I activate Proguard obfuscation:

--------- beginning of crash 03-10 22:26:21.511 31553 31553 E AndroidRuntime: FATAL EXCEPTION: main 03-10 22:26:21.511 31553 31553 E AndroidRuntime: Process: de.tools.application, PID: 31553 03-10 22:26:21.511 31553 31553 E AndroidRuntime: java.lang.NoSuchMethodError: no static method "Lcom/chilkatsoft/chilkatJNI;.SwigDirector_CkBaseProgress_AbortCheck(Lcom/chilkatsoft/CkBaseProgress;)Z" 03-10 22:26:21.511 31553 31553 E AndroidRuntime: at com.chilkatsoft.chilkatJNI.swig_module_init(Native Method) 03-10 22:26:21.511 31553 31553 E AndroidRuntime: at com.chilkatsoft.chilkatJNI.<clinit>(Unknown Source) 03-10 22:26:21.511 31553 31553 E AndroidRuntime: at com.chilkatsoft.d.<init>(Unknown Source) 03-10 22:26:21.511 31553 31553 E AndroidRuntime: at de.tools.application.d.b.<init>(Unknown Source) 03-10 22:26:21.511 31553 31553 E AndroidRuntime: at de.tools.application.d.b.a(Unknown Source)

I tried several things out to get rid of this crash. But unfortunately without success. Perhaps you have ideas on that.

Many thanks and Br, Heiko

Chilkat REST API Sample Code for UK Vehicle Data VRM Lookup

$
0
0

HTTP Download of large file with POST-Request

$
0
0

Hi,

I cannot find a way to send a HTTP POST-Request and saves the response in streaming mode to a file. For GET-Requests I use the "Download" function, but I need the same with a POST-Request.
The files that should be downloaded are not in the public space of the webserver. There is a script to deliver the file and this needs the parameters as a POST-Request. The files can be 500 MB and more, and so I cannot load it to the memory before saving it to disk.
Is there a way to do it?

Thanks


TLS1.2 with .NET 4

$
0
0

Hello!

I want to post to WSDL service that uses TLS1.2 from a windows XP machine. Since I can only have .NET 4, is there a way (and an example will be great) that i can do that with your component?

Thanks!

Perl 5.24 support?

$
0
0

When will Perl Core 5.24 support be out? 5.24 was released nearly 5 months ago. I'm trying to set up a new server with the latest Strawberry perl and can't install the package via ppm because it only is valid up through Perl 5.22.

What is the encoding of the paths in CkZip and CkFileAccess?

$
0
0

Whenever I use CkZip and CkFileAccess I wonder what is the enconding of the const char * behind methods like:

bool OpenForRead(const char *filePath);
bool OpenZip(const char *ZipFileName);

I want to make sure that on Windows that translates into a Unicode path, but I am not sure how Chilkat handles these.

What is the expected encoding of the input and does Chilkat convert to Unicode/UTF-16 underlying on Windows? Does it use the W (CreateFileW) versions of the APIs when opening files on Windows?

Call to undefined function new_CkCrypt2()

$
0
0

I have installed PHP 7.0.8 on Ubuntu 16.04LTS.

I copied chilkat_9_5_0.so file to /usr/lib/php/20151012/

i added extension=chilkat_9_5_0.so To php.ini file.

I am getting the following error.

PHP warning dl() dynamically loaded extensions aren't enabled

PHP Fatal error: untaught error: call to undefined function new_CkCrypt2() in chilkat_9_5_0.php

web request fails after setting preferIpv6 to true

$
0
0

Hi

I am using chilkat v9.5.0.51 Mono on Mac, Xamarin iOS & Android. After setting preferIpv6 to true on my Http object, some servers fail to be requested, for instance:

http://nominatim.openstreetmap.org/search?q=sabah&format=xml&limit=20

https://maps.googleapis.com/maps/api/staticmap?center=34.2065687282483,-117.859450371377&zoom=16&size=638x667&sensor=true&format=png&maptype=hybrid

If preferIpv6 is false, these requests work fine. Is it a server issue? Can I fix it on the client side?

Thanks Guillaume

Certificate A3 / PKCS7

$
0
0

I would like to see an example of Delphi code accessing the store windows and selecting the A3 certificate that is in the smartcard / token and entering the pin A3 certificate to later sign a file in any format pkcs7. I have seen examples of delphi code but none gives the opportunity to select the A3 certificate.

FTP2: How to turn off TLS after authenticating?

$
0
0

I would like to use TLS to login, but then turn it off after that for both the control channel and the data channel. I tried this:

ftp.Hostname = hostName;
ftp.Username = userName;
ftp.Password = password;
ftp.AuthTls = true;

ftpResult = ftp.Connect();
LogFtpResponse(ftpResult);

ftp.ClearControlChannel();
ftp.DataProtection = "clear";

The first command after that was to GetCurrentRemoteDir, and it failed:

ChilkatLog:
  GetCurrentRemoteDir:
    DllDate: Sep 25 2016
    ChilkatVersion: 9.5.0.60
    UnlockPrefix: <removed>
    Architecture: Little Endian; 32-bit
    Language: .NET 4.6
    VerboseLogging: 0
    pwd:
      simpleCommand:
        sendCommand:
          prepControlChannel:
            unexpectedResponse: [=15=03=01=00 =0B=FCQ}=16=92=AA=A1=94=9B=A2=94=BBeT=9B]n}u=B7=1B*=F7Nz=AB=9C=C2*=FF6]
          --prepControlChannel
          sendingCommand: PWD
        --sendCommand
        readCommandResponse:
          Failed to read FTP control channel reply.
          readFtpReply: Socket operation timeout.
          receivedStrQP: [=15WD=00 =8CC=CD=E7   =F7bs=8F=1E=F0=0D4=DCX=A2=18=99;=C5E=05=B9a=DC=B97.E=11=B1@]
        --readCommandResponse
      --simpleCommand
    --pwd
    Failed.
  --GetCurrentRemoteDir
--ChilkatLog

It looks like there is a mismatch between what the client expects in terms of encrypted versus non-encrypted text.

So...

What is the recommended way to achieve TLS for the authentication only, then no encryption for all further traffic on both the control and data channels? Is it possible?


server keeps returning 404 not found

$
0
0

Chilkat Mono 9.5.0.59 on Mac and Windows, I am sending a post request to this address: http://wms.qgiscloud.com/guillaume_av/tetst1?

POST param:

<wfs:Transaction version="1.0.0" service="WFS" xmlns:ows="http://www.opengis.net/ows" xmlns:wfs="http://www.opengis.net/wfs" xmlns:ogc="http://www.opengis.net/ogc" xmlns:gml="http://www.opengis.net/gml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >
  <wfs:Update typeName="line">
    <wfs:Property>
      <wfs:Name>geometry</wfs:Name>
      <wfs:Value>
        <gml:MultiLineString srsName="EPSG:4326">
          <gml:lineStringMember>
            <gml:LineString srsName="EPSG:4326">
              <gml:coordinates decimal="." cs="," ts="">
174.843693560235,-36.8547055765507 174.861438815943,-36.8489412142292
</gml:coordinates>
            </gml:LineString>
          </gml:lineStringMember>
        </gml:MultiLineString>
      </wfs:Value>
    </wfs:Property>
    <ogc:Filter>
      <ogc:FeatureId gml:id="line.46" />
    </ogc:Filter>
  </wfs:Update>
</wfs:Transaction>

My code:

Http httP = new Http();
http.PreferIpv6 = true;
if(credentials != null)
{
http.Login = credentials.UserName;
http.Password = credentials.Password;
http.BasicAuth = true;
}
http.UseBgThread = true;
http.PBinary("POST", Url, Encoding.UTF8.GetBytes(parameters), "application/xml", false, false);

It succeeds in my browser but returns the following eror with chilkat:

ChilkatLog:
  PBinary:
    DllDate: Sep 18 2016
    ChilkatVersion: 9.5.0.59
    UnlockPrefix: *******
    Architecture: Little Endian; 64-bit
    Language: MAC OS X C/C++
    VerboseLogging: 1
    binaryRequest:
      fullRequest:
        a_synchronousRequest:
          generateRequestHeader:
            httpRequestGenStartLine:
              genStartLine:
                startLine: POST /guillaume_av/tetst1 HTTP/1.1
              --genStartLine
            --httpRequestGenStartLine
            addCookies:
              Not auto-adding cookies.
              sendCookies: 1
              cookieDir: 
            --addCookies
            Adding Basic Authentication Header
            login: guillaume
          --generateRequestHeader
          fullHttpRequest:
            domain: wms.qgiscloud.com
            port: 80
            ssl: 0
            openHttpConnection:
              Opening connection directly to HTTP server.
              httpHostname: wms.qgiscloud.com
              httpPort: 80
              ssl: 0
              HTTP connection succeeded.
            --openHttpConnection
            connectTime: Elapsed time: 393 millisec
            sendRequestHeader:
              sendHeaderElapsedMs: 1
            --sendRequestHeader
            sendRequestBody:
              sendBodyElapsedMs: 0
            --sendRequestBody
            statusCode: 404
            statusText: Not Found
            checkUngzipResponse:
              decompressing GZIP response...
            --checkUngzipResponse
          --fullHttpRequest
          success: 1
        --a_synchronousRequest
        success: 1
      --fullRequest
      responseStatus: 404
      Failed.
    --binaryRequest
    Failed.
  --PBinary
  urlObject_loadUrl:
  --urlObject_loadUrl
--ChilkatLog

Any help appreciated Guillaume

.NET HTTP post content not sent

$
0
0

Hello , I`m having a problem , I have this PHP code :

 if (!isset($_POST["license"])) {
    die("no license"); // it will allways halt here
} else {
    $heads["license"] = $_POST["license"];
}

And the following .NET code :

Dim http As New Chilkat.Http
'removed unlock
Dim req2 As New Chilkat.HttpRequest
req2.Path = "/api/v1/?get=lib&format=json"
req2.AddHeader("swid", "1")
req2.AddHeader("swver", "1.2")
req2.AddHeader("ukey", "49918b558f5367c313d5d500fb24f6447b33dc5873b6d34c7d5844cb74d63896")
req2.AddParam("license", "license here") ' error here ?
req2.HttpVerb = "POST"

Dim resp As New Chilkat.HttpResponse
resp = http.SynchronousRequest("localhost", 80, False, req2)
If (resp Is Nothing) Then
    Console.WriteLine(http.LastErrorText)
    Exit Sub
Else
    Console.WriteLine(resp.BodyStr)
End If
Console.ReadLine()

What am I doing wrong ? I receive all the headers but not the POST content. Thanks in advance !

Processor Architecture Mismatch?

$
0
0

VS 2015 was issuing a warning when I compiled my project:

There was a mismatch between the processor architecture of the project being built "MSIL" and the processor architecture of the reference "ChilkatDotNet46, Version=9.5.0.52, Culture=neutral, PublicKeyToken=eb5fc1fc52ef09bd, processorArchitecture=x86", "x86". This mismatch may cause runtime failures. Please consider changing the targeted processor architecture of your project through the Configuration Manager so as to align the processor architectures between your project and references, or take a dependency on references with a processor architecture that matches the targeted processor architecture of your project.

My solution includes three projects, (1) the main EXE, (2) a DLL, and (3) a test unit.

(1), the EXE, had "Platform target" set to "Any CPU" with "Prefer 32-bit" checked.

(2) and (3) were set to "Any CPU", but "Prefer 32-bit" was unchecked because it was disabled.

The EXE has a reference to "...chilkat-win32.9.5.0.60libnet461ChilkatDotNet46.dll", the 32-bit version of the library.

To avoid the warning, I changed Platform target to "x86" in all three projects. However, I'd rather use "Any CPU" with "Prefer 32-bit" checked to get the expanded address space that VS 2015 enables when "Prefer 32-bit" is checked. To use that, would we need a DLL for Chilkat that had /LARGEADDRESSAWARE?

Rest - website w/o content-length or chunked

$
0
0

Bonjour,

I've been playing around with the REST module for a couple of days, to make a script that can automatically download from dl.free.fr With other websites, the tests all work excellent! but with this particular website I have a problem: the header does not return a content type, and also does not return a chunked response!

The response header is quite empty to be honest: Date: Tue, 10 Oct 2016 14:59:10 GMT Server: Apache/DL [Apr 9 2012 10:05:09] Cache-Control: no-cache Expires: Fri, 29 Oct 1998 10:10:45 GMT Connection: close Content-Type: text/html

Which results in an error in the rest module: (understandable)

readResponseBody: No Content-Length header AND not a chunked response. Assuming no response body.

However, in firefox there is content! meaning the assumption in this case is wrong. Also, some reading learned me that the server is not required to send content-length or chunked data. (even though it would make live easier if it did...)

Is is possible to obtain the HTML of this page, so I can perform the download? I have not yet found a method using the Chilkat manual for REST.

Cordialement, Marcel

Follow Chilkat on Twitter

Viewing all 1061 articles
Browse latest View live