Help to access Web Service

Help to access Web Service

Postby toninhofwi » Mon Sep 28, 2009 6: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.
toninhofwi
 
Posts: 172
Joined: Tue Oct 18, 2005 10:01 am

Re: Help to access Web Service

Postby Antonio Linares » Tue Sep 29, 2009 9:03 am

Toninho,

Try using CreateObject():

CreateObject( "MSSOAP.SoapClient30" )
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42081
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Help to access Web Service

Postby toninhofwi » 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.
toninhofwi
 
Posts: 172
Joined: Tue Oct 18, 2005 10:01 am

Re: Help to access Web Service

Postby norberto » Tue Sep 29, 2009 10:42 am

Toninho, i agree... can we try to make one? (im from brazil too). i need webservices too.
norberto
 
Posts: 566
Joined: Thu Aug 30, 2007 3:40 pm
Location: BR

Re: Help to access Web Service

Postby toninhofwi » Tue Sep 29, 2009 12:51 pm

Hi Norberto.

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

Regards.
toninhofwi
 
Posts: 172
Joined: Tue Oct 18, 2005 10:01 am

Re: Help to access Web Service

Postby Colin Haig » 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)
Colin Haig
 
Posts: 310
Joined: Mon Oct 10, 2005 5:10 am

Re: Help to access Web Service

Postby James Bott » Tue Sep 29, 2009 2:49 pm

User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: Help to access Web Service

Postby toninhofwi » Tue Sep 29, 2009 4: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.
toninhofwi
 
Posts: 172
Joined: Tue Oct 18, 2005 10:01 am

Re: Help to access Web Service

Postby toninhofwi » Tue Sep 29, 2009 4:31 pm

Hi Colin,

I'm trying your sample, thanks a lot.

Toninho.
toninhofwi
 
Posts: 172
Joined: Tue Oct 18, 2005 10:01 am

Re: Help to access Web Service

Postby toninhofwi » Tue Sep 29, 2009 4: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.
toninhofwi
 
Posts: 172
Joined: Tue Oct 18, 2005 10:01 am

Re: Help to access Web Service

Postby Antonio Linares » Tue Sep 29, 2009 5:40 pm

regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42081
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Help to access Web Service

Postby toninhofwi » Tue Sep 29, 2009 7:46 pm

Thanks Antonio,

I'll review it.

Regards,

Toninho.
toninhofwi
 
Posts: 172
Joined: Tue Oct 18, 2005 10:01 am


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 31 guests