Is using PHP NuSOAP a bad idea? - nusoap

I read somewhere here on stackoverflow that using NuSoap is not a good idea and its dead. If it is, what is the best possible solution to create WSDL files. I was just nusoap just for creating wsdl files and I never got the webservice to work

NuSOAP isn't being developed any more and hasn't been for a while.
I have looked at most of the current PHP Soap options, and settled for Zend_Soap_Server, specifically because of its AutoDiscovery component.
The main point about AutoDiscovery is that the WSDL is generated from the docblocks within your code. So as long as you follow the correct conventions, the component will build a well-formed WSDL for you.
If you don't want to use a framework, you can just include the files Server.php, AutoDiscover.php and Wsdl.php. I do it like this;
require_once 'Zend/Loader.php';
require_once "Zend/Loader/Autoloader.php";
$autoloader = Zend_Loader_Autoloader::getInstance();
Zend_Loader::loadClass('Zend_Soap_Server');
Zend_Loader::loadClass('Zend_Soap_AutoDiscover');
Zend_Loader::loadClass('Zend_Soap_Wsdl');
It's also worth remembering that AutoDiscovery alone IS NOT a SOAP server, it just generates your WSDL. So in theory, you could probably use it to create a WSDL, but use a different SOAP server if you wanted to i.e. the native PHP one (which does not generate WSDL). However, as you will have loaded up the Zend Soap Server it would seem a bit wasteful not to use it IMO.

If you're working with PHP4, it might be your only alternative.
With PHP5, you can use Zend Soap. http://framework.zend.com/manual/en/

I'm using Nusoap with php 5.2.5. Working great for me. But I never tested it with higher veersion.

Same as MacMan, I am using with php 5.2.17 and it is working great, easy that native PHP SOAP, I guess.

Related

how to call a soap webservice made in delphi (on apache) from curl

In Delphi 11 Alexandria, I created a simple SOAP webservice using File->New->Soap Server. I asked to create the demo interfaces, I have built the project, corrected Apache conf, and I have copied the DLL inside Apache's module directory.
So, if I request:
http://127.0.0.1:81/xyz/mod_webbroker.dll
I get into the page where I see the interfaces, and I can view the WSDL.
Now, I would like to try to call the demo function (echoDouble) from PHP using curl.
How do I know what address I should use?
I tried:
http://127.0.0.1:81/xyz/wsdl/IMyService/echoDouble/
But it's not working.
Any help?
I understand my doubts now. I have always used "Datasnap rest application" but now I am trying "SOAP server application", that is why I cannot find the correct URL, because they work different. When using "Datasnap rest application" you need to go to a specific URL to get the function but SOAP works different, the base URL is always this (in my case):
http://127.0.0.1:81/xyz/wsdl/IMyService/
Sorry for that, I will switch back to "Datasnap rest application"

Cookie authentication in websharper + suave + OWIN

As part of an evaluation process for a commercial project I'm searching for any full fledged example of authentication/authorization using the websharper stack. I'd like to use OWIN, since it seems to be a well designed protocol, but I'm open to alternatives.
Some requirements:
use Mono
use the Suave server.
For now, we have been trying to adapt this tutorial for the websharper toolchain: https://www.codeproject.com/tips/849113/four-easy-steps-to-set-up-owin-for-form-authentica
This is what we currently have: https://github.com/Denommus/cookies-problem/blob/master/Main.fs
I would also like to mention that the default method ctx.UserSession.LoginUser has this issue: https://github.com/intellifactory/websharper/issues/647
But the cookies file is not being generated for some reason, probably because we're missing something obvious. Anyone able to help?
EDIT
I think I figured out the reason why the cookies file is not being generated: the Suave server doesn't actually run OwinStartup, so I need to figure out another way to configure the IAppBuilder of my application. But I still don't know how to do it, so if anyone can help I'll appreciate.
EDIT 2
I think I fixed the configuration of OWIN in my application, but I still don't have cookies being generated.

TypeScript in MVC

Im bulding a website using MVC4. Recently I've read about TypeScript. It looks really nice however I cannot find any use for it in a MVC website. Am I missing something? Do you use it? Where?
TypeScript is a pre-compiler for JavaScript. Hence you can use TypeScript only as a replacement for JavaScript (server-side, e.g. Node.js, or client-side, i.e. in the browser).
As you are probably writing MVC4 code with C#, TypeScript will be of no use for you in relation to MVC4.
Regarding the client-side it's somewhat different.
I guess the main point you need to know is that TypeScript is not (yet) just another language on the server, that you can exchange with C#.
I find it quite useful for building largish apps with lots of logic on the client. The interfaces help avoid some errors. It compiles to javascript so you could use it instead of javascript. If you're just writing a couple of lines I wouldn't bother though.
You can link to the generated javascript files from TS files directly in the script bundles or HTML. If you want to automatically link to many JS files, use require JS. This will save you having to link to many js files.

Generate proxy classes from wsdl in IDL

I would like to generate proxy classes/code from a WSDL for IDL. So that I may communicate with a SOAP service.
Anyone know any tutorials or have any clue on how it can be done?
Try to use WseWsdl3 - see http://msdn.microsoft.com/en-us/library/aa529578.aspx .
If WseWsdl3.exe is unable to create the proxy class, there is still a way.
If you can run your service as a regular ASP.NET web application in IIS, it creates temporary ASP.NET files where the proxy class is nicely generated for you.
You can find it in folder:
C:\Windows\Microsoft.NET\Framework\vMAJOR.MINOR.BUILD\Temporary ASP.NET Files\YOUR_WEB_APP.
There are some subfolders with random names, go to most recent one and look something like "App_WebReferences.XXXX.0.cs".

Convert jquery mobile mvc4 web application to phonegap

I've created one Jquery mobile mvc4 web application using webapi support, which is well looking site in almost all mobile device as well. but now i want to convert this MVC application to phonegap to use mobile feature supports like camera,accelerometer,sound etc..
What is the best way to start converting it to phonegap, will i need to create SOAP based web-Service for webapi code. I've searched on web regarding that but not getting enough help,support.
am i going right way ? or need something else ?
any help is appreciable.
Okay so in order to convert it first you are going to have to know Objective-C because that is the only language that is allowed on the iPhone but assuming you know that here are the steps you can take in making a conversion like that.
*Make sure that any outside information the application retrieves is either a) In a REST api you can use the new WebApi in fact I am using it right now and it works like a charm. Or b) Any script src= tags are converted to local files on disk. So if you had script src="My awesome css" make that file a local file on the phone.
*Next take any views and decide where all of their API calling code is. Make not of that and then get ready to be moving that code.
*Once that is all recorded startup a phonegap project and get rid of any extra .index files or anything you don't need.
*Create your applications PhoneGap plugin. Have the OBjective-C plugin make any API calls that you will be needing and then make the javascript plugin match the objective-C function.
*Where you had any calls in your previous views, make those now call the cordova (PhoneGap) plugin.
This is a very brief roadmap to get started.
Once the tediousness is over it is worth it though. I moved my IOS application to Android and they transfer pretty easy.
Cheers

Resources