[Spce-user] SoapFault exception error
Skyler
skchopperguy at gmail.com
Thu Nov 15 18:01:40 EST 2012
I tried again, this time instead of 'save-as' from the server I ran it
against the actual Provisioning.wsdl on SPCE.
./wsdl2php -s -i
/usr/share/perl5/Sipwise/Provisioning/backends/SOAP/Provisioning.wsdl -o
/tmp/wsdlclass
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
in /home/skyler/wsdl2phpgenerator/src/Generator.php on line 161
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
' in /home/skyler/wsdl2phpgenerator/src/Generator.php:165
Stack trace:
#0 /home/skyler/wsdl2phpgenerator/src/Generator.php(146):
Generator->load('/usr/share/perl...')
#1 /home/skyler/wsdl2phpgenerator/generate.php(184):
Generator->generate(Object(Config))
#2 /home/skyler/wsdl2phpgenerator/wsdl2php(4): require_once('/home/skyler
...')
#3 {main}
thrown in /home/skyler/wsdl2phpgenerator/src/Generator.php on line 165
Any idea what the 'Extra content at the end of the document' would be?
Thanks,
Skyler
On Thu, Nov 15, 2012 at 11:16 AM, Skyler <skchopperguy at gmail.com> wrote:
> Hi,
>
> I am running into this errors again but now in 2.6, do you have any
> suggestions? Muchos Gracias Senior!
>
> Here is my process:
>
> 1. Copy local wsdl to my directory
> 2. sudo ./wsdl2php -i Provisioning.wsdl -o /outputdirectory/ -s
>
> This results in this error which we know about: PHP Fatal error:
> SOAP-ERROR: Parsing Schema: unexpected <documentation> in complexType
>
> So I perform the removal of <documentation> tags as it did work perfectly
> with 2.5
>
> 1. sudo perl -i -0777 -ple's/\s*<documentation>.+?<\/documentation>//sg'
> Provisioning.wsdl
> 2. sudo ./wsdl2php -i Provisioning.wsdl -o /outputdirectory/ -s
>
> This results now in a new error for 2.6
>
> PHP Fatal error: Uncaught exception 'Exception' with message 'No value
> supplied' in /home/skyler/wsdl2phpgenerator/lib/phpSource/PhpClass.php:203
> Stack trace:
> #0 /home/skyler/wsdl2phpgenerator/src/Enum.php(73):
> PhpClass->addConstant('', 'a')
> #1 /home/skyler/wsdl2phpgenerator/src/Type.php(95): Enum->generateClass()
> #2 /home/skyler/wsdl2phpgenerator/src/Generator.php(334): Type->getClass()
> #3 /home/skyler/wsdl2phpgenerator/src/Generator.php(148):
> Generator->savePhp()
> #4 /home/skyler/wsdl2phpgenerator/generate.php(184):
> Generator->generate(Object(Config))
> #5 /home/skyler/wsdl2phpgenerator/wsdl2php(4): require_once('/home/skyler
> ...')
> #6 {main}
> thrown in /home/skyler/wsdl2phpgenerator/lib/phpSource/PhpClass.php on
> line 203
>
> So here is the contents of that PhpClass.php:
>
> 192 /**
> 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
> 194 *
> 195 * @param mixed $value
> 196 * @param string $name
> 197 * @throws Exception
> 198 */
> 199 public function addConstant($value, $name = '')
> 200 {
> 201 if (strlen($value) == 0)
> 202 {
> 203 throw new Exception('No value supplied');
> 204 }
> 205
> 206 // If no name is supplied use the value as name
> 207 if (strlen($name) == 0)
> 208 {
> 209 if (is_string($value))
> 210 {
> 211 $name = $value;
> 212 }
> 213 else
> 214 {
> 215 throw new Exception('No name supplied');
> 216 }
> 217 }
> 218
> 219 if (array_key_exists($name, $this->constants))
> 220 {
> 221 throw new Exception('A constant of the name ('.$name.') does
> already exist.');
> 222 }
> 223
> 224 $this->constants[$name] = $value;
> 225 }
>
>
>
> On Sat, Jun 30, 2012 at 5:35 AM, Daniel Tiefnig <dtiefnig at sipwise.com>wrote:
>
>> On 06/30/2012 03:34 AM, Skyler wrote:
>> > Hi,
>>
>> Hej!
>>
>> > Google indicates that the <document> error is because the
>> > Provisioning.wsdl is built from wsdl-viewer possibly
>> > (http://tomi.vanek.sk/index.php?page=wsdl-viewer). So, the <xsd:tag>
>> > is not present in Provisioning.wsdl for this generator to find.
>>
>> The error is IMHO caused by a bug in the PHP5 WSDL implementation. The
>> <documentation> tags should be fine according to the WSDL specification:
>> http://www.w3.org/TR/wsdl#_documentation
>>
>> A simple solution, as you're saving the WSDL to a local file anyway
>> would be to strip the documentation elements from the file:
>>
>> perl -i -0777 -ple's/\s*<documentation>.+?<\/documentation>//sg'
>> Provisioning.wsdl
>>
>> br,
>> daniel
>>
>> _______________________________________________
>> Spce-user mailing list
>> Spce-user at lists.sipwise.com
>> http://lists.sipwise.com/listinfo/spce-user
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sipwise.com/pipermail/spce-user_lists.sipwise.com/attachments/20121115/da65ab0b/attachment-0001.html>
More information about the Spce-user
mailing list