FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Help to access Web Service
Posts: 182
Joined: Tue Oct 18, 2005 10:01 AM
Help to access Web Service
Posted: Mon Sep 28, 2009 06:57 PM

Hi friends,

I'm trying to access Web Services using fivewin, but I receive an error in OLE creation:

---cut---
local oSoapClient, cBuf
oSoapClient := Win_OleCreateObject( "MSSOAP.SoapClient30" )
oSoapClient:msSoapInit( "https://www.nfp.sp.gov.br/ws" )
---cut---

The manual for WS that I need access is this: http://www.nfp.fazenda.sp.gov.br/pdf/webservice.pdf

Any hint please ?

Thanks and best regards,

Toninho.

Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: Help to access Web Service
Posted: Tue Sep 29, 2009 09:03 AM

Toninho,

Try using CreateObject():

CreateObject( "MSSOAP.SoapClient30" )

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 182
Joined: Tue Oct 18, 2005 10:01 AM
Re: Help to access Web Service
Posted: Tue Sep 29, 2009 10:11 AM

Hi Antonio.

Same error, in mssoapinit. IMHO is time to FWH goes to web. FWH is a powerfull product but we live in a time that web is required for a lot of transactions. Web Services in more and more used and soap was replaced by net framework. Is my dream a day that FWH have a TWeb class... :wink:

Thank you and best regards,

Toninho.

Posts: 566
Joined: Thu Aug 30, 2007 03:40 PM
Re: Help to access Web Service
Posted: Tue Sep 29, 2009 10:42 AM

Toninho, i agree... can we try to make one? (im from brazil too). i need webservices too.

Posts: 182
Joined: Tue Oct 18, 2005 10:01 AM
Re: Help to access Web Service
Posted: Tue Sep 29, 2009 12:51 PM

Hi Norberto.

Of course yes, please add me in msn: toninho@fwi.com.br

Regards.

Posts: 310
Joined: Mon Oct 10, 2005 05:10 AM
Re: Help to access Web Service
Posted: Tue Sep 29, 2009 12:58 PM

static function Convert(oPo)
Local oSoap := Mcs_OleObj("MSSOAP.SoapClient30")
Local nRate := nil,nAmount := 0,cTo := 'AUD',cCurr := '',nCurrRate := 0,lCont := TRUE
nCurrRate := oPo:rate()
if nCurrRate <> 0
if ! MsgNoYes('Changing Rate - Are You Sure ?')
lCont := FALSE
endif
endif
if lCont
nAmount := oPo:us
cCurr := oPo:curr
CursorWait()
oSoap:MsSoapInit("http://www.webservicex.net/CurrencyConvertor.asmx?WSDL")
oSoap:ClientProperty("ServerHTTPRequest")
nRate := oSoap:ConversionRate(substr(cCurr,1,3),substr(cTo,1,3))
oSoap := nil
nAmount := nAmount * nRate
oPo:aud := nAmount
oPo:rate := nRate
oPo:save()
SndPlaySound("Ding",1)
CursorArrow()
endif
Return nil
//--------------------------------------------------------------------------------------------------------//
Please note the code relating to SOAP came from Byron - form Matrix Software ( from memory)

Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: Help to access Web Service
Posted: Tue Sep 29, 2009 02:49 PM
FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 182
Joined: Tue Oct 18, 2005 10:01 AM
Re: Help to access Web Service
Posted: Tue Sep 29, 2009 04:30 PM

Hi James,

Thanks for your hint. I'm playing with WinInet for some days, but instead InternetReadFile(), I think that I need InternetWriteFile(), but it is not so easy to use, please see at msdn and another problem, I need use SOAP protocol, or ws will reject my request...

Regards,

Toninho.

Posts: 182
Joined: Tue Oct 18, 2005 10:01 AM
Re: Help to access Web Service
Posted: Tue Sep 29, 2009 04:31 PM

Hi Colin,

I'm trying your sample, thanks a lot.

Toninho.

Posts: 182
Joined: Tue Oct 18, 2005 10:01 AM
Re: Help to access Web Service
Posted: Tue Sep 29, 2009 04:51 PM

I think that I found the problem, I need access a HTTPS...

oSoapClient:msSoapInit( "https://www.nfp.fazenda.sp.gov.br/ws/arquivonf_mod1.asmx?WSDL" )

Anybody know if MSSOAP access HTTPS ???

Thanks and best regards,

Toninho.

Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: Help to access Web Service
Posted: Tue Sep 29, 2009 05:40 PM
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 182
Joined: Tue Oct 18, 2005 10:01 AM
Re: Help to access Web Service
Posted: Tue Sep 29, 2009 07:46 PM

Thanks Antonio,

I'll review it.

Regards,

Toninho.

Continue the discussion