In C#, it's kind of easy to use windows credentials for making another web request from a web request (using webclient) :
WCF impersonation/ Authentication
Is it possible to make the same with PHP ?
I have a WCF web service that I would call from a PHP script who is on another server that the one where the PHP script is hosted.
Thanks by advance.
Related
I want build web application using angular2 with MySql database on xampp server and php by server side. Is it posible? How start do this and connect to server? Thanks for answers and advices!
It is quite similar to how I develop with Angular 1 and PHP on a LAMP installation. It is possible of course. Angular 2 (when transpiled) is your client side code. With Angular you can call PHP-services. For example, I created PHP services that encode/decode JSON and read/write from DB's. So the PHP is server side and talks to the DB, Angular is client side and talks to the PHP services via REST.
This url explaines using databases with PHP very well: https://www.binpress.com/tutorial/using-php-with-mysql-the-right-way/17
An addition: Making Rest-API's of your PHP modules also requires you to secure them. If you have an API that updates your DB, then anyone can call it and ruin your application. Since Rest-API's are http calls you can use basic authentication with SSL to secure them.
We have to develop an application with more plattform. We would use the framework PhoneGap. For our application we need services of backend, the question is: Does PhoneGap support PHP?
If it doesn't support PHP. In which way we can solve the problem?
The most important thing is: make call server
(Get and Post), parsing a json and other functions
that PHP gives.
Phonegap does not have a server. You need to call via Ajax to remote servers.
The backend can be in any language which supports HTTP calls, as PhoneGap is an independent client.
You can use PHP to write an API for use within your Javascript PhoneGap application.
I can recommend the Laravel framework to accomplish this.
Yes...you can use PHP or any PHP framework to give backend for mobile app made using phonegap/cordova....point is phonegap/cordova app will be on client mobile which won't understand PHP embedded in phonegap html files....so write an API amd place it on a server and then make AJAX calls to server to do database and other backed operations
Try to return JSON data from the PHP API.....it's a famous data structure and supported by many applications
Is there any way to convert JAX-RPC to JAX-WS web service. The issue is we need to generate a client of this PHP based web service in java. The web service is written in PHP in RPC style, and when java team try to generate the client it get error "Selected wsdl is rpc encoded. You must select JAX-RPC Client" so we are requested to change the encoding style from RPC to WS can any one help in this regard
EDIT
Here is a plugin for netbeans that allow user to generate java based jax-rcp client. but as pre client requirement we need to change the web service. That is why need that.
Thanks in advance.
i am creating web service using NUSOAP i want to add basic authentication to the webservice so that client should send authentication header before he will be able to call webservice function so what will be my server side script my client should send basic authentication server before calling to the hello function I want to Secure my webservice functions
To me, this depends on your webserver. For an apache server for example, see this doc
We connect to a web service hosted by another company. We send a customer's basic info to the service, and it replies with rates/prices for that customer.
I am a PHP guy -- started out playing with basic HTML, then delved into PHP about 8 years ago, and my entire web app is PHP with javascrtipt/ajax mixed in as needed. I'm a learn-as-I-go guy.
For the last two years, the service has been an aspx web service, which was easy -- just connect with PHP's SoapClient. Now, the company hosting the service has changed it to WCF, and the binding is wsHttpBinding, and authentication is done via x509 certification.
I've determined that PHP's SoapClient can't handle wsHttpBinding. So my first roadblock - how the heck do I connect to this service? I went as far as to install MS Visual Web Developer 2010 Express, and then I used svcutil.exe to create .config and .cs files for the service. But understand, I've never written anything in C# or VB. I've done a few little VBScripts in the past, and I can handle javascript... but I'm looking at these .config and .cs files and thinking, now what the heck do I do with these??
Basically, I just want to connect to this service using PHP and javascript. But since it seems that's impossible (correct?), is there a way I can invoke a VB/C# operation from within my PHP script? For instance, pull the customer's info from mysql and prepare the data for the service using PHP, then use VB/C# to connect to and communicate with the service? Or any better ideas?
All hints/ideas/suggestions are greatly appreciated!
Interesting. You are connecting to web service hosted by another company and they probably know that you are using PHP. Despite it they modified the service in the way which is not fully compatibile with PHP.
I'm .NET guy. I have already done some projects where WS-Security an PHP was involved. I was in opposite situation. My service was written in PHP and I had to consume it in .NET. The situation was much easier because .NET supports much bigger set of WS-* protocols.
I know that PHP team used WSO2 Web Services Framework to create the service. You can try to use it in your case to consume .NET service.