NetTalk Central

Author Topic: NetWebClient Question  (Read 4672 times)

osquiabro

  • Hero Member
  • *****
  • Posts: 687
    • View Profile
    • Email
NetWebClient Question
« on: February 04, 2017, 04:38:13 AM »
is possible call a NetWebClient into a process?? i have this code in TakeRecord but don't execute a call:

PacketReceived = ''
PostString = xmlFile.xmldata
net.CanUseProxy = 1           ! Can use a proxy
net.HeaderOnly   = 0          ! We want the whole page     
net.AsyncOpenUse = 12         ! Use AsyncOpen 12 seconds (recommended)
net.AsyncOpenTimeOut = 1200   ! Up to 12 seconds to connect     
net.InActiveTimeout = 9000    ! Set IdleTimeout 90 seconds
net.ConnectionKeepAlive = 0     
net.ContentType = 'text/xml; charset=utf-8'                           
net.AcceptEncoding = ''
!net.ContentLength = Len(Clip(PostString))

! Set the SOAPAction header to tell the web service which method to execute
net.customheader = 'SOAPAction: "http://tempuri.org/PaymentsServices"'

! The packet is contstructed, so you can post it to the webservice
!PacketSent = PostString

net.Fetch('http://www.crimpr.net:88/WsPaymentSummary?UserName=usernama&Password=password&AcctNo='&clip(Bal:Pin)&'&BlType='&clip(Bal:BlType))

If net.Error
    Message ('Could not be post the SOAP request to this web service. Error ' & net.Error |
        & ': ' & net.InterpretError())
    SetCursor()
end

 i hava another template EasyXml and with this template run fine

osquiabro

  • Hero Member
  • *****
  • Posts: 687
    • View Profile
    • Email
Re: NetWebClient Question
« Reply #1 on: February 08, 2017, 04:46:01 AM »
Someone tried this?

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11244
    • View Profile
Re: NetWebClient Question
« Reply #2 on: February 08, 2017, 07:02:29 AM »
Hi Osa,

It's possible to use a NetWebclient in a process, but that would be difficult to do.
It's probably easier for you to make a simple procedure that contains a client and does a fetch, and call this from inside the Process procedure.

The reason it doesn't work as you have it is because you are treating the call as "Synchronous" but all networking is Asynchronous. You can't make multiple calls from inside a tight loop, rather you should make one call, get the result from that, make the next call and so on.

If you like we can go through this in the webinar on Thursday.

Cheers
Bruce



osquiabro

  • Hero Member
  • *****
  • Posts: 687
    • View Profile
    • Email
Re: NetWebClient Question
« Reply #3 on: February 08, 2017, 12:04:53 PM »
i try to call a client inside a process but when client close window the process windows also close a windows and process continuing running without a windows

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11244
    • View Profile
Re: NetWebClient Question
« Reply #4 on: February 09, 2017, 12:03:49 AM »
Hi Osa,

>> when client close window the process windows also close a windows and process continuing running without a windows

I think perhaps you are mistaking a "closed" window for a "hidden" window here.
But in any event, if you tried it, and it did not work, then you are doing something wrong.
Perhaps make a small example of what you are doing and post that here.

cheers
Bruce


osquiabro

  • Hero Member
  • *****
  • Posts: 687
    • View Profile
    • Email
Re: NetWebClient Question
« Reply #5 on: February 09, 2017, 04:48:32 AM »
ignore easy xml template when open app..