From 5d1e7c2d85806deace7ff94f0d44b48ac00a474d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Wed, 4 May 2011 15:19:38 +0000 Subject: [PATCH] Some fixes for web services --- .../fourn/class/fournisseur.facture.class.php | 1 - htdocs/includes/dolibarr_changes.txt | 3 + htdocs/includes/nusoap/lib/nusoap.php | 484 +++++++++--------- htdocs/lib/functions.lib.php | 3 +- htdocs/webservices/demo_wsclient_invoice.php | 51 +- htdocs/webservices/demo_wsclient_other.php | 30 +- .../webservices/demo_wsclient_thirdparty.php | 27 +- htdocs/webservices/server_invoice.php | 210 ++++++-- htdocs/webservices/server_other.php | 14 +- .../webservices/server_supplier_invoice.php | 19 +- htdocs/webservices/server_thirdparty.php | 14 +- test/soapui/Dolibarr-soapui-project.xml | 200 +++++--- 12 files changed, 660 insertions(+), 396 deletions(-) diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index 8b6757f0fa7..f3d9bddbf84 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -358,7 +358,6 @@ class FactureFournisseur extends Facture { $this->error='Bill with id '.$rowid.' not found sql='.$sql; dol_syslog(get_class($this).'::Fetch rowid='.$rowid.' numrows=0 sql='.$sql); - dol_print_error('',$sql); return -2; } diff --git a/htdocs/includes/dolibarr_changes.txt b/htdocs/includes/dolibarr_changes.txt index d056a683f92..44887b70e3a 100644 --- a/htdocs/includes/dolibarr_changes.txt +++ b/htdocs/includes/dolibarr_changes.txt @@ -21,6 +21,9 @@ Replace By if (! is_array($this->methodreturn) && isset($this->methodreturn) && ((get_class($this->methodreturn) == 'soap_fault') || (get_class($this->methodreturn) == 'nusoap_fault'))) { +* In file nusoap.php, to avoid a warning, +Replace call to serialize_val with no bugged value + FPDF: ----- diff --git a/htdocs/includes/nusoap/lib/nusoap.php b/htdocs/includes/nusoap/lib/nusoap.php index 45b224db34e..f7fc2e60ca0 100644 --- a/htdocs/includes/nusoap/lib/nusoap.php +++ b/htdocs/includes/nusoap/lib/nusoap.php @@ -141,7 +141,7 @@ class nusoap_base { * @access public */ var $XMLSchemaVersion = 'http://www.w3.org/2001/XMLSchema'; - + /** * charset encoding for outgoing messages * @@ -408,7 +408,7 @@ class nusoap_base { $this->debug("in serialize_val: name=$name, type=$type, name_ns=$name_ns, type_ns=$type_ns, use=$use, soapval=$soapval"); $this->appendDebug('value=' . $this->varDump($val)); $this->appendDebug('attributes=' . $this->varDump($attributes)); - + if (is_object($val) && get_class($val) == 'soapval' && (! $soapval)) { $this->debug("serialize_val: serialize soapval"); $xml = $val->serialize($use); @@ -576,8 +576,11 @@ class nusoap_base { } $array_types[$tt] = 1; // TODO: for literal, the name should be $name - $xml .= $this->serialize_val($v,'item',false,false,false,false,$use); - ++$i; + //DOL_CHANGE This is to have tag name with name reported by wsdl and not "item" + //$xml .= $this->serialize_val($v,'item',false,false,false,false,$use); + $tmp=preg_replace('/s$/i','',$name); + $xml .= $this->serialize_val($v,$tmp?$tmp:'item',false,false,false,false,$use); + ++$i; } if(count($array_types) > 1){ $array_typename = 'xsd:anyType'; @@ -589,7 +592,7 @@ class nusoap_base { } elseif(isset($tt) && $tt == 'arraySimple'){ $array_typename = 'SOAP-ENC:Array'; } elseif(isset($tt) && $tt == 'arrayStruct'){ - $array_typename = 'unnamed_struct_use_soapval'; + $array_typename = 'unnamed_struct_use_soapval'; } else { // if type is prefixed, create type prefix if ($tt_ns != '' && $tt_ns == $this->namespaces['xsd']){ @@ -982,7 +985,7 @@ function iso8601_to_timestamp($datestr){ function usleepWindows($usec) { $start = gettimeofday(); - + do { $stop = gettimeofday(); @@ -1093,7 +1096,7 @@ class soap_fault extends nusoap_fault { * @access public */ class nusoap_xmlschema extends nusoap_base { - + // files var $schema = ''; var $xml = ''; @@ -1122,7 +1125,7 @@ class nusoap_xmlschema extends nusoap_base { var $depth_array = array(); var $message = array(); var $defaultNamespace = array(); - + /** * constructor * @@ -1222,7 +1225,7 @@ class nusoap_xmlschema extends nusoap_base { $this->debug("XML payload:\n" . $xml); $this->setError($errstr); } - + xml_parser_free($this->parser); } else{ $this->debug('no xml passed to parseString()!!'); @@ -1244,7 +1247,7 @@ class nusoap_xmlschema extends nusoap_base { } return $scope . $ename . '_ContainedType'; } - + /** * start-element handler * @@ -1254,13 +1257,13 @@ class nusoap_xmlschema extends nusoap_base { * @access private */ function schemaStartElement($parser, $name, $attrs) { - + // position in the total number of elements, starting from 0 $pos = $this->position++; $depth = $this->depth++; // set self as current value for this depth $this->depth_array[$depth] = $pos; - $this->message[$pos] = array('cdata' => ''); + $this->message[$pos] = array('cdata' => ''); if ($depth > 0) { $this->defaultNamespace[$pos] = $this->defaultNamespace[$this->depth_array[$depth - 1]]; } else { @@ -1274,7 +1277,7 @@ class nusoap_xmlschema extends nusoap_base { } else { $prefix = ''; } - + // loop thru attributes, expanding, and registering namespace declarations if(count($attrs) > 0){ foreach($attrs as $k => $v){ @@ -1350,7 +1353,7 @@ class nusoap_xmlschema extends nusoap_base { $aname = $attrs['ref']; $this->attributes[$attrs['ref']] = $attrs; } - + if($this->currentComplexType){ // This should *always* be $this->complexTypes[$this->currentComplexType]['attrs'][$aname] = $attrs; } @@ -1643,8 +1646,8 @@ class nusoap_xmlschema extends nusoap_base { $xml .= " <$schemaPrefix:import namespace=\"" . $ns . "\" />\n"; } } - } - } + } + } // complex types foreach($this->complexTypes as $typeName => $attrs){ $contentStr = ''; @@ -1941,12 +1944,12 @@ class nusoap_xmlschema extends nusoap_base { } return $buffer; } - + /** * adds a complex type to the schema - * + * * example: array - * + * * addType( * 'ArrayOfstring', * 'complexType', @@ -1956,9 +1959,9 @@ class nusoap_xmlschema extends nusoap_base { * array('ref'=>'SOAP-ENC:arrayType','wsdl:arrayType'=>'string[]'), * 'xsd:string' * ); - * + * * example: PHP associative array ( SOAP Struct ) - * + * * addType( * 'SOAPStruct', * 'complexType', @@ -1966,7 +1969,7 @@ class nusoap_xmlschema extends nusoap_base { * 'all', * array('myVar'=> array('name'=>'myVar','type'=>'string') * ); - * + * * @param name * @param typeClass (complexType|simpleType|attribute) * @param phpType: currently supported are array and struct (php assoc array) @@ -1994,11 +1997,11 @@ class nusoap_xmlschema extends nusoap_base { 'attrs' => $attrs, 'arrayType' => $arrayType ); - + $this->xdebug("addComplexType $name:"); $this->appendDebug($this->varDump($this->complexTypes[$name])); } - + /** * adds a simple type to the schema * @@ -2019,7 +2022,7 @@ class nusoap_xmlschema extends nusoap_base { 'type' => $restrictionBase, 'enumeration' => $enumeration ); - + $this->xdebug("addSimpleType $name:"); $this->appendDebug($this->varDump($this->simpleTypes[$name])); } @@ -2037,7 +2040,7 @@ class nusoap_xmlschema extends nusoap_base { } $this->elements[ $attrs['name'] ] = $attrs; $this->elements[ $attrs['name'] ]['typeClass'] = 'element'; - + $this->xdebug("addElement " . $attrs['name']); $this->appendDebug($this->varDump($this->elements[ $attrs['name'] ])); } @@ -2276,12 +2279,12 @@ class soap_transport_http extends nusoap_base { $this->debug("parsed URL $k = $v"); $this->$k = $v; } - + // add any GET params to path if(isset($u['query']) && $u['query'] != ''){ $this->path .= '?' . $u['query']; } - + // set default port if(!isset($u['port'])){ if($u['scheme'] == 'https'){ @@ -2290,10 +2293,10 @@ class soap_transport_http extends nusoap_base { $this->port = 80; } } - + $this->uri = $this->path; $this->digest_uri = $this->uri; - + // build headers if (!isset($u['port'])) { $this->setHeader('Host', $this->host); @@ -2373,7 +2376,7 @@ class soap_transport_http extends nusoap_base { } else { $this->fp = @fsockopen( $host, $this->port, $this->errno, $this->error_str); } - + // test pointer if(!$this->fp) { $msg = 'Couldn\'t open socket connection to server ' . $this->url; @@ -2386,7 +2389,7 @@ class soap_transport_http extends nusoap_base { $this->setError($msg); return false; } - + // set response timeout $this->debug('set response timeout to ' . $response_timeout); socket_set_timeout( $this->fp, $response_timeout); @@ -2475,10 +2478,10 @@ class soap_transport_http extends nusoap_base { // recent versions of cURL turn on peer/host checking by default, // while PHP binaries are not compiled with a default location for the // CA cert bundle, so disable peer/host checking. - //$this->setCurlOption(CURLOPT_CAINFO, 'f:\php-4.3.2-win32\extensions\curl-ca-bundle.crt'); + //$this->setCurlOption(CURLOPT_CAINFO, 'f:\php-4.3.2-win32\extensions\curl-ca-bundle.crt'); $this->setCurlOption(CURLOPT_SSL_VERIFYPEER, 0); $this->setCurlOption(CURLOPT_SSL_VERIFYHOST, 0); - + // support client certificates (thanks Tobias Boes, Doug Anarino, Eryan Ariobowo) if ($this->authtype == 'certificate') { $this->debug('set cURL certificate options'); @@ -2565,7 +2568,7 @@ class soap_transport_http extends nusoap_base { * @access public */ function send($data, $timeout=0, $response_timeout=30, $cookies=NULL) { - + $this->debug('entered send() with data of length: '.strlen($data)); $this->tryagain = true; @@ -2577,18 +2580,18 @@ class soap_transport_http extends nusoap_base { if (!$this->connect($timeout, $response_timeout)){ return false; } - + // send request if (!$this->sendRequest($data, $cookies)){ return false; } - + // get response $respdata = $this->getResponse(); } else { $this->setError("Too many tries to get an OK response ($this->response_status_line)"); } - } + } $this->debug('end of send()'); return $respdata; } @@ -2608,7 +2611,7 @@ class soap_transport_http extends nusoap_base { function sendHTTPS($data, $timeout=0, $response_timeout=30, $cookies) { return $this->send($data, $timeout, $response_timeout, $cookies); } - + /** * if authenticating, set user credentials here * @@ -2630,21 +2633,21 @@ class soap_transport_http extends nusoap_base { } elseif ($authtype == 'digest') { if (isset($digestRequest['nonce'])) { $digestRequest['nc'] = isset($digestRequest['nc']) ? $digestRequest['nc']++ : 1; - + // calculate the Digest hashes (calculate code based on digest implementation found at: http://www.rassoc.com/gregr/weblog/stories/2002/07/09/webServicesSecurityHttpDigestAuthenticationWithoutActiveDirectory.html) - + // A1 = unq(username-value) ":" unq(realm-value) ":" passwd $A1 = $username. ':' . (isset($digestRequest['realm']) ? $digestRequest['realm'] : '') . ':' . $password; - + // H(A1) = MD5(A1) $HA1 = md5($A1); - + // A2 = Method ":" digest-uri-value $A2 = $this->request_method . ':' . $this->digest_uri; - + // H(A2) $HA2 = md5($A2); - + // KD(secret, data) = H(concat(secret, ":", data)) // if qop == auth: // request-digest = <"> < KD ( H(A1), unq(nonce-value) @@ -2655,7 +2658,7 @@ class soap_transport_http extends nusoap_base { // ) <"> // if qop is missing, // request-digest = <"> < KD ( H(A1), unq(nonce-value) ":" H(A2) ) > <"> - + $unhashedDigest = ''; $nonce = isset($digestRequest['nonce']) ? $digestRequest['nonce'] : ''; $cnonce = $nonce; @@ -2664,10 +2667,10 @@ class soap_transport_http extends nusoap_base { } else { $unhashedDigest = $HA1 . ':' . $nonce . ':' . $HA2; } - + $hashedDigest = md5($unhashedDigest); - - $opaque = ''; + + $opaque = ''; if (isset($digestRequest['opaque'])) { $opaque = ', opaque="' . $digestRequest['opaque'] . '"'; } @@ -2686,7 +2689,7 @@ class soap_transport_http extends nusoap_base { $this->authtype = $authtype; $this->digestRequest = $digestRequest; } - + /** * set the soapaction value * @@ -2696,7 +2699,7 @@ class soap_transport_http extends nusoap_base { function setSOAPAction($soapaction) { $this->setHeader('SOAPAction', '"' . $soapaction . '"'); } - + /** * use http encoding * @@ -2716,7 +2719,7 @@ class soap_transport_http extends nusoap_base { $this->encoding = $enc; } } - + /** * set proxy info here * @@ -2745,7 +2748,7 @@ class soap_transport_http extends nusoap_base { unsetHeader('Proxy-Authorization'); } } - + /** * Test if the given string starts with a header that is to be skipped. @@ -2786,7 +2789,7 @@ class soap_transport_http extends nusoap_base { // length := 0 $length = 0; $new = ''; - + // read chunk-size, chunk-extension (if any) and CRLF // get the position of the linebreak $chunkend = strpos($buffer, $lb); @@ -2801,7 +2804,7 @@ class soap_transport_http extends nusoap_base { while ($chunk_size > 0) { $this->debug("chunkstart: $chunkstart chunk_size: $chunk_size"); $chunkend = strpos( $buffer, $lb, $chunkstart + $chunk_size); - + // Just in case we got a broken connection if ($chunkend == FALSE) { $chunk = substr($buffer,$chunkstart); @@ -2810,7 +2813,7 @@ class soap_transport_http extends nusoap_base { $length += strlen($chunk); break; } - + // read chunk-data and CRLF $chunk = substr($buffer,$chunkstart,$chunkend-$chunkstart); // append chunk-data to entity-body @@ -2819,7 +2822,7 @@ class soap_transport_http extends nusoap_base { $length += strlen($chunk); // read chunk-size and CRLF $chunkstart = $chunkend + strlen($lb); - + $chunkend = strpos($buffer, $lb, $chunkstart) + strlen($lb); if ($chunkend == FALSE) { break; //Just in case we got a broken connection @@ -2830,7 +2833,7 @@ class soap_transport_http extends nusoap_base { } return $new; } - + /** * Writes the payload, including HTTP headers, to $this->outgoing_payload. * @@ -2875,7 +2878,7 @@ class soap_transport_http extends nusoap_base { // header/body separator $this->outgoing_payload .= "\r\n"; - + // add data $this->outgoing_payload .= $data; } @@ -2947,7 +2950,7 @@ class soap_transport_http extends nusoap_base { */ function getResponse(){ $this->incoming_payload = ''; - + if ($this->io_method() == 'socket') { // loop until headers have been retrieved $data = ''; @@ -3018,7 +3021,7 @@ class soap_transport_http extends nusoap_base { $this->incoming_headers[$header_name] .= $lb . ' ' . $header_line; } } - + // loop until msg has been received if (isset($this->incoming_headers['transfer-encoding']) && strtolower($this->incoming_headers['transfer-encoding']) == 'chunked') { $content_length = 2147483647; // ignore any content-length header @@ -3084,22 +3087,22 @@ class soap_transport_http extends nusoap_base { $this->debug('read body of length ' . strlen($data)); $this->incoming_payload .= $data; $this->debug('received a total of '.strlen($this->incoming_payload).' bytes of data from server'); - + // close filepointer if( - (isset($this->incoming_headers['connection']) && strtolower($this->incoming_headers['connection']) == 'close') || + (isset($this->incoming_headers['connection']) && strtolower($this->incoming_headers['connection']) == 'close') || (! $this->persistentConnection) || feof($this->fp)){ fclose($this->fp); $this->fp = false; $this->debug('closed socket'); } - + // connection was closed unexpectedly if($this->incoming_payload == ''){ $this->setError('no response from server'); return false; } - + // decode transfer-encoding // if(isset($this->incoming_headers['transfer-encoding']) && strtolower($this->incoming_headers['transfer-encoding']) == 'chunked'){ // if(!$data = $this->decodeChunked($data, $lb)){ @@ -3110,7 +3113,7 @@ class soap_transport_http extends nusoap_base { // set decoded payload // $this->incoming_payload = $header_data.$lb.$lb.$data; // } - + } else if ($this->io_method() == 'curl') { // send and receive $this->debug('send and receive with cURL'); @@ -3136,7 +3139,7 @@ class soap_transport_http extends nusoap_base { // close curl $this->debug('No cURL error, closing cURL'); curl_close($this->ch); - + // try removing skippable headers $savedata = $data; while ($this->isSkippableCurlHeader($data)) { @@ -3159,7 +3162,7 @@ class soap_transport_http extends nusoap_base { } } } - + // separate content from HTTP headers if ($pos = strpos($data,"\r\n\r\n")) { $lb = "\r\n"; @@ -3219,7 +3222,7 @@ class soap_transport_http extends nusoap_base { $this->debug('Server wants digest authentication'); // remove "Digest " from our elements $digestString = str_replace('Digest ', '', $this->incoming_headers['www-authenticate']); - + // parse elements into array $digestElements = explode(',', $digestString); foreach ($digestElements as $val) { @@ -3238,7 +3241,7 @@ class soap_transport_http extends nusoap_base { $this->setError('HTTP authentication failed'); return false; } - + if ( ($http_status >= 300 && $http_status <= 307) || ($http_status >= 400 && $http_status <= 417) || @@ -3306,13 +3309,13 @@ class soap_transport_http extends nusoap_base { } else { $this->debug('No Content-Encoding header'); } - + if(strlen($data) == 0){ $this->debug('no data after headers!'); $this->setError('no data present after HTTP headers'); return false; } - + return $data; } @@ -3384,7 +3387,7 @@ class soap_transport_http extends nusoap_base { } else { $path = '/'; } - + $cookie_param = ';secure;'; if (strpos($cookie_str, $cookie_param) !== FALSE) { $secure = true; @@ -3403,12 +3406,12 @@ class soap_transport_http extends nusoap_base { 'path' => $path, 'expires' => $expires, 'secure' => $secure - ); + ); return $cookie; } return false; } - + /** * sort out cookies for the current request * @@ -4235,7 +4238,7 @@ class nusoap_server extends nusoap_base { //begin code to compress payload - by John // NOTE: there is no way to know whether the Web server will also compress // this data. - if (strlen($payload) > 1024 && isset($this->headers) && isset($this->headers['accept-encoding'])) { + if (strlen($payload) > 1024 && isset($this->headers) && isset($this->headers['accept-encoding'])) { if (strstr($this->headers['accept-encoding'], 'gzip')) { if (function_exists('gzencode')) { if (isset($this->debug_flag) && $this->debug_flag) { @@ -4362,7 +4365,7 @@ class nusoap_server extends nusoap_base { function getHTTPBody($soapmsg) { return $soapmsg; } - + /** * gets the HTTP content type for the current response. * @@ -4374,7 +4377,7 @@ class nusoap_server extends nusoap_base { function getHTTPContentType() { return 'text/xml'; } - + /** * gets the HTTP content type charset for the current response. * returns false for non-text content types. @@ -4533,7 +4536,7 @@ class nusoap_server extends nusoap_base { if(false == $namespace) { $namespace = "http://$SERVER_NAME/soap/$serviceName"; } - + if(false == $endpoint) { if ($HTTPS == '1' || $HTTPS == 'on') { $SCHEME = 'https'; @@ -4542,11 +4545,11 @@ class nusoap_server extends nusoap_base { } $endpoint = "$SCHEME://$SERVER_NAME$SERVER_PORT$SCRIPT_NAME"; } - + if(false == $schemaTargetNamespace) { $schemaTargetNamespace = $namespace; } - + $this->wsdl = new wsdl; $this->wsdl->serviceName = $serviceName; $this->wsdl->endpoint = $endpoint; @@ -4588,15 +4591,15 @@ class soap_server extends nusoap_server { /** * parses a WSDL file, allows access to it's data, other utility methods. * also builds WSDL structures programmatically. -* +* * @author Dietrich Ayala * @author Scott Nichol * @version $Id$ -* @access public +* @access public */ class wsdl extends nusoap_base { // URL or filename of the root of this WSDL - var $wsdl; + var $wsdl; // define internal arrays of bindings, ports, operations, messages, etc. var $schemas = array(); var $currentSchema; @@ -4614,9 +4617,9 @@ class wsdl extends nusoap_base { var $opData = array(); var $status = ''; var $documentation = false; - var $endpoint = ''; + var $endpoint = ''; // array of wsdl docs to import - var $import = array(); + var $import = array(); // parser vars var $parser; var $position = 0; @@ -4639,7 +4642,7 @@ class wsdl extends nusoap_base { /** * constructor - * + * * @param string $wsdl WSDL document URL * @param string $proxyhost * @param string $proxyport @@ -4649,7 +4652,7 @@ class wsdl extends nusoap_base { * @param integer $response_timeout set the response timeout * @param array $curl_options user-specified cURL options * @param boolean $use_curl try to use cURL - * @access public + * @access public */ function wsdl($wsdl = '',$proxyhost=false,$proxyport=false,$proxyusername=false,$proxypassword=false,$timeout=0,$response_timeout=30,$curl_options=null,$use_curl=false){ parent::nusoap_base(); @@ -4709,7 +4712,7 @@ class wsdl extends nusoap_base { } } } - } + } } } // WSDL imports @@ -4735,18 +4738,18 @@ class wsdl extends nusoap_base { } } } - } + } } // add new data to operation data foreach($this->bindings as $binding => $bindingData) { if (isset($bindingData['operations']) && is_array($bindingData['operations'])) { foreach($bindingData['operations'] as $operation => $data) { $this->debug('post-parse data gathering for ' . $operation); - $this->bindings[$binding]['operations'][$operation]['input'] = - isset($this->bindings[$binding]['operations'][$operation]['input']) ? + $this->bindings[$binding]['operations'][$operation]['input'] = + isset($this->bindings[$binding]['operations'][$operation]['input']) ? array_merge($this->bindings[$binding]['operations'][$operation]['input'], $this->portTypes[ $bindingData['portType'] ][$operation]['input']) : $this->portTypes[ $bindingData['portType'] ][$operation]['input']; - $this->bindings[$binding]['operations'][$operation]['output'] = + $this->bindings[$binding]['operations'][$operation]['output'] = isset($this->bindings[$binding]['operations'][$operation]['output']) ? array_merge($this->bindings[$binding]['operations'][$operation]['output'], $this->portTypes[ $bindingData['portType'] ][$operation]['output']) : $this->portTypes[ $bindingData['portType'] ][$operation]['output']; @@ -4763,16 +4766,16 @@ class wsdl extends nusoap_base { $this->bindings[$binding]['operations'][$operation]['transport'] = isset($bindingData['transport']) ? $bindingData['transport'] : ''; $this->bindings[$binding]['operations'][$operation]['documentation'] = isset($this->portTypes[ $bindingData['portType'] ][$operation]['documentation']) ? $this->portTypes[ $bindingData['portType'] ][$operation]['documentation'] : ''; $this->bindings[$binding]['operations'][$operation]['endpoint'] = isset($bindingData['endpoint']) ? $bindingData['endpoint'] : ''; - } - } + } + } } } /** * parses the wsdl document - * + * * @param string $wsdl path or URL - * @access private + * @access private */ function parseWSDL($wsdl = '') { $this->debug("parse WSDL at path=$wsdl"); @@ -4782,7 +4785,7 @@ class wsdl extends nusoap_base { $this->setError('no wsdl passed to parseWSDL()!!'); return false; } - + // parse $wsdl for url format $wsdl_props = parse_url($wsdl); @@ -4825,24 +4828,24 @@ class wsdl extends nusoap_base { $wsdl_string = ''; while ($data = fread($fp, 32768)) { $wsdl_string .= $data; - } + } fclose($fp); } else { $errstr = "Bad path to WSDL file $path"; $this->debug($errstr); $this->setError($errstr); return false; - } + } } $this->debug('Parse WSDL'); // end new code added // Create an XML parser. - $this->parser = xml_parser_create(); + $this->parser = xml_parser_create(); // Set the options for parsing the XML data. // xml_parser_set_option($parser, XML_OPTION_SKIP_WHITE, 1); - xml_parser_set_option($this->parser, XML_OPTION_CASE_FOLDING, 0); + xml_parser_set_option($this->parser, XML_OPTION_CASE_FOLDING, 0); // Set the object for the parser. - xml_set_object($this->parser, $this); + xml_set_object($this->parser, $this); // Set the element handlers for the parser. xml_set_element_handler($this->parser, 'start_element', 'end_element'); xml_set_character_data_handler($this->parser, 'character_data'); @@ -4859,7 +4862,7 @@ class wsdl extends nusoap_base { $this->debug("XML payload:\n" . $wsdl_string); $this->setError($errstr); return false; - } + } // free the parser xml_parser_free($this->parser); $this->debug('Parsing WSDL done'); @@ -4868,15 +4871,15 @@ class wsdl extends nusoap_base { return false; } return true; - } + } /** * start-element handler - * + * * @param string $parser XML parser object * @param string $name element name * @param string $attrs associative array of attributes - * @access private + * @access private */ function start_element($parser, $name, $attrs) { @@ -4895,10 +4898,10 @@ class wsdl extends nusoap_base { } else { // position in the total number of elements, starting from 0 $pos = $this->position++; - $depth = $this->depth++; + $depth = $this->depth++; // set self as current value for this depth $this->depth_array[$depth] = $pos; - $this->message[$pos] = array('cdata' => ''); + $this->message[$pos] = array('cdata' => ''); // process attributes if (count($attrs) > 0) { // register namespace declarations @@ -4908,11 +4911,11 @@ class wsdl extends nusoap_base { $this->namespaces[$ns_prefix] = $v; } else { $this->namespaces['ns' . (count($this->namespaces) + 1)] = $v; - } + } if ($v == 'http://www.w3.org/2001/XMLSchema' || $v == 'http://www.w3.org/1999/XMLSchema' || $v == 'http://www.w3.org/2000/10/XMLSchema') { $this->XMLSchemaVersion = $v; $this->namespaces['xsi'] = $v . '-instance'; - } + } } } // expand each attribute prefix to its namespace @@ -4920,22 +4923,22 @@ class wsdl extends nusoap_base { $k = strpos($k, ':') ? $this->expandQname($k) : $k; if ($k != 'location' && $k != 'soapAction' && $k != 'namespace') { $v = strpos($v, ':') ? $this->expandQname($v) : $v; - } + } $eAttrs[$k] = $v; - } + } $attrs = $eAttrs; } else { $attrs = array(); - } + } // get element prefix, namespace and name if (preg_match('/:/', $name)) { // get ns prefix - $prefix = substr($name, 0, strpos($name, ':')); + $prefix = substr($name, 0, strpos($name, ':')); // get ns - $namespace = isset($this->namespaces[$prefix]) ? $this->namespaces[$prefix] : ''; + $namespace = isset($this->namespaces[$prefix]) ? $this->namespaces[$prefix] : ''; // get unqualified name $name = substr(strstr($name, ':'), 1); - } + } // process attributes, expanding any prefixes to namespaces // find status, register data switch ($this->status) { @@ -4944,12 +4947,12 @@ class wsdl extends nusoap_base { if (isset($attrs['type'])) { $this->debug("msg " . $this->currentMessage . ": found part (with type) $attrs[name]: " . implode(',', $attrs)); $this->messages[$this->currentMessage][$attrs['name']] = $attrs['type']; - } + } if (isset($attrs['element'])) { $this->debug("msg " . $this->currentMessage . ": found part (with element) $attrs[name]: " . implode(',', $attrs)); $this->messages[$this->currentMessage][$attrs['name']] = $attrs['element'] . '^'; - } - } + } + } break; case 'portType': switch ($name) { @@ -4958,25 +4961,25 @@ class wsdl extends nusoap_base { $this->debug("portType $this->currentPortType operation: $this->currentPortOperation"); if (isset($attrs['parameterOrder'])) { $this->portTypes[$this->currentPortType][$attrs['name']]['parameterOrder'] = $attrs['parameterOrder']; - } + } break; case 'documentation': $this->documentation = true; - break; + break; // merge input/output data default: $m = isset($attrs['message']) ? $this->getLocalPart($attrs['message']) : ''; $this->portTypes[$this->currentPortType][$this->currentPortOperation][$name]['message'] = $m; break; - } + } break; case 'binding': switch ($name) { - case 'binding': + case 'binding': // get ns prefix if (isset($attrs['style'])) { $this->bindings[$this->currentBinding]['prefix'] = $prefix; - } + } $this->bindings[$this->currentBinding] = array_merge($this->bindings[$this->currentBinding], $attrs); break; case 'header': @@ -4985,17 +4988,17 @@ class wsdl extends nusoap_base { case 'operation': if (isset($attrs['soapAction'])) { $this->bindings[$this->currentBinding]['operations'][$this->currentOperation]['soapAction'] = $attrs['soapAction']; - } + } if (isset($attrs['style'])) { $this->bindings[$this->currentBinding]['operations'][$this->currentOperation]['style'] = $attrs['style']; - } + } if (isset($attrs['name'])) { $this->currentOperation = $attrs['name']; $this->debug("current binding operation: $this->currentOperation"); $this->bindings[$this->currentBinding]['operations'][$this->currentOperation]['name'] = $attrs['name']; $this->bindings[$this->currentBinding]['operations'][$this->currentOperation]['binding'] = $this->currentBinding; $this->bindings[$this->currentBinding]['operations'][$this->currentOperation]['endpoint'] = isset($this->bindings[$this->currentBinding]['endpoint']) ? $this->bindings[$this->currentBinding]['endpoint'] : ''; - } + } break; case 'input': $this->opStatus = 'input'; @@ -5008,9 +5011,9 @@ class wsdl extends nusoap_base { $this->bindings[$this->currentBinding]['operations'][$this->currentOperation][$this->opStatus] = array_merge($this->bindings[$this->currentBinding]['operations'][$this->currentOperation][$this->opStatus], $attrs); } else { $this->bindings[$this->currentBinding]['operations'][$this->currentOperation][$this->opStatus] = $attrs; - } + } break; - } + } break; case 'service': switch ($name) { @@ -5018,7 +5021,7 @@ class wsdl extends nusoap_base { $this->currentPort = $attrs['name']; $this->debug('current port: ' . $this->currentPort); $this->ports[$this->currentPort]['binding'] = $this->getLocalPart($attrs['binding']); - + break; case 'address': $this->ports[$this->currentPort]['location'] = $attrs['location']; @@ -5026,9 +5029,9 @@ class wsdl extends nusoap_base { $this->bindings[ $this->ports[$this->currentPort]['binding'] ]['bindingType'] = $namespace; $this->bindings[ $this->ports[$this->currentPort]['binding'] ]['endpoint'] = $attrs['location']; break; - } + } break; - } + } // set status switch ($name) { case 'import': @@ -5064,11 +5067,11 @@ class wsdl extends nusoap_base { $this->currentBinding = $this->getLocalPart($attrs['name']); } else { $this->currentBinding = $attrs['name']; - } + } $this->status = 'binding'; $this->bindings[$this->currentBinding]['portType'] = $this->getLocalPart($attrs['type']); $this->debug("current binding: $this->currentBinding of portType: " . $attrs['type']); - } + } break; case 'service': $this->serviceName = $attrs['name']; @@ -5078,20 +5081,20 @@ class wsdl extends nusoap_base { case 'definitions': foreach ($attrs as $name => $value) { $this->wsdl_info[$name] = $value; - } + } break; - } - } - } + } + } + } /** * end-element handler - * + * * @param string $parser XML parser object * @param string $name element name - * @access private + * @access private */ - function end_element($parser, $name){ + function end_element($parser, $name){ // unset schema status if (/*preg_match('/types$/', $name) ||*/ preg_match('/schema$/', $name)) { $this->status = ""; @@ -5099,38 +5102,38 @@ class wsdl extends nusoap_base { $this->currentSchema->clearDebug(); $this->schemas[$this->currentSchema->schemaTargetNamespace][] = $this->currentSchema; $this->debug('Parsing WSDL schema done'); - } + } if ($this->status == 'schema') { $this->currentSchema->schemaEndElement($parser, $name); } else { // bring depth down a notch $this->depth--; - } + } // end documentation if ($this->documentation) { //TODO: track the node to which documentation should be assigned; it can be a part, message, etc. //$this->portTypes[$this->currentPortType][$this->currentPortOperation]['documentation'] = $this->documentation; $this->documentation = false; - } - } + } + } /** * element content handler - * + * * @param string $parser XML parser object * @param string $data element content - * @access private + * @access private */ function character_data($parser, $data) { $pos = isset($this->depth_array[$this->depth]) ? $this->depth_array[$this->depth] : 0; if (isset($this->message[$pos]['cdata'])) { $this->message[$pos]['cdata'] .= $data; - } + } if ($this->documentation) { $this->documentation .= $data; - } - } + } + } /** * if authenticating, set user credentials here @@ -5149,21 +5152,21 @@ class wsdl extends nusoap_base { $this->authtype = $authtype; $this->certRequest = $certRequest; } - + function getBindingData($binding) { if (is_array($this->bindings[$binding])) { return $this->bindings[$binding]; - } + } } - + /** * returns an assoc array of operation names => operation data - * + * * @param string $portName WSDL port name * @param string $bindingType eg: soap, smtp, dime (only soap and soap12 are currently supported) - * @return array - * @access public + * @return array + * @access public */ function getOperations($portName = '', $bindingType = 'soap') { $ops = array(); @@ -5195,15 +5198,15 @@ class wsdl extends nusoap_base { $this->debug("getOperations found no operations for port '$portName' bindingType $bindingType"); } return $ops; - } - + } + /** * returns an associative array of data necessary for calling an operation - * + * * @param string $operation name of operation * @param string $bindingType type of binding eg: soap, soap12 - * @return array - * @access public + * @return array + * @access public */ function getOperationData($operation, $bindingType = 'soap') { @@ -5223,19 +5226,19 @@ class wsdl extends nusoap_base { if ($operation == $bOperation) { $opData = $this->bindings[ $portData['binding'] ]['operations'][$operation]; return $opData; - } - } + } + } } - } + } } - + /** * returns an associative array of data necessary for calling an operation - * + * * @param string $soapAction soapAction for operation * @param string $bindingType type of binding eg: soap, soap12 - * @return array - * @access public + * @return array + * @access public */ function getOperationDataForSoapAction($soapAction, $bindingType = 'soap') { if ($bindingType == 'soap') { @@ -5251,12 +5254,12 @@ class wsdl extends nusoap_base { foreach ($this->bindings[ $portData['binding'] ]['operations'] as $bOperation => $opData) { if ($opData['soapAction'] == $soapAction) { return $opData; - } - } + } + } } - } + } } - + /** * returns an array of information about a given type * returns false if no type exists by the given name @@ -5467,7 +5470,7 @@ class wsdl extends nusoap_base { * * @param mixed $debug whether to put debug=1 in endpoint URL * @return string serialization of WSDL - * @access public + * @access public */ function serialize($debug = 0) { @@ -5475,15 +5478,15 @@ class wsdl extends nusoap_base { $xml .= "\nnamespaces as $k => $v) { $xml .= " xmlns:$k=\"$v\""; - } + } // 10.9.02 - add poulter fix for wsdl and tns declarations if (isset($this->namespaces['wsdl'])) { $xml .= " xmlns=\"" . $this->namespaces['wsdl'] . "\""; - } + } if (isset($this->namespaces['tns'])) { $xml .= " targetNamespace=\"" . $this->namespaces['tns'] . "\""; - } - $xml .= '>'; + } + $xml .= '>'; // imports if (sizeof($this->import) > 0) { foreach($this->import as $ns => $list) { @@ -5494,8 +5497,8 @@ class wsdl extends nusoap_base { $xml .= ''; } } - } - } + } + } // types if (count($this->schemas)>=1) { $xml .= "\n\n"; @@ -5505,7 +5508,7 @@ class wsdl extends nusoap_base { } } $xml .= ''; - } + } // messages if (count($this->messages) >= 1) { foreach($this->messages as $msgName => $msgParts) { @@ -5522,11 +5525,11 @@ class wsdl extends nusoap_base { foreach($this->typemap as $ns => $types) { if (isset($types[$partType])) { $typePrefix = $this->getPrefixFromNamespace($ns); - } - } + } + } if (!isset($typePrefix)) { die("$partType has no namespace!"); - } + } } $ns = $this->getNamespaceFromPrefix($typePrefix); $localPart = $this->getLocalPart($partType); @@ -5543,8 +5546,8 @@ class wsdl extends nusoap_base { } } $xml .= ''; - } - } + } + } // bindings & porttypes if (count($this->bindings) >= 1) { $binding_xml = ''; @@ -5572,7 +5575,7 @@ class wsdl extends nusoap_base { $portType_xml .= "\n" . ' ' . htmlspecialchars($opParts['documentation']) . ''; @@ -5580,12 +5583,12 @@ class wsdl extends nusoap_base { $portType_xml .= "\n" . ' '; $portType_xml .= "\n" . ' '; $portType_xml .= "\n" . ' '; - } + } $portType_xml .= "\n" . ''; $binding_xml .= "\n" . ''; - } + } $xml .= $portType_xml . $binding_xml; - } + } // services $xml .= "\nserviceName . '">'; if (count($this->ports) >= 1) { @@ -5593,11 +5596,11 @@ class wsdl extends nusoap_base { $xml .= "\n" . ' '; $xml .= "\n" . ' '; $xml .= "\n" . ' '; - } - } + } + } $xml .= "\n" . ''; return $xml . "\n"; - } + } /** * determine whether a set of parameters are unwrapped @@ -5642,7 +5645,7 @@ class wsdl extends nusoap_base { $phpType = $typeDef['phpType']; $arrayType = (isset($typeDef['arrayType']) ? $typeDef['arrayType'] : ''); $this->debug("in parametersMatchWrapped: uqType: $uqType, ns: $ns, phptype: $phpType, arrayType: $arrayType"); - + // we expect a complexType or element of complexType if ($phpType != 'struct') { $this->debug("in parametersMatchWrapped: not a struct"); @@ -5683,7 +5686,7 @@ class wsdl extends nusoap_base { * TODO * - multi-ref serialization * - validate PHP values against type definitions, return errors if invalid - * + * * @param string $operation operation name * @param string $direction (input|output) * @param mixed $parameters parameter value(s) @@ -5694,12 +5697,12 @@ class wsdl extends nusoap_base { function serializeRPCParameters($operation, $direction, $parameters, $bindingType = 'soap') { $this->debug("in serializeRPCParameters: operation=$operation, direction=$direction, XMLSchemaVersion=$this->XMLSchemaVersion, bindingType=$bindingType"); $this->appendDebug('parameters=' . $this->varDump($parameters)); - + if ($direction != 'input' && $direction != 'output') { $this->debug('The value of the \$direction argument needs to be either "input" or "output"'); $this->setError('The value of the \$direction argument needs to be either "input" or "output"'); return false; - } + } if (!$opData = $this->getOperationData($operation, $bindingType)) { $this->debug('Unable to retrieve WSDL data for operation: ' . $operation . ' bindingType: ' . $bindingType); $this->setError('Unable to retrieve WSDL data for operation: ' . $operation . ' bindingType: ' . $bindingType); @@ -5750,7 +5753,7 @@ class wsdl extends nusoap_base { $this->debug("serializing part $name of type $type"); // Track encoding style if (isset($opData[$direction]['encodingStyle']) && $encodingStyle != $opData[$direction]['encodingStyle']) { - $encodingStyle = $opData[$direction]['encodingStyle']; + $encodingStyle = $opData[$direction]['encodingStyle']; $enc_style = $encodingStyle; } else { $enc_style = false; @@ -5776,15 +5779,15 @@ class wsdl extends nusoap_base { } $this->debug("serializeRPCParameters returning: $xml"); return $xml; - } - + } + /** * serialize a PHP value according to a WSDL message definition - * + * * TODO * - multi-ref serialization * - validate PHP values against type definitions, return errors if invalid - * + * * @param string $operation operation name * @param string $direction (input|output) * @param mixed $parameters parameter value(s) @@ -5794,14 +5797,14 @@ class wsdl extends nusoap_base { */ function serializeParameters($operation, $direction, $parameters) { - $this->debug("in serializeParameters: operation=$operation, direction=$direction, XMLSchemaVersion=$this->XMLSchemaVersion"); + $this->debug("in serializeParameters: operation=$operation, direction=$direction, XMLSchemaVersion=$this->XMLSchemaVersion"); $this->appendDebug('parameters=' . $this->varDump($parameters)); - + if ($direction != 'input' && $direction != 'output') { $this->debug('The value of the \$direction argument needs to be either "input" or "output"'); $this->setError('The value of the \$direction argument needs to be either "input" or "output"'); return false; - } + } if (!$opData = $this->getOperationData($operation)) { $this->debug('Unable to retrieve WSDL data for operation: ' . $operation); $this->setError('Unable to retrieve WSDL data for operation: ' . $operation); @@ -5809,18 +5812,18 @@ class wsdl extends nusoap_base { } $this->debug('opData:'); $this->appendDebug($this->varDump($opData)); - + // Get encoding style for output and set to current $encodingStyle = 'http://schemas.xmlsoap.org/soap/encoding/'; if(($direction == 'input') && isset($opData['output']['encodingStyle']) && ($opData['output']['encodingStyle'] != $encodingStyle)) { $encodingStyle = $opData['output']['encodingStyle']; $enc_style = $encodingStyle; } - + // set input params $xml = ''; if (isset($opData[$direction]['parts']) && sizeof($opData[$direction]['parts']) > 0) { - + $use = $opData[$direction]['use']; $this->debug("use=$use"); $this->debug('got ' . count($opData[$direction]['parts']) . ' part(s)'); @@ -5831,7 +5834,7 @@ class wsdl extends nusoap_base { $this->debug('serializing part "'.$name.'" of type "'.$type.'"'); // Track encoding style if(isset($opData[$direction]['encodingStyle']) && $encodingStyle != $opData[$direction]['encodingStyle']) { - $encodingStyle = $opData[$direction]['encodingStyle']; + $encodingStyle = $opData[$direction]['encodingStyle']; $enc_style = $encodingStyle; } else { $enc_style = false; @@ -5857,11 +5860,11 @@ class wsdl extends nusoap_base { } $this->debug("serializeParameters returning: $xml"); return $xml; - } - + } + /** * serializes a PHP value according a given type definition - * + * * @param string $name name of value (part or element) * @param string $type XML schema type of value (type or element) * @param mixed $value a native PHP value (parameter value) @@ -5947,7 +5950,7 @@ class wsdl extends nusoap_base { } else { $value = 'true'; } - } + } if ($uqType == 'string' && gettype($value) == 'string') { $value = $this->expandEntities($value); } @@ -6028,7 +6031,7 @@ class wsdl extends nusoap_base { return false; } $phpType = $typeDef['phpType']; - $this->debug("in serializeType: uqType: $uqType, ns: $ns, phptype: $phpType, arrayType: " . (isset($typeDef['arrayType']) ? $typeDef['arrayType'] : '') ); + $this->debug("in serializeType: uqType: $uqType, ns: $ns, phptype: $phpType, arrayType: " . (isset($typeDef['arrayType']) ? $typeDef['arrayType'] : '') ); // if php type == struct, map value to the element names if ($phpType == 'struct') { if (isset($typeDef['typeClass']) && $typeDef['typeClass'] == 'element') { @@ -6120,11 +6123,11 @@ class wsdl extends nusoap_base { foreach($value as $v) { $cols = ',' . sizeof($v); $nv = array_merge($nv, $v); - } + } $value = $nv; } else { $cols = ''; - } + } if (is_array($value) && sizeof($value) >= 1) { $rows = sizeof($value); $contents = ''; @@ -6134,8 +6137,11 @@ class wsdl extends nusoap_base { if (!in_array($typeDef['arrayType'],$this->typemap['http://www.w3.org/2001/XMLSchema'])) { $contents .= $this->serializeType('item', $typeDef['arrayType'], $v, $use); } else { - $contents .= $this->serialize_val($v, 'item', $typeDef['arrayType'], null, $this->XMLSchemaVersion, false, $use); - } + // DOL_CHANGE This is to have tag name with name reported by wsdl and not "item" + //$contents .= $this->serialize_val($v, 'itemzzzz', $typeDef['arrayType'], null, $this->XMLSchemaVersion, false, $use); + $tmp=array_keys($typeDef['elements']); //var_dump($tmp[0]); + $contents .= $this->serialize_val($v, ($tmp[0]?$tmp[0]:'item'), $typeDef['arrayType'], null, $this->XMLSchemaVersion, false, $use); + } } } else { $rows = 0; @@ -6179,7 +6185,7 @@ class wsdl extends nusoap_base { $this->debug("in serializeType: returning: $xml"); return $xml; } - + /** * serializes the attributes for a complexType * @@ -6234,7 +6240,7 @@ class wsdl extends nusoap_base { if ($xname) { $xml .= " $aName=\"" . $this->expandEntities($xvalue[$xname]) . "\""; } - } + } } else { $this->debug("no attributes to serialize for XML Schema type $ns:$uqType"); } @@ -6292,7 +6298,7 @@ class wsdl extends nusoap_base { } // if user took advantage of a minOccurs=0, then only serialize named parameters if (isset($optionals) - && (!isset($xvalue[$eName])) + && (!isset($xvalue[$eName])) && ( (!isset($attrs['nillable'])) || $attrs['nillable'] != 'true') ){ if (isset($attrs['minOccurs']) && $attrs['minOccurs'] <> '0') { @@ -6340,7 +6346,7 @@ class wsdl extends nusoap_base { } } } - } + } } else { $this->debug("no elements to serialize for XML Schema type $ns:$uqType"); } @@ -6376,7 +6382,7 @@ class wsdl extends nusoap_base { } $elements = $eElements; } - + if (count($attrs) > 0) { foreach($attrs as $n => $a){ // expand each attribute @@ -6429,7 +6435,7 @@ class wsdl extends nusoap_base { /** * register an operation with the server - * + * * @param string $name operation (method) name * @param array $in assoc array of input values: key = param name, value = param type * @param array $out assoc array of output values: key = param name, value = param type @@ -6439,7 +6445,7 @@ class wsdl extends nusoap_base { * @param string $use (encoded|literal) optional The use for the parameters (cannot mix right now) * @param string $documentation optional The description to include in the WSDL * @param string $encodingStyle optional (usually 'http://schemas.xmlsoap.org/soap/encoding/' for encoded) - * @access public + * @access public */ function addOperation($name, $in = false, $out = false, $namespace = false, $soapaction = false, $style = 'rpc', $use = 'encoded', $documentation = '', $encodingStyle = ''){ if ($use == 'encoded' && $encodingStyle == '') { @@ -6486,7 +6492,7 @@ class wsdl extends nusoap_base { 'parts' => $out), 'namespace' => $namespace, 'transport' => 'http://schemas.xmlsoap.org/soap/http', - 'documentation' => $documentation); + 'documentation' => $documentation); // add portTypes // add messages if($in) @@ -6514,7 +6520,7 @@ class wsdl extends nusoap_base { $this->messages[$name.'Response']= '0'; } return true; - } + } } ?>body_position) && $pos > $this->body_position){ // deal w/ multirefs @@ -6896,7 +6902,7 @@ class nusoap_parser extends nusoap_base { */ } } - + // for doclit if($this->status == 'header'){ if ($this->root_header != $pos) { @@ -7321,7 +7327,7 @@ class nusoap_client extends nusoap_base { $this->faultstring = ''; $this->faultcode = ''; $this->opData = array(); - + $this->debug("call: operation=$operation, namespace=$namespace, soapAction=$soapAction, rpcParams=$rpcParams, style=$style, use=$use, endpointType=$this->endpointType"); $this->appendDebug('params=' . $this->varDump($params)); $this->appendDebug('headers=' . $this->varDump($headers)); @@ -7392,7 +7398,7 @@ class nusoap_client extends nusoap_base { // no WSDL //$this->namespaces['ns1'] = $namespace; $nsPrefix = 'ns' . rand(1000, 9999); - // serialize + // serialize $payload = ''; if (is_string($params)) { $this->debug("serializing param string for operation $operation"); @@ -7452,7 +7458,7 @@ class nusoap_client extends nusoap_base { $this->return = $return; $this->debug('sent message successfully and got a(n) '.gettype($return)); $this->appendDebug('return=' . $this->varDump($return)); - + // fault? if(is_array($return) && isset($return['faultcode'])){ $this->debug('got fault'); @@ -7621,7 +7627,7 @@ class nusoap_client extends nusoap_base { $this->persistentConnection = $http; } } - + if($err = $http->getError()){ $this->setError('HTTP Error: '.$err); return false; @@ -7785,7 +7791,7 @@ class nusoap_client extends nusoap_base { $this->authtype = $authtype; $this->certRequest = $certRequest; } - + /** * use HTTP encoding * @@ -7796,7 +7802,7 @@ class nusoap_client extends nusoap_base { $this->debug("setHTTPEncoding(\"$enc\")"); $this->http_encoding = $enc; } - + /** * Set whether to try to use cURL connections if possible * @@ -7817,7 +7823,7 @@ class nusoap_client extends nusoap_base { $this->debug("useHTTPPersistentConnection"); $this->persistentConnection = true; } - + /** * gets the default RPC parameter setting. * If true, default is that call params are like RPC even for document style. @@ -7847,7 +7853,7 @@ class nusoap_client extends nusoap_base { function setDefaultRpcParams($rpcParams) { $this->defaultRpcParams = $rpcParams; } - + /** * dynamically creates an instance of a proxy class, * allowing user to directly call methods from wsdl @@ -7977,7 +7983,7 @@ class nusoap_client extends nusoap_base { function getHTTPBody($soapmsg) { return $soapmsg; } - + /** * gets the HTTP content type for the current request. * @@ -7989,7 +7995,7 @@ class nusoap_client extends nusoap_base { function getHTTPContentType() { return 'text/xml'; } - + /** * gets the HTTP content type charset for the current request. * returns false for non-text content types. diff --git a/htdocs/lib/functions.lib.php b/htdocs/lib/functions.lib.php index ad95cf74843..fd8cd251e27 100644 --- a/htdocs/lib/functions.lib.php +++ b/htdocs/lib/functions.lib.php @@ -603,7 +603,8 @@ function dol_print_date($time,$format='',$tzoutput='tzserver',$outputlangs='',$e if ($format == 'dayhourldap') $format='%Y%m%d%H%M%SZ'; if ($format == 'dayhourxcard') $format='%Y%m%dT%H%M%SZ'; if ($format == 'dayxcard') $format='%Y%m%d'; - if ($format == 'dayhourrfc') $format='%Y-%m-%dT%H:%M:%SZ'; // DATE_RFC3339 + if ($format == 'dayrfc') $format='%Y-%m-%d'; // DATE_RFC3339 + if ($format == 'dayhourrfc') $format='%Y-%m-%dT%H:%M:%SZ'; // DATETIME RFC3339 // If date undefined or "", we return "" if (dol_strlen($time) == 0) return ''; // $time=0 allowed (it means 01/01/1970 00:00:00) diff --git a/htdocs/webservices/demo_wsclient_invoice.php b/htdocs/webservices/demo_wsclient_invoice.php index 8c12040a6dd..6cabefd522d 100755 --- a/htdocs/webservices/demo_wsclient_invoice.php +++ b/htdocs/webservices/demo_wsclient_invoice.php @@ -29,7 +29,7 @@ require_once("../master.inc.php"); require_once(NUSOAP_PATH.'/nusoap.php'); // Include SOAP $WS_DOL_URL = DOL_MAIN_URL_ROOT.'/webservices/server_invoice.php'; -//$WS_DOL_URL = 'http://localhost:8080/'; // If not a page, should end with / +//$WS_DOL_URL = 'http://localhost:8080/'; // To test with Soapui mock. If not a page, should end with / $WS_METHOD1 = 'getInvoice'; $WS_METHOD2 = 'getInvoicesForThirdParty'; $ns='http://www.dolibarr.org/ns/'; @@ -58,30 +58,39 @@ $authentication=array( 'password'=>'changeme', 'entity'=>''); -$parameters = array('authentication'=>$authentication,'id'=>1,'ref'=>''); -dol_syslog("Call method ".$WS_METHOD1); -$result1 = $soapclient1->call($WS_METHOD1,$parameters,$ns,''); -if (! $result1) + +// Test url 1 +if ($WS_METHOD1) { - print $soapclient1->error_str; - print "
\n\n"; - print $soapclient1->request; - print "
\n\n"; - print $soapclient1->response; - exit; + $parameters = array('authentication'=>$authentication,'id'=>1,'ref'=>''); + dol_syslog("Call method ".$WS_METHOD1); + $result1 = $soapclient1->call($WS_METHOD1,$parameters,$ns,''); + if (! $result1) + { + print $soapclient1->error_str; + print "
\n\n"; + print $soapclient1->request; + print "
\n\n"; + print $soapclient1->response; + exit; + } } -$parameters = array('authentication'=>$authentication,'idthirdparty'=>'1'); -dol_syslog("Call method ".$WS_METHOD2); -$result2 = $soapclient2->call($WS_METHOD2,$parameters,$ns,''); -if (! $result2) +// Test url 2 +if ($WS_METHOD2) { - print $soapclient2->error_str; - print "
\n\n"; - print $soapclient2->request; - print "
\n\n"; - print $soapclient2->response; - exit; + $parameters = array('authentication'=>$authentication,'idthirdparty'=>'4'); + dol_syslog("Call method ".$WS_METHOD2); + $result2 = $soapclient2->call($WS_METHOD2,$parameters,$ns,''); + if (! $result2) + { + print $soapclient2->error_str; + print "
\n\n"; + print $soapclient2->request; + print "
\n\n"; + print $soapclient2->response; + exit; + } } diff --git a/htdocs/webservices/demo_wsclient_other.php b/htdocs/webservices/demo_wsclient_other.php index 28f60558729..6026a199fc7 100755 --- a/htdocs/webservices/demo_wsclient_other.php +++ b/htdocs/webservices/demo_wsclient_other.php @@ -50,21 +50,27 @@ $authentication=array( 'login'=>'admin', 'password'=>'changeme', 'entity'=>''); -$parameters = array('authentication'=>$authentication); -dol_syslog("Call method ".$WS_METHOD); -$result = $soapclient->call($WS_METHOD,$parameters,$ns,''); -if (! $result) + +// Test URL +if ($WS_METHOD) { - //var_dump($soapclient); - //print_r($soapclient); - print $soapclient->error_str; - print "
\n\n"; - print $soapclient->request; - print "
\n\n"; - print $soapclient->response; - exit; + $parameters = array('authentication'=>$authentication); + dol_syslog("Call method ".$WS_METHOD); + $result = $soapclient->call($WS_METHOD,$parameters,$ns,''); + if (! $result) + { + //var_dump($soapclient); + //print_r($soapclient); + print $soapclient->error_str; + print "
\n\n"; + print $soapclient->request; + print "
\n\n"; + print $soapclient->response; + exit; + } } + /* * View */ diff --git a/htdocs/webservices/demo_wsclient_thirdparty.php b/htdocs/webservices/demo_wsclient_thirdparty.php index 41358055420..d9bc209ce11 100755 --- a/htdocs/webservices/demo_wsclient_thirdparty.php +++ b/htdocs/webservices/demo_wsclient_thirdparty.php @@ -50,19 +50,26 @@ $authentication=array( 'login'=>'admin', 'password'=>'changeme', 'entity'=>''); -$parameters = array('authentication'=>$authentication,'id'=>0,'name'=>'aaa','ref_ext'=>''); -dol_syslog("Call method ".$WS_METHOD); -$result = $soapclient->call($WS_METHOD,$parameters,$ns,''); -if (! $result) + + +// Test URL +if ($WS_METHOD) { - print $soapclient->error_str; - print "
\n\n"; - print $soapclient->request; - print "
\n\n"; - print $soapclient->response; - exit; + $parameters = array('authentication'=>$authentication,'id'=>0,'name'=>'aaa','ref_ext'=>''); + dol_syslog("Call method ".$WS_METHOD); + $result = $soapclient->call($WS_METHOD,$parameters,$ns,''); + if (! $result) + { + print $soapclient->error_str; + print "
\n\n"; + print $soapclient->request; + print "
\n\n"; + print $soapclient->response; + exit; + } } + /* * View */ diff --git a/htdocs/webservices/server_invoice.php b/htdocs/webservices/server_invoice.php index 0bc7e988720..039fb61e755 100755 --- a/htdocs/webservices/server_invoice.php +++ b/htdocs/webservices/server_invoice.php @@ -54,22 +54,23 @@ $server->wsdl->schemaTargetNamespace=$ns; // Define WSDL content $server->wsdl->addComplexType( - 'authentication', - 'complexType', - 'struct', - 'all', - '', - array( - 'dolibarrkey' => array('name'=>'dolibarrkey','type'=>'xsd:string'), - 'sourceapplication' => array('name'=>'sourceapplication','type'=>'xsd:string'), - 'login' => array('name'=>'login','type'=>'xsd:string'), - 'password' => array('name'=>'password','type'=>'xsd:string'), - 'entity' => array('name'=>'entity','type'=>'xsd:string'), - )); + 'authentication', + 'complexType', + 'struct', + 'all', + '', + array( + 'dolibarrkey' => array('name'=>'dolibarrkey','type'=>'xsd:string'), + 'sourceapplication' => array('name'=>'sourceapplication','type'=>'xsd:string'), + 'login' => array('name'=>'login','type'=>'xsd:string'), + 'password' => array('name'=>'password','type'=>'xsd:string'), + 'entity' => array('name'=>'entity','type'=>'xsd:string'), + ) +); $server->wsdl->addComplexType( 'line', - 'element', + 'complexType', 'struct', 'all', '', @@ -104,10 +105,26 @@ $server->wsdl->addComplexType( ), 'tns:line' ); +$server->wsdl->addComplexType( + 'LinesArray2', + 'complexType', + 'array', + 'sequence', + '', + array( + 'line' => array( + 'name' => 'line', + 'type' => 'tns:line', + 'minOccurs' => '0', + 'maxOccurs' => 'unbounded' + ) + ) +); + $server->wsdl->addComplexType( 'invoice', - 'element', // If we put element here instead of complexType to have tag called invoice in getInvoicesForThirdParty we brek getInvoice + 'complexType', 'struct', 'all', '', @@ -130,7 +147,7 @@ $server->wsdl->addComplexType( 'status' => array('name'=>'status','type'=>'xsd:int'), 'close_code' => array('name'=>'close_code','type'=>'xsd:string'), 'close_note' => array('name'=>'close_note','type'=>'xsd:string'), - 'lines' => array('name'=>'lines','type'=>'tns:LinesArray') + 'lines' => array('name'=>'lines','type'=>'tns:LinesArray2') ) ); @@ -146,31 +163,43 @@ $server->wsdl->addComplexType( ), 'tns:invoice' ); - $server->wsdl->addComplexType( - 'invoices', + 'InvoicesArray2', 'complexType', 'array', + 'sequence', '', - 'SOAP-ENC:Array', - array(), array( - array('ref'=>'SOAP-ENC:arrayType','wsdl:arrayType'=>'tns:invoice[]') - ), - 'tns:invoice' + 'invoice' => array( + 'name' => 'invoice', + 'type' => 'tns:invoice', + 'minOccurs' => '0', + 'maxOccurs' => 'unbounded' + ) + ) ); -$server->wsdl->addComplexType( - 'result', - 'complexType', - 'struct', - 'all', - '', - array( - 'result_code' => array('name'=>'result_code','type'=>'xsd:string'), - 'result_label' => array('name'=>'result_label','type'=>'xsd:string'), - )); +$server->wsdl->addComplexType( + 'result', + 'complexType', + 'struct', + 'all', + '', + array( + 'result_code' => array('name'=>'result_code','type'=>'xsd:string'), + 'result_label' => array('name'=>'result_label','type'=>'xsd:string'), + ) +); + + + +// 5 styles: RPC/encoded, RPC/literal, Document/encoded (not WS-I compliant), Document/literal, Document/literal wrapped +// Style merely dictates how to translate a WSDL binding to a SOAP message. Nothing more. You can use either style with any programming model. +// http://www.ibm.com/developerworks/webservices/library/ws-whichwsdl/ +$styledoc='rpc'; // rpc/document (document is an extend into SOAP 1.0 to support unstructured messages) +$styleuse='encoded'; // encoded/literal/literal wrapped +// Better choice is document/literal wrapped but literal wrapped not supported by nusoap. // Register WSDL $server->register('getInvoice', @@ -178,14 +207,33 @@ $server->register('getInvoice', array('authentication'=>'tns:authentication','id'=>'xsd:string','ref'=>'xsd:string','ref_ext'=>'xsd:string'), // Exit values array('result'=>'tns:result','invoice'=>'tns:invoice'), -$ns +$ns, +$ns.'#getInvoice', +$styledoc, +$styleuse, +'WS to get a particular invoice' ); $server->register('getInvoicesForThirdParty', // Entry values array('authentication'=>'tns:authentication','idthirdparty'=>'xsd:string'), // Exit values -array('result'=>'tns:result','invoices'=>'tns:invoices'), -$ns +array('result'=>'tns:result','invoices'=>'tns:InvoicesArray2'), +$ns, +$ns.'#getInvoicesForThirdParty', +$styledoc, +$styleuse, +'WS to get all invoices of a third party' +); +$server->register('createInvoice', +// Entry values +array('authentication'=>'tns:authentication','idthirdparty'=>'xsd:string','invoice'=>'tns:invoice'), +// Exit values +array('result'=>'tns:result','id'=>'xsd:string','ref'=>'xsd:string'), +$ns, +$ns.'#createInvoice', +$styledoc, +$styleuse, +'WS to create an invoice' ); @@ -279,11 +327,23 @@ function getInvoice($authentication,$id='',$ref='',$ref_ext='') 'invoice'=>array( 'id' => $invoice->id, 'ref' => $invoice->ref, - 'ref_ext' => $invoice->ref_ext, - 'status'=>$invoice->statut, - 'fk_user_author' => $invoice->fk_user_author, - 'fk_user_valid' => $invoice->fk_user_valid, - 'lines' => $linesresp + 'ref_ext' => $invoice->ref_ext?$invoice->ref_ext:'', // If not defined, field is not added into soap + 'fk_user_author' => $invoice->user_author?$invoice->user_author:'', + 'fk_user_valid' => $invoice->user_valid?$invoice->user_valid:'', + 'date' => $invoice->date?dol_print_date($invoice->date,'dayrfc'):'', + 'date_creation' => $invoice->date_creation?dol_print_date($invoice->date_creation,'dayhourrfc'):'', + 'date_validation' => $invoice->date_validation?dol_print_date($invoice->date_creation,'dayhourrfc'):'', + 'date_modification' => $invoice->datem?dol_print_date($invoice->datem,'dayhourrfc'):'', + 'type' => $invoice->type, + 'total_net' => $invoice->total_ht, + 'total_vat' => $invoice->total_tva, + 'total' => $invoice->total_ttc, + 'note' => $invoice->note?$invoice->note:'', + 'note_public' => $invoice->note_public?$invoice->note_public:'', + 'status'=> $invoice->statut, + 'close_code' => $invoice->close_code?$invoice->close_code:'', + 'close_note' => $invoice->close_note?$invoice->close_note:'', + 'lines' => $linesresp // 'lines' => array('0'=>array('id'=>222,'type'=>1), // '1'=>array('id'=>333,'type'=>1)) @@ -384,14 +444,24 @@ function getInvoicesForThirdParty($authentication,$idthirdparty) // Now define invoice $linesinvoice[]=array( - 'id'=>$invoice->id, - 'ref'=>$invoice->ref, - 'ref_ext'=>$invoice->ref_ext, - 'type'=>$invoice->type, - 'status'=>$invoice->statut, - 'total_net'=>$invoice->total_ht, - 'total_vat'=>$invoice->total_tva, - 'total'=>$invoice->total_ttc, + 'id' => $invoice->id, + 'ref' => $invoice->ref, + 'ref_ext' => $invoice->ref_ext?$invoice->ref_ext:'', // If not defined, field is not added into soap + 'fk_user_author' => $invoice->user_author?$invoice->user_author:'', + 'fk_user_valid' => $invoice->user_valid?$invoice->user_valid:'', + 'date' => $invoice->date?dol_print_date($invoice->date,'dayrfc'):'', + 'date_creation' => $invoice->date_creation?dol_print_date($invoice->date_creation,'dayhourrfc'):'', + 'date_validation' => $invoice->date_validation?dol_print_date($invoice->date_creation,'dayhourrfc'):'', + 'date_modification' => $invoice->datem?dol_print_date($invoice->datem,'dayhourrfc'):'', + 'type' => $invoice->type, + 'total_net' => $invoice->total_ht, + 'total_vat' => $invoice->total_tva, + 'total' => $invoice->total_ttc, + 'note' => $invoice->note?$invoice->note:'', + 'note_public' => $invoice->note_public?$invoice->note_public:'', + 'status'=> $invoice->statut, + 'close_code' => $invoice->close_code?$invoice->close_code:'', + 'close_note' => $invoice->close_note?$invoice->close_note:'', 'lines' => $linesresp ); @@ -420,6 +490,50 @@ function getInvoicesForThirdParty($authentication,$idthirdparty) } +/** + * Get list of invoices for third party + */ +function createInvoice($authentication,$idthirdparty,$invoice) +{ + global $db,$conf,$langs; + + dol_syslog("Function: createInvoiceForThirdParty login=".$authentication['login']." idthirdparty=".$idthirdparty); + + if ($authentication['entity']) $conf->entity=$authentication['entity']; + + $objectresp=array(); + $errorcode='';$errorlabel=''; + $error=0; + + if (! $error && ($authentication['dolibarrkey'] != $conf->global->WEBSERVICES_KEY)) + { + $error++; + $errorcode='BAD_VALUE_FOR_SECURITY_KEY'; $errorlabel='Value provided into dolibarrkey entry field does not match security key defined in Webservice module setup'; + } + + if (! $error && empty($idthirdparty)) + { + $error++; + $errorcode='BAD_PARAMETERS'; $errorlabel='Parameter id is not provided'; + } + + if (! $error) + { + //var_dump($invoice['ref_ext']); + //var_dump($invoice['lines'][0]['type']); + + + } + + if ($error) + { + $objectresp = array('result'=>array('result_code' => $errorcode, 'result_label' => $errorlabel)); + } + + return $objectresp; +} + + // Return the results. $server->service($HTTP_RAW_POST_DATA); diff --git a/htdocs/webservices/server_other.php b/htdocs/webservices/server_other.php index da37bdd30ac..29544371ef5 100644 --- a/htdocs/webservices/server_other.php +++ b/htdocs/webservices/server_other.php @@ -79,13 +79,25 @@ $server->wsdl->addComplexType( )); +// 5 styles: RPC/encoded, RPC/literal, Document/encoded (not WS-I compliant), Document/literal, Document/literal wrapped +// Style merely dictates how to translate a WSDL binding to a SOAP message. Nothing more. You can use either style with any programming model. +// http://www.ibm.com/developerworks/webservices/library/ws-whichwsdl/ +$styledoc='rpc'; // rpc/document (document is an extend into SOAP 1.0 to support unstructured messages) +$styleuse='encoded'; // encoded/literal/literal wrapped +// Better choice is document/literal wrapped but literal wrapped not supported by nusoap. + // Register WSDL $server->register('getVersions', // Entry values array('authentication'=>'tns:authentication'), // Exit values array('result'=>'tns:result','dolibarr'=>'xsd:string','os'=>'xsd:string','php'=>'xsd:string','webserver'=>'xsd:string'), -$ns); +$ns, +$ns.'#getVersions', +$styledoc, +$styleuse, +'WS to get Versions' +); diff --git a/htdocs/webservices/server_supplier_invoice.php b/htdocs/webservices/server_supplier_invoice.php index a843aee3c56..c0417ac4751 100755 --- a/htdocs/webservices/server_supplier_invoice.php +++ b/htdocs/webservices/server_supplier_invoice.php @@ -174,20 +174,35 @@ $server->wsdl->addComplexType( )); +// 5 styles: RPC/encoded, RPC/literal, Document/encoded (not WS-I compliant), Document/literal, Document/literal wrapped +// Style merely dictates how to translate a WSDL binding to a SOAP message. Nothing more. You can use either style with any programming model. +// http://www.ibm.com/developerworks/webservices/library/ws-whichwsdl/ +$styledoc='rpc'; // rpc/document (document is an extend into SOAP 1.0 to support unstructured messages) +$styleuse='encoded'; // encoded/literal/literal wrapped +// Better choice is document/literal wrapped but literal wrapped not supported by nusoap. + // Register WSDL $server->register('getSupplierInvoice', // Entry values array('authentication'=>'tns:authentication','id'=>'xsd:string','ref'=>'xsd:string','ref_ext'=>'xsd:string'), // Exit values array('result'=>'tns:result','invoice'=>'tns:invoice'), -$ns +$ns, +$ns.'#getSupplierInvoice', +$styledoc, +$styleuse, +'WS to get SupplierInvoice' ); $server->register('getSupplierInvoicesForThirdParty', // Entry values array('authentication'=>'tns:authentication','idthirdparty'=>'xsd:string'), // Exit values array('result'=>'tns:result','invoices'=>'tns:invoices'), -$ns +$ns, +$ns.'#getSupplierInvoicesForThirdParty', +$styledoc, +$styleuse, +'WS to get SupplierInvoicesForThirdParty' ); diff --git a/htdocs/webservices/server_thirdparty.php b/htdocs/webservices/server_thirdparty.php index 496f18ebc9a..c696a403d06 100755 --- a/htdocs/webservices/server_thirdparty.php +++ b/htdocs/webservices/server_thirdparty.php @@ -115,16 +115,28 @@ $server->wsdl->addComplexType( )); +// 5 styles: RPC/encoded, RPC/literal, Document/encoded (not WS-I compliant), Document/literal, Document/literal wrapped +// Style merely dictates how to translate a WSDL binding to a SOAP message. Nothing more. You can use either style with any programming model. +// http://www.ibm.com/developerworks/webservices/library/ws-whichwsdl/ +$styledoc='rpc'; // rpc/document (document is an extend into SOAP 1.0 to support unstructured messages) +$styleuse='encoded'; // encoded/literal/literal wrapped +// Better choice is document/literal wrapped but literal wrapped not supported by nusoap. + // Register WSDL $server->register('getThirdParty', // Entry values array('authentication'=>'tns:authentication','id'=>'xsd:string','ref'=>'xsd:string','ref_ext'=>'xsd:string'), // Exit values array('result'=>'tns:result','thirdparty'=>'tns:thirdparty'), -$ns +$ns, +$ns.'#getVersions', +$styledoc, +$styleuse, +'WS to get Versions' ); + // Full methods code function getThirdParty($authentication,$id='',$ref='',$ref_ext='') { diff --git a/test/soapui/Dolibarr-soapui-project.xml b/test/soapui/Dolibarr-soapui-project.xml index 6306b3dccfa..42e28bc939d 100755 --- a/test/soapui/Dolibarr-soapui-project.xml +++ b/test/soapui/Dolibarr-soapui-project.xml @@ -1,5 +1,5 @@ -file:/home/ldestail/Téléchargements/server_other_ko.xml +http://localhost/dolibarrnew/webservices/server_other.php?wsdl @@ -33,6 +33,7 @@ + WS to get Versions @@ -40,7 +41,7 @@ - + @@ -54,21 +55,7 @@ -]]>http://schemas.xmlsoap.org/wsdl/http://localhost/dolibarrnew/webservices/server_other.phphttps://www.rhumato.eu/webservices/server_other.php<xml-fragment/>UTF-8https://www.rhumato.eu/webservices/server_other.php - - - - - - dolibarrkey - ? - ? - ? - ? - - - -]]>UTF-8http://localhost/dolibarrnew/webservices/server_other.php +]]>http://schemas.xmlsoap.org/wsdl/http://localhost/dolibarrnew/webservices/server_other.php<xml-fragment/>UTF-8http://localhost/dolibarrnew/webservices/server_other.php @@ -78,11 +65,11 @@ ? ? ? - ? + -]]>http://localhost/dolibarrnew/webservices/server_thirdparty.php?wsdl +]]>http://localhost/dolibarrnew/webservices/server_thirdparty.php?wsdl @@ -146,6 +133,7 @@ + WS to get Versions @@ -153,7 +141,7 @@ - + @@ -167,7 +155,7 @@ -]]>http://schemas.xmlsoap.org/wsdl/http://localhost/dolibarrnew/webservices/server_thirdparty.phpUTF-8http://localhost/dolibarrnew/webservices/server_thirdparty.php +]]>http://schemas.xmlsoap.org/wsdl/http://localhost/dolibarrnew/webservices/server_thirdparty.phpUTF-8http://localhost/dolibarrnew/webservices/server_thirdparty.php @@ -184,7 +172,7 @@ ? -]]>http://localhost/dolibarrnew/webservices/server_invoice.php?wsdl +]]>http://localhost/dolibarrnew/webservices/server_invoice.php?wsdl @@ -202,6 +190,7 @@ + @@ -222,6 +211,11 @@ + + + + + @@ -242,7 +236,7 @@ - + @@ -252,12 +246,10 @@ - - - - - - + + + + @@ -275,7 +267,7 @@ - + @@ -283,22 +275,39 @@ - + + + + + + + + + + + + WS to get a particular invoice + WS to get all invoices of a third party + + WS to create an invoice + + + - + @@ -307,7 +316,16 @@ - + + + + + + + + + + @@ -321,24 +339,80 @@ -]]>http://schemas.xmlsoap.org/wsdl/http://localhost/dolibarrnew/webservices/server_invoice.php<xml-fragment/>UTF-8http://localhost/dolibarrnew/webservices/server_invoice.php +]]>http://schemas.xmlsoap.org/wsdl/http://localhost/dolibarrnew/webservices/server_invoice.php<xml-fragment/>UTF-8http://localhost/dolibarrnew/webservices/server_invoice.php - + - dolibarrkey + ? ? admin admin - + 1 + + + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + + + + + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + ? + + + + + +]]><xml-fragment/>UTF-8http://localhost/dolibarrnew/webservices/server_invoice.php + + + + + + ? + ? + admin + admin + + + 1 - ppp + -]]>UTF-8http://localhost/dolibarrnew/webservices/server_invoice.php +]]><xml-fragment/>UTF-8http://localhost/dolibarrnew/webservices/server_invoice.php @@ -346,14 +420,14 @@ ? ? - ? - ? - ? + admin + admin + - ? + 4 -]]>file:/home/ldestail/Téléchargements/server_supplier_invoice.php +]]>http://localhost/dolibarrnew/webservices/server_supplier_invoice.php?wsdl @@ -371,6 +445,7 @@ + @@ -396,12 +471,14 @@ + - + + @@ -456,10 +533,12 @@ + WS to get SupplierInvoice + WS to get SupplierInvoicesForThirdParty @@ -467,7 +546,7 @@ - + @@ -476,7 +555,7 @@ - + @@ -490,35 +569,36 @@ -]]>http://schemas.xmlsoap.org/wsdl/http://localhostdolibarrnew/dolibarrnew/webservices/server_supplier_invoice.php<xml-fragment/>UTF-8http://localhostdolibarrnew/dolibarrnew/webservices/server_supplier_invoice.php +]]>http://schemas.xmlsoap.org/wsdl/http://localhost/dolibarrnew/webservices/server_supplier_invoice.php<xml-fragment/>UTF-8http://localhost/dolibarrnew/webservices/server_supplier_invoice.php - dolibarrkey - DOLISTORE + + ? + ? admin admin - + 1 -]]><xml-fragment/>UTF-8http://localhostdolibarrnew/dolibarrnew/webservices/server_supplier_invoice.php +]]><xml-fragment/>UTF-8http://localhost/dolibarrnew/webservices/server_supplier_invoice.php - - dolibarrkey - DOLISTORE - admin - admin - + + ? + ? + ? + ? + - 3 + 2 -]]> \ No newline at end of file +]]> \ No newline at end of file