PHP Websample

ArielRauch
Advanced member
Posts: 231
Joined: Thu Aug 07, 2014 10:04 am

PHP Websample

Post 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>
dkelly
TOP CONTRIBUTOR
Posts: 658
Joined: Mon Nov 29, 2010 8:45 pm
Location: Alpharetta GA USA
Contact:

PHP Websample

Post 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";
ArielRauch
Advanced member
Posts: 231
Joined: Thu Aug 07, 2014 10:04 am

PHP Websample

Post 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
ArielRauch
Advanced member
Posts: 231
Joined: Thu Aug 07, 2014 10:04 am

PHP Websample

Post 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
dkelly
TOP CONTRIBUTOR
Posts: 658
Joined: Mon Nov 29, 2010 8:45 pm
Location: Alpharetta GA USA
Contact:

PHP Websample

Post 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
freddyp
Advanced member
Posts: 1023
Joined: Thu Feb 09, 2012 3:53 pm

PHP Websample

Post 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
User avatar
gabrielp
Advanced member
Posts: 645
Joined: Fri Aug 08, 2014 4:31 pm
Location: Boston
Contact:

PHP Websample

Post 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?
Free Switch scripts: open-automation @ GitHub
Free Switch apps: open-automation @ Enfocus appstore

Want to hire me? I'm looking for my next gig. Contact me on LinkedIn or via email.
ArielRauch
Advanced member
Posts: 231
Joined: Thu Aug 07, 2014 10:04 am

PHP Websample

Post 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
ArielRauch
Advanced member
Posts: 231
Joined: Thu Aug 07, 2014 10:04 am

PHP Websample

Post 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
Post Reply