QStringList k;
code+="\nstatic public function fromString($txt){\n\t$xml=new DomDocument;\n";
code+="\tif(!$xml->loadXml(trim($txt)))";
- code+="\n\t\tthrow WobXmlException(translate(\""+abstractClassName(cls)+"\",\"Unable to deserialize object of type "+className(cls)+": invalid XML.\"));";
+ code+="\n\t\tthrow new WobXmlException(translate(\""+abstractClassName(cls)+"\",\"Unable to deserialize object of type "+className(cls)+": invalid XML.\"));";
code+="\n\treturn self::fromXml($xml,$xml->documentElement);\n}\n";
code+="static public function fromXml($xml,$elem){\n\t$data=new "+className(cls)+"();\n";
code+="\tself::fromXmlHelper($data,$xml,$elem);\n\treturn $data;\n}\n";
code+="\t$root=$xml->documentElement;\n";
if(woc->messageEncoding()==WocProcessor::Soap12Encoding){
code+="\t$list=$root->getElementsByTagName(\"Body\");\n";
- code+="\tif($list->length<1)throw WobSoapTransactionError(tr(\"SOAP: missing body\").\"soap\");\n";
+ code+="\tif($list->length<1)throw new WobSoapTransactionError(tr(\"SOAP: missing body\").\"soap\");\n";
code+="\t$root=$list->item(0);\n";
code+="\t$list=$root->childNodes;$root=false;\n";
code+="\tforeach($list as $e){\n";
code+="\t\tif($e->nodeType!=XML_ELEMENT_NODE)continue;\n";
code+="\t\tif($e->localName==\"WobRequest-"+trn.name()+"\"){$root=$e;break}\n\t}\n";
- code+="\tif($root===false)throw WobSoapTransactionError(tr(\"SOAP: missing message content\").\"soap\");\n";
+ code+="\tif($root===false)throw new WobSoapTransactionError(tr(\"SOAP: missing message content\").\"soap\");\n";
}
//parse inputs