PDA

View Full Version : qmake: how to call gsoap



niko
18th February 2006, 12:55
I'm trying to create a SOAP-Client in Qt.

The Soap-Client works allready as pure c++ application with a custom Makefile.

But now i wanted to use qmake for Makefile-generation.

This is the Makefile i used for the c++ application:


GSOAP=../gsoap/soapcpp2
SOAPH=../gsoap/stdsoap2.h
SOAPCPP=../gsoap/stdsoap2.cpp
CPP=g++
LIBS=-lwsock32
COFLAGS=-O2
CWFLAGS=-Wall
CIFLAGS=-I../gsoap
CMFLAGS=
CFLAGS= $(CWFLAGS) $(COFLAGS) $(CIFLAGS) $(CMFLAGS)
all: quote
quote: quote.h quote.cpp $(SOAPH) $(SOAPC)
$(GSOAP) quote.h
$(CPP) $(CFLAGS) -o quote quote.cpp soapC.cpp soapClient.cpp $(SOAPCPP) $(LIBS)
clean:
del *.o soapH.h soapStub.h soapC.cpp soapC.c soapClient.cpp soapClient.c soapServer.cpp soapServer.c soap*Proxy.h
distclean:
del *.o *.wsdl *.xsd *.xml *.nsmap *.log soapH.h soapStub.h soapC.cpp soapC.c soapClient.cpp soapClient.c soapServer.cpp soapServer.c soap*Proxy.h quote


So far I added this to my .pro file:
INCLUDEPATH += ../gsoap
SOURCES += quote.cpp soapC.cpp soapClient.cpp ../gsoap/stdsoap2.cpp
HEADERS += quote.h
LIBS += -lwsock32

how do i add the $(GSOAP) quote.h call?
what else i'm missing?

thanks!
niko

wysota
20th February 2006, 16:29
I use something like that (using qmake 1.07a (Qt 3.3.4)):


HEADERS += funcs.h \
structs.h
SOURCES += funcs.cpp \
ws/soapGPSService.cpp \
ws/soapC.cpp
wsdldefinition.target = soapGPSService.h
wsdldefinition.commands = soapcpp2 -2 -S -i -d ws funcs.h
QMAKE_EXTRA_UNIX_TARGETS = wsdldefinition
LIBS += -lgsoap++
INCLUDEPATH += ../../gis/include \
../server \
ws/
CONFIG += release \
warn_on \
staticlib
TEMPLATE = lib
Those includepaths are my project internal paths. GSoap includes are available globally in my system, so I didn't put them into INCLUDEPATH.

yshurik
22nd February 2006, 12:32
As option you can use QtSoap module from Qt Solutions.

yogeshgokul
25th April 2008, 12:49
I used the QtSOAP. Its useless, it doesnt support ids and href. And has many more problems. Qt people itself said to me that it needs very much refinement and will take time to get it perfect. Now I am using gSOAP.
But QtSOAP is much more easy for newbie but gSOAP needs more attention.

Its depends on your needs, if webservice is simple then you can go for QtSOAP. (=no complex xml request reply)



Have Fun:)

patrik08
26th April 2008, 12:03
Soa request is simple post or get http request...
i use my fast writteln http debugger to create a xml request..
http://www.qt-apps.org/content/show.php/Http+Debugger++qt4.3.3?content=76432

inside you find a sample soa to get EuroExchangeRate on swiss mony.

After i pack the request on base64 encoded resource
write the method

on this way i update 300 Holiday houses on 7 minutes .... i send 100 group QThread request to other server and i process all response to my mysql database....

Normal soa lib not work on Thread evry single request each time...




void SoaRequest::Login()
{
qDebug() << "### soa Login ACTION ###################";
QString Stream_0 ="PD94bWwgdm baseencoded xml Vyc2lv";
QString Stream = fromBase64(Stream_0);
Stream = Stream.replace("_PASS_",decodeBase64(setter.value("tijava/pass").toString()));
Stream = Stream.replace("_USER_",decodeBase64(setter.value("tijava/user").toString()));
ResetSession();
Send(Stream,_URLSYSTEM_,1);
}

void SoaRequest::Logout()
{
qDebug() << "### soa Logout ACTION ###################";
QString Stream_0 ="PD94bWwgdm baseencoded xml Vyc2lv";
QString Stream = fromBase64(Stream_0);
Stream = Stream.replace("_SESSION_",WebSessionCurrent);
qDebug() << "### soa logout -> " << WebSessionCurrent;
Send(Stream,_URLSYSTEM_,0);
ResetSession();
}
void SoaRequest::Send( QString streams , QUrl url , const int memid )
{
header.setRequest("POST",url.path(),1,1);
header.setValue("Accept-Charset","ISO-8859-1,utf-8;q=0.7,*;q=0.7");
header.setValue("Accept-Encoding","gzip,deflate,qcompress");
header.setValue("Connection","keep-alive");
header.setValue("Content-Type","text/xml; charset=utf-8");
/* other sets
read response and finish ...
*/
}