Using SOAP on windows - php

I need to connect to a SOAP endpoint from a windows machine, however, the PowerShell New-WebServiceProxy cmdlet fails to process the WSDL. I can't change the WSDL, and I have the connection working in PHP.
I'm not too sure about using PHP just as a scripting tool. What other tools might be available to get the SOAP endpoint running, and C# seems overkill for this.
other features I need in the scripting tool
- watch/open a file that is created
- find rows that a different in the Files (CSV)

Related

Using AWS for SQL and REST frontend

I'm trying to set up a PostgreSQL db with a REST(php) gate. I want to access this database the standard REST way (using GET and Headers), from a C# application.
Currently I am using a standard web hoster that has a MySQL database, but I want to jump ship to PostgreSQL.
Am I right in thinking Amazon's EC2 servers a good choice to do this? I just need a server with PostgreSQL installed and a bunch of php scripts (for REST).
Thanks
EC2 would work fine, or you could use an RDS PostgreSQL instance, and just run the PHP scripts on a small EC2 instance.
Check out restSQL. It's an open-source, ultra-lightweight persistence layer, with out of the box PostgreSQL support.
It's written in Java but you can use its HTTP API by deploying the service in a standard JEE container, e.g. Tomcat, or as a Docker container. The latest versions are on bundled as images on docker hub.
You can take it for a spin using the sandboxed instance and explore the docs at http://restsql.org.

start a windows service using a webservice in php

I was trying to start or stop a windows service from Android Device. For this i found using webservice would be more efficient way.
So i planned to create web service using php. From php5.3 this can be achieved by using win32_query_service_status.But my server is with php4. So is there any other way to start or stop windows services using PHP
As long as you can issue system commands to the command line, you can control the services using their command-line interface. Something like:
exec('NET START ServiceName');

Autobahn PHP client

I have a python autobahn script (websock) running and working perfectly with the browser, i need to send data from another server running PHP to the python server. is there any PHP websock clients that are compatible with the latest autobahn (websock) protocol ?
i have tried some, but neither worked
like this one
https://github.com/lemmingzshadow/php-websocket/blob/master/client/test_server.php
it didn't !
Ronan,
Take a look at the Thruway project. It's a WAMPv2 PHP client/server that's compatible with the current version of autobahn.js.
You can also find more information on how to create a simple PHP client here.

What do I need for the server side for a websocket?

I am using the following js plugin which allows me to use WebSockets on android and iOS with apps written in html5 (via phonegap in my case).
https://github.com/FreakDev/PhoneGap-Android-HTML5-WebSocket
What else do I need in order to use a websocket?
I have a basic server with bluehost that has PHP and MySQL installed.. What am I going to need to do?
First you can use a library like this one:
http://code.google.com/p/phpwebsocket/
Second, your host must let you create sockets. This mean PHP must have php_sockets.dll (Win) or sockets.so (Linux) extension enabled and a forwarded port from your server.
Also you need to run your php from commend line or somehow keep it alive for ever.
It is just like creating a normal socket in PHP.
*Edit:
WebSockets are just some sort of normal sockets. In websocket you can connect to a endpoint which is listening for connections and then communicate with it. Just like normal sockets but with simple differences in protocol and more limitations. For doing so you need a script or application to run for ever and handle all connections from webpages. But a php file will end just after request ended. For keeping a php file running for ever you need to run it from commend line which mean you need to have shell access, or you can use this code to run your php script for ever: (But you must think about a mechanism to call it only once)
ignore_user_abort(true);
ini_set('max_execution_time', 0);
set_time_limit(0);
You can test. If your application fail with error messages about not knowing a function like socket_connect or socket_bind then you don't have socket extension for php.
Here is phpwebsocket files for download:
http://phpwebsocket.googlecode.com/svn/trunk/%20phpwebsocket/
There is an example there too.
As "Tom van der Woerdt" said PHP is not designed for doing socket programming. Go for a non-scripting language and use a dedicated server or at least a vps for opening and managing sockets.

standalone and php

I have an Apache+Passenger combo server reverse proxying to a Passenger standalone server and works great for the rails app. (I am doing this because the Ruby for the app is different to the Ruby for the Passenger module). However there are a couple of places in the app where I need to serve a php processed page. Whenever I try to do that all I get is the option to open the php file or save it to disk. i.e. Passenger standalone doesn't seem to know how to process the php.
If I remove the reverse proxy then Apache+Passenger (module) process the php page properly and serve up the output correctly.
My questions are:
Am I asking too much of Passenger standalone?
Should Passenger standalone be able to process php files? I have re-started Passenger standalone after installing php5.3 on my ubuntu server.

Categories