/** * processes SOAP message returned from server * * @param array $headers The HTTP headers * @param string $data unprocessed response data from server * @return mixed value of the message, decoded into a PHP type * @access private */ function parseResponse($headers, $data) { $this->debug('Entering parseResponse() for payload of length ' . strlen($data) . ' and type of ' . $headers['content-type']); $this->responseAttachments = array(); if (strstr($headers['content-type'], 'multipart/related')) { $this->debug('Decode multipart/related'); $input = ''; foreach ($headers as $k => $v) { $input .= "{$k}: {$v}\r\n"; } $params['input'] = $input . "\r\n" . $data; $params['include_bodies'] = true; $params['decode_bodies'] = true; $params['decode_headers'] = true; $structure = Mail_mimeDecode::decode($params); foreach ($structure->parts as $part) { if (!isset($part->disposition)) { $this->debug('Have root part of type ' . $part->headers['content-type']); $return = parent::parseResponse($part->headers, $part->body); } else { $this->debug('Have an attachment of type ' . $part->headers['content-type']); $info['data'] = $part->body; $info['filename'] = isset($part->d_parameters['filename']) ? $part->d_parameters['filename'] : ''; $info['contenttype'] = $part->headers['content-type']; $info['cid'] = $part->headers['content-id']; $this->responseAttachments[] = $info; } } if (isset($return)) { return $return; } $this->setError('No root part found in multipart/related content'); return; } $this->debug('Not multipart/related'); return parent::parseResponse($headers, $data); }
<?php // include_once 'lib/nusoap.php'; include "lib/nusoap.php"; $name = 'Hassan ITANI'; $parameters = array($name); $soap_cl = new soapclient2('http://127.0.0.1/SoapServer/index.php'); $response = $soap_cl->call('getEmail', $parameters); //echo"<pre>"; //print_r($soap_cl); //die("</pre>"); if (!($error = $soap_cl->getError())) { echo 'Email: ' . $response; } else { echo 'Error: ' . $error; } //echo '<xmp>'.$soapClient->request.'</xmp>'; //echo '<xmp>'.$soapClient->response.'</xmp>';
* * Service: WSDL * Payload: document/literal * Transport: http * Authentication: digest */ require_once '../lib/nusoap.php'; $proxyhost = isset($_POST['proxyhost']) ? $_POST['proxyhost'] : ''; $proxyport = isset($_POST['proxyport']) ? $_POST['proxyport'] : ''; $proxyusername = isset($_POST['proxyusername']) ? $_POST['proxyusername'] : ''; $proxypassword = isset($_POST['proxypassword']) ? $_POST['proxypassword'] : ''; echo 'You must set your username and password in the source'; exit; $username = '******'; $password = '******'; $client = new soapclient2("http://staging.mappoint.net/standard-30/mappoint.wsdl", true, $proxyhost, $proxyport, $proxyusername, $proxypassword); $err = $client->getError(); if ($err) { echo '<h2>Constructor error</h2><pre>' . $err . '</pre>'; } $client->setCredentials($username, $password, 'digest'); $view = array('Height' => 200, 'Width' => 300, 'CenterPoint' => array('Latitude' => 40, 'Longitude' => -120)); $myViews[] = new soapval('MapView', 'ViewByHeightWidth', $view, false, 'http://s.mappoint.net/mappoint-30/'); $mapSpec = array('DataSourceName' => "MapPoint.NA", 'Views' => array('MapView' => $myViews)); $map = array('specification' => $mapSpec); $result = $client->call('GetMap', array('parameters' => $map)); // Check for a fault if ($client->fault) { echo '<h2>Fault</h2><pre>'; print_r($result); echo '</pre>';
<?php require_once 'nusoap/lib/nusoap.php'; $wsdl = "http://wiki.superservicios.gov.co:81/~wduarte/br3.6.0/webServices/servidor.php?wsdl"; $client = new soapclient2($wsdl, 'wsdl'); //$extension = explode(".",$archivo_name); //copy($archivo, "../bodega/tmp/visitas/".$archivo_name); $arregloDatos = array(); $a = $client->call('darUsuario', $arregloDatos); var_dump($a); ?>
<?php require_once 'nusoap/lib/nusoap.php'; $wsdl = "http://172.16.0.147:81/~gmahecha/orfeo_3.6.0/webServices/servidor.php?wsdl"; $client = new soapclient2($wsdl, 'wsdl'); //$extension = explode(".",$archivo_name); //copy($archivo, "../bodega/tmp/visitas/".$archivo_name); $arregloDatos = array(); $a = $client->call('crearRadicado', array()); var_dump($a); ?>
protected function reverseTrans($revNumber) { if ($revNumber <= 0 or empty($this->refNum) or empty($this->merchantID) or empty($this->password)) { return false; } $soapClient2 = new soapclient2($this->webMethodURL, 'wsdl'); $soapProxy = $soapClient2->getProxy(); $result = false; for ($a = 1; $a < 6; ++$a) { $result = $soapProxy->reverseTransaction($this->refNum, $this->merchantID, $this->password, $revNumber); if ($result != false) { break; } } return $result; }