Creating C++ Soap Client in Visual Studio 2010 - c++

I am trying to connect to a Soap Web service. I am very familiar with C++ , but this is the first time I try anything related to the web. I would like to use visual studio. Can anyone explain how to do it?

Can anyone explain how to do it?
Some notes (this is not a complete list/howto, but more of a guideline):
First, you need to choose a SOAP client library for C++. The best out there (or not the best - that's debatable) seems to be gSOAP.
For gSOAP (the library I am familiar with):
Second, (with gSOAP) you can generate a code base particular to the SOAP endpoints you need to connect with.
Third, add a project in Visual Studio ("project A") that links against this generated code, and hides it's interface behind it's own (A's) interface. This is not mandatory, but it is good practice, ensuring that changes to the generated code, do not force you to recompile your entire code base.
DO NOT EDIT the generated code. That would ensure you can no longer regenerate it, or that when you regenerate it you will have to apply all your edits again. If you have any workaround or processing to be done on requests/responses, implement those in Project A.
Then, write your code based on your Project A.

Related

Using \MDd and \MTd in the same visual studio solution?

I have a large preexisting code base depending on many external libraries which all uses \MTd as the runtime setting. This code base is stable and well tested in this configuration.I would prefer to keep it as is.
I am attempting to integrate a new external library into the code base (incase it matters it is the Casablanca REST SDK) however I have just discovered it appears to need to be used with the \MDd setting. I was getting some strange untrackable bug deep in std:shared_ptr when I discovered this problem. When I changed my isolated project to use \MDd casablanca worked much better.
Visual studio does not appear to allow me to have different settings it appears to be either all or nothing in one solution?
Does anyone know of a good work around for this situation? Any suggestions? I'm not even sure where to focus my attention?
1) Can I fake Visual studio out and use both? and if so should I actually do that?
2) Or should I attempt to get a working static library of casablanca? It does not appear possible on the disscussion forum?
3) Or should I just bite the bullet and move the entire solution to \MDd?
4) Lastly, should I just cut my loses and try a different client server framework? A quick search showed for a windows c++ client server solution I could use Boost Asio, Google Client API, WinSock?
This is my first client server implementation and opinions are very welcome.
We actually moved the entire code base to link dynamically. There were other libraries causing some concerns and this seemed like a good time to migrate the code base. Problem solved, at least for now. Thanks for the feedback.

C/C++ PayPal Integration

I've seen a lot of topics for PayPal integration for sites, Java, C# and even Objective-C, but I can't seem to find anything on C/C++, specifically. So where can I look to get an idea of what might be necessary to go about adding PayPal into a C++ project that is intended to operate on Windows, Mac and Linux, at least?
The objective is to create an in-project store, along with an in-project donation jar of sorts. Is there a viable cross-platform solution, or does it need to be changed based on platform? Either way, is C/C++ still a possible language to write these per-platform systems?
Well, there is no official NVP library for C++ and I doubt using a third-party one (if it exists) is a good idea.
So, you should probably go with their SOAP API. Finding SOAP libs for C++ is not a problem.
Another option is simply using a webpage and opening it (that is, in the user's browser). Or you could integrate some HTML viewer.

The lazy programmers way to wrapping the vbscript/hta file in a standalone statically linked c++ exe

I have a few vbscript/javascript html applications that I will be distributing online( all for windows only). Just small apps, nothing fancy.
My main experience lies with .net and java.I really want the app to be standalone , requiring no installation, and everything in one file. But not letting my users be able to see the code is important too, which doesnt work with vbscript based hta
While I could spend some time doing it all over in c++ and then statically linking to create an independent and happy .exe file, but I will have to spend considerable time brushing up my c++ skills, which are intermediate-ish.
Can I "cheat" and still write the whole application in vbscript/javascript but do something like this in c++ ( pseudo-code below)
#include headerfiles etc
read the vbscript code stored in a variable perhaps?
create a .hta file, put the code in that and run it in Internet explorer
get window handle for internet explorer ,
disable right click( to hide view source option)
Then compile this c++ file and statically link it and distribute my super cool standalone .exe file.
Is this a naive approach? Does it make sense? Yes I *could*learn c++ but if this does the job, I can keep focus on my .net applications which are my main bread and butter. And I can simply use Html to do my user interface rather than using something like QT. Hiding the source would have been nice but it is not super-essential or a dealbreaker, as the app is not commercial anyway. My point is , is there a serious drawback to this approach?
Thank you :)
You're effectively trying to wrap the VBScript/JavaScript code in a native executable that would output the script to a file and then run it. This wouldn't prevent reverse engineering at all - it would only be a very slight hindrance to someone who wants to see your code.
If you reprogrammed your application in C++ completely, it would be somewhat more difficult to construct the source code that is equivalent to the original. However, hiding the source code completely is not possible: if it can be executed by the processor, it can also be reverse engineered.

How to create a login application with Visual Basic (using WebHttpRequest)

Hei there, I'm not experienced at all in C++ as I need to start learning year the next year at my university, though, I've been creating a browser based game and I'm looking for someone to transform it into pc app.
Though, I'm wondering how to make that application send a http request via POST to a file on my webserver with the username / pw.
After all the tutotials I've been reading, I concluded that none worth spending my time with, because they all based on own database, and I'm looking for one that connects to a maestro server and requests the data from there.
This may not be the answer you are looking for, but you may consider two alternatives to a more pure C++ application.
If you already have a working browser game, try to take that same code and put the html/javascript/whatever in a file and give the file a ".hta" extention. It basically opens inside a browser to run your files, but it acts more like an application from the user's viewpoint. (And, as much as I hate Windows, they're pretty fun to create if I may say so). However, your source code with this option is easily read because it can be renamed to a text file (or html file).
You could use Visual C++ (or VB.net, which you have tagged to the question, as well as "Visual" C#) to create an application which mostly consists of a browser view. It could be a "standalone" application (however would rely completely on the .Net framework - may or may not be what you want) that basically accomplishes the same as the option above, but adds that you can "hide" your files inside your application.
Using the two above alternatives, you could make an application relatively quickly that would load your files, which I assume you have already created. Note that neither of the above alternatives will work on anything other than Windows OS's.
If the two above alternatives are not what you want, or if you have questions about either one, I'd be glad to attempt to help.
I've been able to find a friend that would do it in Delphi because I wouldn't want users to download net framework just for this ap.
So the program that would fit most for any apps is Delphi Prism XE (even if it's an addon of Visual Studio)

GetWriterForMessage() not called in Monotouch - is there a workaround?

I have ported over some code from a Windows application to Monotouch.
It is using ASMX Web Services to talk to some API.
The code fails on Monotouch 5 because the method
System.Web.Services.Protocols.SoapHttpClientProtocol.GetWriterForMessage()
is never called.
I have seen that in Mono you will even get a NotImplementedExeption but not in Monotouch. It simply gets ignored.
I need to find a way around this. I have to add custom headers to make the solution work.
Any workarounds or maybe is there even a chance that this will be fixed soon?
(I also filed a bug report, but I'm asking here because I am desperately looking for a workaround).
EDIT:
I found kind of a workaround but it is very annoying to use.
In the auto generated reference file you will have to decorate each and every method with
[SoapHeader( "SessionKeyHeader", Direction = System.Web.Services.Protocols.SoapHeaderDirection.InOut )]
Then implement the custom soap header class but skip the GetXmlWriter() method.
A bug has been filed at Xamarin about this issue.