Page 2 of 2
PHP Websample
Posted: Mon Sep 08, 2014 7:58 pm
by ArielRauch
C:UsersUnicorn>c:phpphp -v
PHP 5.6.0 (cli) (built: Aug 27 2014 11:53:11)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2014 Zend Technologies
C:UsersUnicorn>
PHP Websample
Posted: Mon Sep 08, 2014 8:43 pm
by dkelly
sorry, I don't do web development on Windows. Prefer Linux and OS X.
I'm pretty sure that SOAP client is working since your error message said it couldn't connect to host. However, make sure SOAP is installed and enabled
http://devnumbertwo.com/php-class-soapclient-not-found/
Is Switch and PHP running on same server? If not then customize this line with the name of your Switch server. Also verify port # in Switch preferences in 51008.
$protected_url = "
https://localhost:51008";
PHP Websample
Posted: Mon Sep 08, 2014 9:01 pm
by ArielRauch
i prefer not to do anything on windows:) Reality forces me unfortunately.
Yes they are on the same machine.
I will see whether I can find a linux box to set up the PHP frontend.
one question: what are the bandwidth requirements for the connection between the web server and switch?
Thanks
Ariel
PHP Websample
Posted: Mon Sep 08, 2014 9:02 pm
by ArielRauch
i prefer not to do anything on windows:) Reality forces me unfortunately.
Yes they are on the same machine.
I will see whether I can find a linux box to set up the PHP frontend.
one question: what are the bandwidth requirements for the connection between the web server and switch?
Thanks
Ariel
PHP Websample
Posted: Mon Sep 08, 2014 10:41 pm
by dkelly
ArielRauch wrote: what are the bandwidth requirements for the connection between the web server and switch?
very small except when you submit files
PHP Websample
Posted: Tue Sep 09, 2014 8:35 am
by freddyp
gabrielp wrote: Just curious -- what does the web services module do? I've done a lot with PHP's SoapClient and it's really great. I did some stuff with Switch in Javascript using their Soap class which turned out all right but it would be great if I could roll in my PHP code into Switch somehow.
What you have been doing with the SOAP class in Javascript is to use Switch as a SOAP client. The Web Services Module enables the use of Switch Server as a SOAP server, so you can write some external application (usually, but not always, a web page) that acts as a Switch Client.
You can easily execute PHP code in Switch with the "Execute command" element. The command is the path to your PHP server and in the arguments you specify the name of your PHP script, plus any other parameters you can pick up from all the available Switch variables.
Freddy
PHP Websample
Posted: Tue Sep 09, 2014 3:11 pm
by gabrielp
Thanks for all who chimed in with the explanation. The web services module does sound pretty cool.
As far as the error, I'm not 100% sure I'm understanding what the issue is because I'm a little confused about how this is setup. But... the main issue seems to be that there is an uncaught SoapFault exception, so I'd try catching that.
try {
//...
} catch (SoapFault $e) {
echo "SoapFault: ".print_r($e, true)."n";
//echo "faultcode: '".$e->faultcode."'";
//echo "faultstring: '".$e->getMessage()."'";
}
I think it should be caught if your catching Exception, but maybe try a print_r on $e?
PHP Websample
Posted: Tue Sep 16, 2014 7:32 pm
by ArielRauch
Only to keep you posted: support connected to the server but was not able to solve the issue.
They will get back with new ideas - I hope
PHP Websample
Posted: Mon Sep 22, 2014 4:27 pm
by ArielRauch
ok - support found out that it does not support php 5.6.
Afterwards I ran into other permission issues and I finally moved to a linux box.
May the force be with me