I am using the following code to read attendance data from a biometric device:
<?php
$options = array(
'location' => 'http://192.168.1.178/iWsService',
'uri' => 'http://www.zksoftware/Service/message/'
);
$client = new SoapClient(null, $options);
$soapRequest = "<GetAttLog><ArgComKey xsi:type=\"xsd:integer\">0</ArgComKey><Arg><PIN xsi:type=\"xsd:integer\">All</PIN></Arg></GetAttLog>";
$response = $client->__doRequest($soapRequest, 'http://192.168.1.178/iWsService', '', '1.1');
echo '<pre>', var_dump(htmlspecialchars($response, ENT_QUOTES)), '</pre>';
?>
This just works fine. But since we do not have the documentation/manual/API Reference for this particular device (and nowhere available), I have no clue on what other functions are available in this machine.
Is there any luck finding out what other SOAP parameters this device could accept?
Your help would be really valuable at this moment. Thank you!
At last I found the SOAP SDK Manual of zksoftware.
Since I was searching for the manual for almost a year, I am uploading it to my server for the benefit of future users:
http://www.myfurni.com/downloads/zksoftware_SOAPSDKManual.pdf
Edit:
The above link doesn't work anymore. Here is the new one:
https://drive.google.com/file/d/0ByvozREXZpckcHlHYnZoOTMtWjg/view?usp=sharing
I don't think it is possible. WSDL is the source of information about functions and arguments. No WSDL - no function list.
Try this It uses the UDP protocol to communicate to the Attendance Machine.
Related
I need to setup a php soapserver that only accepts traffic from a specific (validated) certificate. I've searched everywhere, but have not found a way to do that.
I currently use
$server = new SoapServer($this->wsdl);
It would be amazing if something like this would work:
$server = new SoapServer($this->wsdl, array('local_cert' => $this->cert_file, 'passphrase' => $this->passphrase));
Any help is greatly appreciated.
A very open question which I need some advice on and more importantly pointers in the right direction.
I'm looking at using openstack for my private cloud (currently using VMware) as the main aim is to be able to launch a new VM instance from within our web application so this could be trigger via a php page to deploy new apache worker server for example. The next aim is to develop our code to be able to see when a server load is getting high or needs more worker servers to preform a task to auto launch an instance?
I've been looking at the openstack API to see if this is the best approach? But also looking at juju to see if you can use charms to do this and seeing if the api for juju to is best?
The aim is get this working with VMware or to replace vmware.
My current setup is running openstack on a laptop using nova as the storage so any help with the pointers would be great
I know its a open question
Well there is an SDK page listing many of the OpenStack API client SDKs that exist.
Ref:
https://wiki.openstack.org/wiki/SDKs#PHP
Listed in there are two PHP SDKs for OpenStack currently:
Ref:
https://github.com/rackspace/php-opencloud
https://github.com/zendframework/ZendService_OpenStack
I wouldn't use Juju as an interface. And frankly I am not sure OpenStack is the right tool for what you are doing. But, if you want to play with devstack and get an idea, I think rackspace's php client SDK is probably a good start. Devstack is not a bad way to get that experience either.
example of spinning up a server with php-opencloud:
$server = $compute->server();
try {
$response = $server->create(array(
'name' => 'My lovely server',
'image' => $ubuntu,
'flavor' => $twoGbFlavor
));
} catch (\Guzzle\Http\Exception\BadResponseException $e) {
// No! Something failed. Let's find out:
$responseBody = (string) $e->getResponse()->getBody();
$statusCode = $e->getResponse()->getStatusCode();
$headers = $e->getResponse()->getHeaderLines();
echo sprintf("Status: %s\nBody: %s\nHeaders: %s", $statusCode, $responseBody, implode(', ', $headers));
}
This would be a polling function:
use OpenCloud\Compute\Constants\ServerState;
$callback = function($server) {
if (!empty($server->error)) {
var_dump($server->error);
exit;
} else {
echo sprintf(
"Waiting on %s/%-12s %4s%%",
$server->name(),
$server->status(),
isset($server->progress) ? $server->progress : 0
);
}
};
$server->waitFor(ServerState::ACTIVE, 600, $callback);
I have seen little to know instruction on using php to develop a client website to make remote calls to JiRA.
Currently I'm trying to make a soap client using JSP/Java to connect to a local jira instance. I would like to create and search issues that is all. We are currently having some problems using Maven2 and getting all the files we need from the repository since we are behind a major firewall(yes I've used the proxy).
I have a lot of experience with PHP and would like to know if using the PHP soapclient calls can get the job done.
http://php.net/manual/en/soapclient.soapclient.php
Yes it can be done, using SOAP or XML-RPC.
Using the APIs is pretty much straight forward - have a look at the API documentation to find the right functions for you. your code should look something like :
<?
$soapClient = new SoapClient("https://your.jira/rpc/soap/jirasoapservice-v2?wsdl");
$token = $soapClient->login('user', 'password');
...
... # get/create/modify issues
...
?>
Example of adding a new comment:
$issueKey = "key-123";
$myComment = "your comment";
$soapClient = new SoapClient("https://your.jira/rpc/soap/jirasoapservice-v2?wsdl");
$token = $soapClient->login('user', 'password');
$soapClient->addComment($token, $issueKey, array('body' => $myComment));
Example of creating an issue:
$issue = array(
'type'=>'1',
'project'=>'TEST',
'description'=>'my description',
'summary'=>'my summary',
'priority'=>'1',
'assignee'=>'user',
'reporter'=>'user',
);
$soapClient = new SoapClient("https://your.jira/rpc/soap/jirasoapservice-v2?wsdl");
$token = $soapClient->login('user', 'password');
$soapClient->createIssue($token, $issue);
Note that you need to install php-soap in linux (or it's equivalent in windows) to be able to use the SOAP library.
I am feebly trying to implement a stamps.com api interface into my platform. This is my first time using SOAP, I event had to recompile PHP to enable the libraries.
I'm moving along but now I'm having a problem. They support soap 1.1 and soap 1.2 requests, and when I run the following code:
$client = new SOAPClient(
'./SWSIM.wsdl',
array(
'trace' => 1
)
);
I get back a successful response from my request that comes after this.
However if I add the option to use soap 1.2 like this:
$client = new SOAPClient(
'./SWSIM.wsdl',
array(
'trace' => 1,
'soap_version' => SOAP_1_2
)
);
I get the following error:
There was an exception running the extensions specified in the config file. ---> Value cannot be null. Parameter name: input
This line is not actually throwing the exception. Its the following command that throws it, but removing the soap_version is what "fixes it". I would like to use soap 1.2 so naturally this is bugging me.
FTR The command I'm running is this:
$authData = array(
"Credentials" => array(
"IntegrationID" => "MYUID",
"Username" => "MYUSERNAME",
"Password" => "MYPASSWORD"
)
);
try {
$objectresult = $client->AuthenticateUser($authData);
} catch (Exception $e) {
echo "EXCEPTION: " . $e->getMessage();
print_r($e);
exit;
}
The WSDL file can be viewed here:
https://swsim.stamps.com/swsim/swsimv22.asmx?wsdl
I have also checked in with their developer support and they said:
"The message you are currently receiving is returned from whichever program you are designing your integration with. This has been commonly noted happening within Visual Basic where is creates a wrapper class that needs certain variables for the response. This could be similar to the behavior that you are experiencing. Please verify how your program language consumes a WSDL."
I also noticed that the __soapCall method excepts an "input headers" argument. I'm not entirely sure I should be / can even use that method in my code. I suppose I should just try and play with it.
Check your WSDL file. I was using the wrong one, and it appears you may be as well. Try this one: http://developer.stamps.com/developer/downloads/files/Stamps.com_SWSIM.wsdl
NOTE: The above is out of date. Contact stamps.com for the current wsdl!
I know this is an old thread, but here is an example class that should get anyone started with the stamps.com api in php https://github.com/aaronjsmith/stamps.com-php
The WSDL looks fine and it's the same input structure for both Soap versions. The problem is a bug somewhere at their end, you'll have to contact them to resolve.
I would also test it via a .NET app just to see if it behaves the same.
I would like to create a SOAP Web service for the followıng wsld
http://www.webservicex.com/CurrencyConvertor.asmx?WSDL
Could you please explain how to do this?
The following code is not working... Please help me..
ini_set("soap.wsdl_cache_enabled", "0");
$client = new SoapClient("http://www.webservicex.com/CurrencyConvertor.asmx?wsdl");
$CURR = array("FromCurrency" => "USD","ToCurrency" => "INR");
$scramble = $client->ConversionRate($CURR);
$mirror = $client->ConversionRateResponse($scramble);
Thanks,
Praveen J
Let's start with your client URL:
http://www.webservicex.com/CurrencyConvertor.asmx?wsdl
This is wrong. The ?WDSL URL is NOT the URL you use for CALLING the web service, it is the URL you use to retrieve the WDSL that describes the web service. THis is used by automatic tools to generate a wrapper.
http://www.webservicex.com/CurrencyConvertor.asmx
is the "real" URL that you use to execute operations.
http://www.webservicex.com/CurrencyConvertor.asmx?op=ConversionRate
Has a more invormation on the conversion per se, including the exact parameters with naming you need for the Post and GET operations, including examples.