I tried again, this time instead of 'save-as' from the server I ran it against the actual Provisioning.wsdl on SPCE.<div><br></div><div><div>./wsdl2php -s -i /usr/share/perl5/Sipwise/Provisioning/backends/SOAP/Provisioning.wsdl -o /tmp/wsdlclass</div>
<div><br></div><div>PHP Fatal error:  SOAP-ERROR: Parsing WSDL: Couldn't load from '/usr/share/perl5/Sipwise/Provisioning/backends/SOAP/Provisioning.wsdl' : Extra content at the end of the document</div><div> in /home/skyler/wsdl2phpgenerator/src/Generator.php on line 161</div>
<div>PHP Fatal error:  Uncaught exception 'Exception' with message 'Error connecting to to the wsdl. Error: SOAP-ERROR: Parsing WSDL: Couldn't load from '/usr/share/perl5/Sipwise/Provisioning/backends/SOAP/Provisioning.wsdl' : Extra content at the end of the document</div>
<div><span class="Apple-style-span">' in /home/</span>skyler<span class="Apple-style-span">/wsdl2phpgenerator/src/Generator.php:165</span></div><div>Stack trace:</div><div><span class="Apple-style-span">#0 /home/</span>skyler<span class="Apple-style-span">/wsdl2phpgenerator/src/Generator.php(146): Generator->load('/usr/share/perl...')</span></div>
<div><span class="Apple-style-span">#1 /home/</span>skyler<span class="Apple-style-span">/wsdl2phpgenerator/generate.php(184): Generator->generate(Object(Config))</span></div><div><span class="Apple-style-span">#2 /home/</span>skyler<span class="Apple-style-span">/wsdl2phpgenerator/wsdl2php(4): require_once('/home/</span>skyler<span class="Apple-style-span">...')</span></div>
<div>#3 {main}</div><div><span class="Apple-style-span">  thrown in /home/</span>skyler<span class="Apple-style-span">/wsdl2phpgenerator/src/Generator.php on line 165</span></div><div><span class="Apple-style-span"><br></span></div>
<div><br></div><div>Any idea what the 'Extra content at the end of the document' would be?</div><div><br></div><div><br></div><div>Thanks,</div><div>Skyler</div><br><div class="gmail_quote">On Thu, Nov 15, 2012 at 11:16 AM, Skyler <span dir="ltr"><<a href="mailto:skchopperguy@gmail.com" target="_blank">skchopperguy@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<div><br></div><div> I am running into this errors again but now in 2.6, do you have any suggestions? Muchos Gracias Senior!</div>
<div><br></div><div>Here is my process:</div><div><br></div><div>1. Copy local wsdl to my directory</div>
<div>2. sudo ./wsdl2php -i Provisioning.wsdl -o /outputdirectory/ -s</div><div><br></div><div>This results in this error which we know about: PHP Fatal error:  SOAP-ERROR: Parsing Schema: unexpected <documentation> in complexType</div>

<div><br></div><div>So I perform the removal of <documentation> tags as it did work perfectly with 2.5</div><div><br></div><div>1. sudo perl -i -0777 -ple's/\s*<documentation>.+?<\/documentation>//sg' Provisioning.wsdl</div>

<div>2. sudo ./wsdl2php -i Provisioning.wsdl -o /outputdirectory/ -s</div><div><br></div><div>This results now in a new error for 2.6 </div><div><br></div><div><div>PHP Fatal error:  Uncaught exception 'Exception' with message 'No value supplied' in /home/skyler/wsdl2phpgenerator/lib/phpSource/PhpClass.php:203</div>

<div>Stack trace:</div><div><span>#0 /home/</span>skyler<span>/wsdl2phpgenerator/src/Enum.php(73): PhpClass->addConstant('', 'a')</span></div><div><span>#1 /home/</span>skyler<span>/wsdl2phpgenerator/src/Type.php(95): Enum->generateClass()</span></div>

<div><span>#2 /home/</span>skyler<span>/wsdl2phpgenerator/src/Generator.php(334): Type->getClass()</span></div><div><span>#3 /home/</span>skyler<span>/wsdl2phpgenerator/src/Generator.php(148): Generator->savePhp()</span></div>

<div><span>#4 /home/</span>skyler<span>/wsdl2phpgenerator/generate.php(184): Generator->generate(Object(Config))</span></div><div><span>#5 /home/</span>skyler<span>/wsdl2phpgenerator/wsdl2php(4): require_once('/home/</span>skyler<span>...')</span></div>

<div>#6 {main}</div><div><span>  thrown in /home/</span>skyler<span>/wsdl2phpgenerator/lib/phpSource/PhpClass.php on line 203</span></div></div><div><br></div><div>So here is the contents of that PhpClass.php:</div>
<div><br></div><div><div>192   /**</div><div>193    * Adds a constant to the class. If no name is supplied and the value is a string the value is used as name otherwise exception is raised</div><div>194    *</div><div>195    * @param mixed $value</div>

<div>196    * @param string $name</div><div>197    * @throws Exception</div><div>198    */</div><div>199   public function addConstant($value, $name = '')</div><div>200   {</div><div>201     if (strlen($value) == 0)</div>

<div>202     {</div><div>203       throw new Exception('No value supplied');</div><div>204     }</div><div>205</div><div>206     // If no name is supplied use the value as name</div><div>207     if (strlen($name) == 0)</div>

<div>208     {</div><div>209       if (is_string($value))</div><div>210       {</div><div>211         $name = $value;</div><div>212       }</div><div>213       else</div><div>214       {</div><div>215         throw new Exception('No name supplied');</div>

<div>216       }</div><div>217     }</div><div>218</div><div>219     if (array_key_exists($name, $this->constants))</div><div>220     {</div><div>221       throw new Exception('A constant of the name ('.$name.') does already exist.');</div>

<div>222     }</div><div>223</div><div>224     $this->constants[$name] = $value;</div><div>225   }</div></div><div><br></div><div><br><br><div class="gmail_quote"><div class="im">On Sat, Jun 30, 2012 at 5:35 AM, Daniel Tiefnig <span dir="ltr"><<a href="mailto:dtiefnig@sipwise.com" target="_blank">dtiefnig@sipwise.com</a>></span> wrote:<br>

</div><div><div class="h5"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 06/30/2012 03:34 AM, Skyler wrote:<br>
> Hi,<br>
<br>
Hej!<br>
<div><br>
> Google indicates that the <document> error is because the<br>
> Provisioning.wsdl is built from wsdl-viewer possibly<br>
> (<a href="http://tomi.vanek.sk/index.php?page=wsdl-viewer" target="_blank">http://tomi.vanek.sk/index.php?page=wsdl-viewer</a>). So, the <xsd:tag><br>
> is not present in Provisioning.wsdl for this generator to find.<br>
<br>
</div>The error is IMHO caused by a bug in the PHP5 WSDL implementation. The<br>
<documentation> tags should be fine according to the WSDL specification:<br>
<a href="http://www.w3.org/TR/wsdl#_documentation" target="_blank">http://www.w3.org/TR/wsdl#_documentation</a><br>
<br>
A simple solution, as you're saving the WSDL to a local file anyway<br>
would be to strip the documentation elements from the file:<br>
<br>
perl -i -0777 -ple's/\s*<documentation>.+?<\/documentation>//sg'<br>
Provisioning.wsdl<br>
<br>
br,<br>
daniel<br>
<div><div><br>
_______________________________________________<br>
Spce-user mailing list<br>
<a href="mailto:Spce-user@lists.sipwise.com" target="_blank">Spce-user@lists.sipwise.com</a><br>
<a href="http://lists.sipwise.com/listinfo/spce-user" target="_blank">http://lists.sipwise.com/listinfo/spce-user</a><br>
</div></div></blockquote></div></div></div><br></div>
</blockquote></div><br></div>