nusoap

Returning An Array of Objects in PHP Web Service

北城余情 提交于 2019-11-30 20:18:42
I want to return an array of article objects in a PHP web service, using nuSOAP v 1.114. This is how I set up the WSDL: $server->wsdl->addComplexType( 'ArticleType', 'complexType', 'struct', 'all', '', array('articleId' => array('name'=>'articleId', 'type'=>'xsd:int'), 'heading' => array('name'=>'heading', 'type'=>'xsd:string'), 'text' => array('name'=>'text', 'type'=>'xsd:string') ) ); $server->wsdl->addComplexType( 'ArrayOfArticleType', 'complexType', 'array', '', 'SOAP-ENC:Array', array(), array( array('ref' => 'SOAP-ENC:arrayType', 'wsdl:arrayType' => 'tns:ArticleType[]' // ArticleType[] )

nusoap simple server

亡梦爱人 提交于 2019-11-30 19:20:38
Hi i am using this code for nusoap server but when i call the server in web browser it shows message "This service does not provide a Web description" Here is the code <? //call library require_once ('lib/nusoap.php'); //using soap_server to create server object $server = new soap_server; //register a function that works on server $server->register('hello'); // create the function function hello($name) { if(!$name){ return new soap_fault('Client','','Put your name!'); } $result = "Hello, ".$name; return $result; } // create HTTP listener $server->service($HTTP_RAW_POST_DATA); exit(); ?> An

Parsing a SOAP response with PHP in different ways [duplicate]

家住魔仙堡 提交于 2019-11-30 17:43:39
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: How to parse SOAP response without SoapClient I have a simple nuSoap XML response: <?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <soap:Body> <LoginResult xmlns="http://Siddin.ServiceContracts/2006/09">FE99E5267950B241F96C96DC492ACAC542F67A55<

SOAP authentication with PHP

怎甘沉沦 提交于 2019-11-30 14:12:58
问题 I need to connect to a web service that requires authentication credentials in the form of a plain text user name and password. I have a basic understanding of SOAP and have managed to connect to other open web services that do not require a username or password using NuSOAP. The following was sent to me: <?php // Set up security options $security_options = array("useUsernameToken" => TRUE); $policy = new WSPolicy(array("security" => $security_options)); $security_token = new WSSecurityToken

SOAP authentication with PHP

末鹿安然 提交于 2019-11-30 09:41:01
I need to connect to a web service that requires authentication credentials in the form of a plain text user name and password. I have a basic understanding of SOAP and have managed to connect to other open web services that do not require a username or password using NuSOAP. The following was sent to me: <?php // Set up security options $security_options = array("useUsernameToken" => TRUE); $policy = new WSPolicy(array("security" => $security_options)); $security_token = new WSSecurityToken(array( "user" => "xxx", "password" => "xxx", "passwordType" => "basic")); // Create client with options

How to get rid of “Uncaught SoapFault exception: [Client] looks like we got no XML document in…” error

╄→尐↘猪︶ㄣ 提交于 2019-11-30 08:57:38
I'm trying to develop business logic for a dynamic site using nusoap on server side (because I need wsdls, and PHP SOAP extension can't generate wsdls), and PHP SOAP extenstion on client side. However, I can't get even login and getRole functions right. When i try to invoke client, I get following message Uncaught SoapFault exception: [Client] looks like we got no XML document in [some paths]... Wsdl does exist on server side, and client does read it (when I put wrong url for wsdl, I get an error). Can anyone help?? It looks like your client receives some invalid XML - either the WSDL itself

Returning An Array of Objects in PHP Web Service

给你一囗甜甜゛ 提交于 2019-11-30 04:15:16
问题 I want to return an array of article objects in a PHP web service, using nuSOAP v 1.114. This is how I set up the WSDL: $server->wsdl->addComplexType( 'ArticleType', 'complexType', 'struct', 'all', '', array('articleId' => array('name'=>'articleId', 'type'=>'xsd:int'), 'heading' => array('name'=>'heading', 'type'=>'xsd:string'), 'text' => array('name'=>'text', 'type'=>'xsd:string') ) ); $server->wsdl->addComplexType( 'ArrayOfArticleType', 'complexType', 'array', '', 'SOAP-ENC:Array', array(),

nusoap simple server

北城以北 提交于 2019-11-30 02:57:22
问题 Hi i am using this code for nusoap server but when i call the server in web browser it shows message "This service does not provide a Web description" Here is the code <? //call library require_once ('lib/nusoap.php'); //using soap_server to create server object $server = new soap_server; //register a function that works on server $server->register('hello'); // create the function function hello($name) { if(!$name){ return new soap_fault('Client','','Put your name!'); } $result = "Hello, ".

How do I read SOAP reply Envelope by PHP

随声附和 提交于 2019-11-29 14:55:43
How do I read the error_code from this SOAP reply Envelope? My PHP version is: 5.2.0. <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"> <soap:Body> <Response xmlns="http://xxx.gateway.xxx.abcd.com"> <return> <transaction_id>1234567</transaction_id> <error_code>109</error_code> </return> </Response> </soap:Body> </soap:Envelope> I just need to read the value of error_code tag.here the value is :109 I am using nusoap. I used the below code but not working properly: $response=htmlspecialchars($client->response, ENT_QUOTES); $xml = simplexml_load_string($response); $ns = $xml-

Sending Raw XML via PHP SoapClient request

假如想象 提交于 2019-11-29 10:59:42
I am trying to simply send RAW xml to a webservice via PHP and SoapClient. The problem is when I encode my XML it changes the order of elements in the XML that is converted to an associative array. // Initialize the Soap Client: $this->_transactionServicesClient = new SoapClient($soapWSDLUrl); How or what would be the best way to send the following XML as a string to my SoapClient? <?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://www.micros.com/pos/les/TransactionServices"> <SOAP-ENV:Body> <ns1