power-media / prado3

Automatically exported from code.google.com/p/prado3
Other
0 stars 0 forks source link

Error generating WSDL #425

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.Exposes a provider to TSoapService
2.Add a spaces after ?> in that provider class file
3.Try to request the WSDL for that provider

What is the expected output? What do you see instead?
You'll get the error
"error on line x at column x: XML declaration allowed only at the start of the 
document"

What version of the product are you using? On what operating system?
Prado 3.1.10, Php 5.3.10, ubuntu 12.04

Please provide any additional information below.

My suggestion:

In TSoapService.php file at function "run()", add 
"$this->getResponse()->clear()" before request the write of WSDL:

BEFORE:

        if($this->getIsWsdlRequest())
        {
            // server WSDL file
            Prado::trace("Generating WSDL",'System.Web.Services.TSoapService');
            $this->getResponse()->write($server->getWsdl());
        }

AFTER:

        if($this->getIsWsdlRequest())
        {
            // server WSDL file
            Prado::trace("Generating WSDL",'System.Web.Services.TSoapService');
            $this->getResponse()->clear(); // CLEAR TJE RESPONSE BUFFER
            $this->getResponse()->write($server->getWsdl());
        }

Original issue reported on code.google.com by cezarpirajant@gmail.com on 5 Oct 2012 at 12:20

GoogleCodeExporter commented 8 years ago
Tipically you want to avoid putting php's closure tags ?> in files containing 
only php code: they could cause the insertion of unwanted newlines and they are 
not needed anyway.
Since this is a trivial fix and can avoid an headache when getting that error, 
i've committer the fix anyway as r3209. Thank you!

Original comment by ctrlal...@gmail.com on 5 Oct 2012 at 1:44