NetTalk Central

Author Topic: SOAP client, process won't stop running  (Read 12684 times)

dmercer

  • Newbie
  • *
  • Posts: 2
    • View Profile
    • Email
SOAP client, process won't stop running
« on: March 28, 2011, 11:20:21 AM »
Hi, I'm new here and didn't find a topic that would help me figure out my problem.
After a customizatino and a simple test with the example SOAP\ConvertClientBasic app I made a copy to use it as part of my app and added code to create the XML. The problem is that the app can make the connection correctly and receives the response just fine but seems like it keeps wating for the connection to be closed, even if I close the app the process is still running until I kill the process from the task manager. Could be an infinit loop? I keep getting a timeout message even after receiving the response from the server, over and over again while the app is open. I attached a nettalk log and hope someone can help figure it out, it shows that even after closing the app it keeps writing to the log until I kill the process. Could this be related to how the connection is setup? This didn't happen with the simple test and I'm using the same code for the conection. This is the code:

        cSoap.SetAllHeadersDefault()
        cSoap.ConnectionKeepAlive = 0
        cSoap.CanUseProxy = 0           ! Can use a proxy
        cSoap.HeaderOnly = 0            ! We want the whole page
     
        cSoap.AsyncOpenUse = 1          ! Use AsyncOpen 12 seconds (recommended)
        cSoap.AsyncOpenTimeOut = 1200   ! Up to 12 seconds to connect

        cSoap.InActiveTimeout = 9000    ! Set IdleTimeout
       
        cSoap.Pragma_ = 'No-Cache'     ! Force any proxies to not use their cache. Uses more bandwidth but will contact the webserver directly which is what we want.
        cSoap.CacheControl = 'No-Cache'! Force any proxies to not use their cache. Uses more bandwidth but will contact the webserver directly which is what we want.


!        These settings would be required if you were talkig to a SOAP server that only did SSL.
        cSoap.SSLCertificateOptions.CertificateFile = ''
        cSoap.SSLCertificateOptions.PrivateKeyFile = ''
        cSoap.SSLCertificateOptions.DontVerifyRemoteCertificateCommonName = 1
        cSoap.SSLCertificateOptions.DontVerifyRemoteCertificateWithCARoot = 1
        cSoap.SSLCertificateOptions.CARootFile = '' !If https use a root cluster like '.\CA_Roots.pem'
     
        cSoap.ContentType = 'text/xml; charset=windows-1252'
        cSoap.AcceptEncoding = ''
        cSoap.ContentLength = Len(Clip(PostString))

        ! Set the SOAPAction header to tell the web service which method to execute
        cSoap.customheader = 'SOAPAction: "https://www.fel.mx/ConexionRemotaCFDI/generarCFDIPrueba"'

        SetCursor(Cursor:Wait)

        ! The packet is contstructed, so you can post it to the webservice
        PacketSent = PostString
        SETCLIPBOARD(clip(PostString))
        cSoap.Post('https://www.fel.mx/ConexionRemotaCFDI/ConexionRemota.asmx', Clip(PostString))
        If cSoap.Error
           Message ('Could not be post the SOAP request to this web service. Error ' & cSoap.Error |
                    & ': ' & cSoap.InterpretError())
           SetCursor()
        end

!! end of code

Thank you

[attachment deleted by admin]

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: SOAP client, process won't stop running
« Reply #1 on: March 28, 2011, 09:33:01 PM »
Hi David,

Let me see if I understand...

So you have this client program.
And it does a Post.
And you get a reply from the Post in .PageReceived, or you get an Error in ErrorTrap.
In both cases you do what you need to do, then post an Event:CloseWindow.
You then close the app.

but if you look in TaskManager the app is still running?

Most likely cause of this is that you've is-set a setting on the global extension;
Global
Extensions
Activate CapeSoft's NetTalk
Advanced Tab
"Don't close callback window when DLL unloads"

If this is a multi-DLL system I also recommend adding the NetTalk global extension to the Exe.

Cheers
Bruce


dmercer

  • Newbie
  • *
  • Posts: 2
    • View Profile
    • Email
Re: SOAP client, process won't stop running
« Reply #2 on: March 29, 2011, 01:53:06 PM »
Hi Bruce,

I do get the correct reply form the server in PageReceived and the app was still running (the process was in the task manager) after closing the window and the app.
The option "Don't close callback window when DLL unloads" was unchecked.

This is a multi-DLL system, added the NetTalk global extension to the exe and the problem was gone.
Thank you Bruce, very helpful.

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: SOAP client, process won't stop running
« Reply #3 on: March 29, 2011, 08:40:59 PM »
Is the app made with the Legacy or ABC template?

cheers
Bruce