Communication via HTTP with SOAP
Moderator: Rathinagiri
Communication via HTTP with SOAP
Hi guys!
I need to retrieve some data via SOAP protocol from my hmg app.
Has anyone any sample how to start with this?
I need to retrieve some data via SOAP protocol from my hmg app.
Has anyone any sample how to start with this?
Re: Communication via HTTP with SOAP
I'm trying to build small sample, but I get linker error:
I've added libhburl.a to compilation.
Anyone has an idea which library should I append to project?
Code: Select all
Harbour 3.2.0dev (r1601151502)
Copyright (c) 1999-2015, http://harbour-project.org/
d:/hmg343/harbour/lib/win/mingw/libhbcurl.a(core.o):core.c:(.text+0x667): undefined reference to `_imp__curl_easy_setopt'
d:/hmg343/harbour/lib/win/mingw/libhbcurl.a(core.o):core.c:(.text+0x7a0): undefined reference to `_imp__curl_formfree'
d:/hmg343/harbour/lib/win/mingw/libhbcurl.a(core.o):core.c:(.text+0x7be): undefined reference to `_imp__curl_slist_free_all'
Anyone has an idea which library should I append to project?
Re: Communication via HTTP with SOAP
Hi Marek,
Please, take a look at the link below.
viewtopic.php?f=5&t=4617&start=10#p45742
DanielMaximilano wrote that how can compile with CURL.
Please, take a look at the link below.
viewtopic.php?f=5&t=4617&start=10#p45742
DanielMaximilano wrote that how can compile with CURL.
Best regards,
Gabor
Gabor
Re: Communication via HTTP with SOAP
Thanks for pinting me this topic, I've missed it.
@danielmaximiliano: why we need to compile libhbcurl.a - it is present in harbour\lib folder?
@danielmaximiliano: why we need to compile libhbcurl.a - it is present in harbour\lib folder?
- Pablo César
- Posts: 4059
- Joined: Wed Sep 08, 2010 1:18 pm
- Location: Curitiba - Brasil
Communication via HTTP with SOAP
The libhbcurl.a is at \hmg.3.4.3\HARBOUR\lib\win\mingw
I think you should put in "Configuration" TAB of IDE like this:
Libs = hbcurl (always removing first "lib" from the complete name of file)
I think you should put in "Configuration" TAB of IDE like this:
Libs = hbcurl (always removing first "lib" from the complete name of file)
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
Re: Communication via HTTP with SOAP
I put it in configuration, but, errors from linker point the problem within this lib:
Code: Select all
d:/hmg343/harbour/lib/win/mingw/libhbcurl.a(core.o):core.c:(.text+0x667): undefined reference to `_imp__curl_easy_setopt'
Re: Communication via HTTP with SOAP
try this
libs=hbcurls
libs=hbcurl
libs=libcurl
libs=hbcurls
libs=hbcurl
libs=libcurl
Best regards,
Gabor
Gabor
- Pablo César
- Posts: 4059
- Joined: Wed Sep 08, 2010 1:18 pm
- Location: Curitiba - Brasil
Communication via HTTP with SOAP
Probably is because is not found the lib...
Try with putting extra:
libpaths=\hmg.3.4.3\HARBOUR\lib\win\mingw
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
Re: Communication via HTTP with SOAP
Have sb. idea about SOAP communication?
1. Establish session - login to webservice
2. Send request
3. Retrieve data
4. Close communication
Maybe a little sample?
1. Establish session - login to webservice
2. Send request
3. Retrieve data
4. Close communication
Maybe a little sample?
Re: Communication via HTTP with SOAP
Here is little help from Harbour forum.
https://groups.google.com/forum/#!searc ... relevance.
I found an example. (soap-example.zip)
I'm use CURL to POST REQUEST HTTP communication, but I dont' use SOAP. So, i'm not an expert.
I wrote modeled on the example program. I hope it works.
https://groups.google.com/forum/#!searc ... relevance.
I found an example. (soap-example.zip)
I'm use CURL to POST REQUEST HTTP communication, but I dont' use SOAP. So, i'm not an expert.
I wrote modeled on the example program. I hope it works.
Code: Select all
function soapLogin(_UserName,_UserPassword,_OwnerVatNumber)
local cxml,canswer
cxml := '<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:sds2GInterface-IsdsGateway">'+chr(13)+chr(10)
cxml += ' <soapenv:Header/>'+chr(13)+chr(10)
cxml += ' <soapenv:Body>'+chr(13)+chr(10)
cxml += ' <urn:Login soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">'+chr(13)+chr(10)
cxml += ' <UserName xsi:type="xsd:string" xs:type="type:string" xmlns:xs="http://www.w3.org/2000/XMLSchema-instance">'+_UserName+'</UserName>'+chr(13)+chr(10)
cxml += ' <UserPassword xsi:type="xsd:string" xs:type="type:string" xmlns:xs="http://www.w3.org/2000/XMLSchema-instance">'+_UserPassword+'</UserPassword>'+chr(13)+chr(10)
cxml += ' <OwnerVatNumber xsi:type="xsd:string" xs:type="type:string" xmlns:xs="http://www.w3.org/2000/XMLSchema-instance">'+OwnerVatNumber+'</OwnerVatNumber>'+chr(13)+chr(10)
cxml += ' </urn:Login>'+chr(13)+chr(10)
cxml += ' </soapenv:Body>'+chr(13)+chr(10)
cxml += '</soapenv:Envelope>'+chr(13)+chr(10)
canswer := fHttpExecute(cxml)
canswer := strtran(canswer,"><",">"+chr(10)+"<")
memowrit("soapanswer.xml",canswer)
xml_read("soapanswer.xml")
Return _SessionID
**********************************************
Function soapLogout(_SessionID)
local cxml,canswer
cxml := '<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:sds2GInterface-IsdsGateway">'+chr(13)+chr(10)
cxml += ' <soapenv:Header/>'+chr(13)+chr(10)
cxml += ' <soapenv:Body>'+chr(13)+chr(10)
cxml += ' <urn:Logout soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">'+chr(13)+chr(10)
cxml += ' <SessionID xsi:type="xsd:string" xs:type="type:string" xmlns:xs="http://www.w3.org/2000/XMLSchema-instance">'+_SessionID+'</SessionID>'+chr(13)+chr(10)
cxml += ' </urn:Logout>'+chr(13)+chr(10)
cxml += ' </soapenv:Body>'+chr(13)+chr(10)
cxml += '</soapenv:Envelope>'+chr(13)+chr(10)
canswer := fHttpExecute(cxml)
canswer := strtran(canswer,"><",">"+chr(10)+"<")
memowrit("soapanswer.xml",canswer)
xml_read("soapanswer.xml")
Return .T.
- Attachments
-
- soap-example.zip
- (84.74 KiB) Downloaded 268 times
Best regards,
Gabor
Gabor