Skip to content

Instantly share code, notes, and snippets.

@antitoxic
Created April 25, 2012 10:17
Show Gist options
  • Save antitoxic/2488703 to your computer and use it in GitHub Desktop.
Save antitoxic/2488703 to your computer and use it in GitHub Desktop.
Patch for data type schemas which doesn't have targetNamespace attribute
===================================================================
--- nusoap.php (revision )
+++ nusoap.php (revision )
@@ -805,7 +805,7 @@
* @access public
*/
function getPrefix($str){
- if($pos = strrpos($str,':')){
+ if(($pos = strrpos($str,':'))!==false){
// get prefix
return substr($str,0,$pos);
}
@@ -1454,7 +1454,7 @@
$ename = $this->getLocalPart($attrs['ref']);
$ns = $this->getPrefix($attrs['ref']);
if (! $ns) {
- $ns = $this->schemaTargetNamespace;
+ $ns = '';
$this->xdebug("defaulted ref namespace to $ns");
}
$attrs['ref'] = $ns . ':' . $ename;
@@ -5429,7 +5429,7 @@
*/
function getTypeDef($type, $ns) {
$this->debug("in getTypeDef: type=$type, ns=$ns");
- if ((! $ns) && isset($this->namespaces['tns'])) {
+ if ($ns===false && isset($this->namespaces['tns'])) {
$ns = $this->namespaces['tns'];
$this->debug("in getTypeDef: type namespace forced to $ns");
}
@@ -6101,7 +6101,7 @@
}
$xml = '';
- if (strpos($type, ':')) {
+ if (strpos($type, ':')!==false) {
$uqType = substr($type, strrpos($type, ':') + 1);
$ns = substr($type, 0, strrpos($type, ':'));
$this->debug("in serializeType: got a prefixed type: $uqType, $ns");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment