<p>I have a C++ app that needs to connect to a JAVA web app, are there any good, open source SOAP packages for this, or would it be easier to just roll my own?</p>

[{'answer_id': 45089, 'author': 'Daniel Huckstep', 'author_id': 4657, 'author_profile': 'https://Stackoverflow.com/users/4657', 'pm_score': 1, 'selected': False, 'text': '<p>A quick Google turned up <a href="http://www.cs.fsu.edu/~engelen/soap.html" rel="nofollow noreferrer">this</a> for a toolkit. While I have never used it, it seems to be quite popular and solid. Not exactly a package, and not really rolling your own, but sort of in the middle.</p>\n'}, {'answer_id': 45159, 'author': 'Joe Liversedge', 'author_id': 4552, 'author_profile': 'https://Stackoverflow.com/users/4552', 'pm_score': 0, 'selected': False, 'text': '<p>Take a look at Apache\'s <a href="http://ws.apache.org/axis/index.html" rel="nofollow noreferrer">Axis</a> project. It\'s well supported on C++ (and Java) and if you have the good fortune to start with a good WSDL for the target service you\'ll be home-free.</p>\n'}, {'answer_id': 45359, 'author': 'Boris Terzic', 'author_id': 1996, 'author_profile': 'https://Stackoverflow.com/users/1996', 'pm_score': 4, 'selected': False, 'text': '<p>I\'ll vote up darkhelmet since <a href="http://www.cs.fsu.edu/~engelen/soap.html" rel="noreferrer">gSoap</a> would also be my recommendation. We\'re mostly a Java shop but with some C++ bits and gSoap has been our preferred SOAP integration way. It is indeed more work than your typical Java stacks but it seems solid.</p>\n'}, {'answer_id': 84771, 'author': 'Community', 'author_id': -1, 'author_profile': 'https://Stackoverflow.com/users/-1', 'pm_score': 1, 'selected': False, 'text': '<p>We went with gSOAP rather than Axis to avoid having a dependency on both a JRE and Axis just for building a C++ project.  It\'s worked ok, which is good since the gSOAP code is horrible and makes it very daunting to fix any bugs in it.</p>\n\n<p>A warning about gSOAP linking though: you can never use more than one WSDL in a single link object (executable, dll, shared object).  This is because some of the generated WSDL-specific functions have general names (e.g. soap_getfault()).</p>\n\n<p>Worse, with Unix ELF linking, these names will cause cross-linking between shared objects, so a FooService fault might be processed by the soap_getfault() for BarService, corrupting memory if the fault detail structures are different.</p>\n\n<p>The workaround for that is to make sure that nothing gSOAP-related is exposed outside the SO they are linked into.  This can be solved by giving gcc these definitions _both when linking the gSOAP library itself and linking your code:</p>\n\n<pre><code>#define SOAP_FMAC2  __attribute__ ((visibility ("hidden")))\n#define SOAP_FMAC4  __attribute__ ((visibility ("hidden")))\n#define SOAP_FMAC6  __attribute__ ((visibility ("hidden")))\n#define SOAP_NMAC   __attribute__ ((visibility ("hidden")))\n</code></pre>\n\n<p>I solved it by putting them into a header file and forcing gcc to include that before anything else with <code>-include fixsoaplink.h</code>.</p>\n\n<p>A better way if you can take the effort might to change the default ELF visibility to hidden, and only export the symbols you want to (like dllimport/dllexport in VC).</p>\n'}, {'answer_id': 92256, 'author': 'Matt Cruikshank', 'author_id': 8643, 'author_profile': 'https://Stackoverflow.com/users/8643', 'pm_score': 0, 'selected': False, 'text': "<p>When I saw the generated code from gSOAP, I about had a heart attack.</p>\n\n<p>The fact that the user is required to do all of the memory management for each object just boggled my mind.  So, I sat down and did something probably stupid in the long term, but fairly satisfying in the short term...</p>\n\n<p>I wrote a program that wraps the gSOAP code with my own CPP classes that make the interface look more like I'd like it to look.</p>\n\n<p>I used Scoped Guards within each service method to hold onto memory, and since I'm dealing with all sorts of different types, I used a <code>std::list&lt;boost::any&gt;</code> to do it.  I have functions that make each object type that I need, and they put the actual memory into my <code>list&lt;any&gt;</code>.  It's had a few problems - mostly just configuration changes.  I'm generating thousands of classes now, talking to dozens of web services.</p>\n\n<p>I'm not sure I'd recommend my same path to anyone else...  I should probably bite the bullet and start trying to contribute to gSOAP, rather than maintain my own tool which is dependent on the output of gSOAP...</p>\n"}, {'answer_id': 148822, 'author': 'Community', 'author_id': -1, 'author_profile': 'https://Stackoverflow.com/users/-1', 'pm_score': 0, 'selected': False, 'text': "<p>Here's another issue with gSOAP we just discovered the hard way: it uses select() for all polling, so once you've got 1024 file descriptors open (64 on Windows?) it will trash the stack.  That results in either spurious errors where it is unable to send messages, to complete crashes of the application.</p>\n\n<p>The workaround, unless you're prepared to patch gSOAP itself, is to write your own network code and hook it in with soap->fconnect, ->fsend, ->frecv etc.</p>\n"}]
['https://Stackoverflow.com/questions/45086', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/2066/']