Call webservice form BlitzMax
BlitzMax Forums/BlitzMax Programming/Call webservice form BlitzMax
| ||
hi I would like to call a web service(c#,.net) from BlitzMax. I need to be able to pass parameters and read the response from the web service Any ideas to start with? |
| ||
Like sending a POST request? You can probably use curl for that. |
| ||
Sending the HTTP request is the easy part. The difficult part comes when you need to interpret the SOAP message that is returned by a .NET webservice. As far as I know, blitzmax does not have a SOAP module yet. With the reflection stuff in bmax nowadays, this may actually be doable to some degree, but it's gonna take some work. |
| ||
My xmlrpc.mod uses xmlrpc-epi which also has some support for SOAP. You could give it a try but I think you do need to hack a bit into the source for it to work correctly. |
| ||
The easiest thing would be to build a very small ASP wrapper that passes the request to the web service and replies in a friendly format. We do it all the time where I work and there are a lot of tutorials on this. |
| ||
If someone gets this working i would like to see the code or use it myself. Unfortunately it is way over my head at the moment so i couldn't even attempt it. Cheers Glenn |
| ||
The easiest thing would be to build a very small ASP wrapper that passes the request to the web service and replies in a friendly format. We do it all the time where I work and there are a lot of tutorials on this. Is there any sample code or forum links which you can give me for this approach? Any help would be appreciated |
| ||
I do not believe that reflection is relevant to your need here. I would recommend using two of Brucey's modules to accomplish this, both of which are well documented. - libcurl to make the POST request and get the response (Brucey, I cannot find a download for libcurl - search on google code turns up nothing, does anyone have a copy of this locally to get him started?) - using libcurl is superior to shelling out to call an external curl binary because it will allow you to directly read the result and does not depend on a system having curl installed (many do not), and does not create a separate process which is very expensive on many architectures - libxml to create the SOAP request packet and to parse the response packet. I do not currently have an interest in gluing these together myself but it should be a relatively simple exercise, particularly if you are targeting a single SOAP call or only a few. Writing something very generic would be a bit more complicated. |
| ||
I cannot find a download for libcurl It's on the Downloads page :-) |
| ||
Here is a simple example on how to wrap a service: http://www.codeproject.com/KB/webservices/WebServiceConsumer.aspx |
| ||
I can't for the life of me figure out why someone would want to wrap a web service in a non-standard interface. Do yourself a favor and take the time to make your app call SOAP services directly. It's barely any more work - actually less because you don't have to host your glue code on a website anywhere. It's on the Downloads page :-) Hmm indeed it is. Odd, the search linked to from the home page turns up nothing. |
| ||
You might also be interested in this. It's a web service proxy wizard offered by Microsoft that allows you to bind a web service through a DLL. The tool is pretty awesome. http://msdn.microsoft.com/en-us/library/aa239611(VS.60).aspx |