Simplewebservice

11 May 2011

Hi

I'm new to the mbed and also to the programming in c. But i've used some example codes and all went fine. I've also managed to make a connection with a mysql server, but usually i work with a webservice to communicate with the database.

So i thought by using the simplewebservice lib, it would be a piece of cake. But when i inserted the library (and also the NetServicesMin, DNSResolver and TcpLineStream libraries), this error kept showing:

"Cannot open source input file "spdomparser.hpp": No such file or directory (E5) <a href="#" onClick="window.open('/cookbook/Compiler-Error-5');">(more info)</a>" in file "lib/SimpleWebService/webservice.h"

I can't find this spdomparser.hpp and i also can't find any information about it...

What am i doing wrong? and Am i actually using the correct library to talk to my webservice?

P.S. sorry for my sometimes bad english.

12 May 2011

Try also importing Hendrik's Simple Plain XML parser library . That contains the include file you are looking for.

12 May 2011

That's the one i needed, thank you!

Now i hope i can manage to 'talk' to my webservice...

12 May 2011

Sorry for forgetting this :-| I have fixed the library description.

12 May 2011

No problem at all.

Can you maybe provide some example code as well? I'm having a hard time setting up the connection... (maybe i'm in over my head here, with my little knowledge of c :-))

12 May 2011

Copied straight from my contest entry:

    WebService *service=new WebService(string("http://www.google.com/ig/api?weather=07749+Germany").c_str());

    SP_XmlDomParser *parser=service->callService();
    if (NULL!=parser) {
        SP_XmlHandle rootHandle( parser->getDocument()->getRootElement() );
        SP_XmlHandle root = rootHandle.getChild( "weather" );
    }

For using the parser itself, look at its sample program. The code there is actually a predecessor of the simplewebservice library :)

26 Mar 2013

Hello,

I am interested to create web service to work on mbed, not to be a client to a web service.

How could I do that, and how will clients interact with me.

For start, one simple method to increment passed variable would bi a great example.

web service functionality:

int increment(int a){ return a++; }

Could You help me ?

26 Mar 2013

My library is no intended to do this, it is a pure client. You need to look at the HTTP server pages, and look for how to implement your own handler. But you can probably use the XML parser library to parse the incoming requests.

26 Mar 2013

Thanks for fast replay.

I have worked with HTTP server pages but now I need to create web service from wsdl to work on mbed.

26 Mar 2013

Don't try to work with WSDL on the mbed. You just won't enough RAM to do that. You will need to write the parser manually, and also create the response directly in the code. Look the /users/hlipka/code/spxmltest_weather/XML parser sample program for how you can parse XML (and yes, I know this will be ugly :).