View Issue Details

IDProjectCategoryView StatusLast Update
0013825mantisbtapi soappublic2012-02-13 06:03
Reporterolegk Assigned Toatrol  
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionno change required 
Product Version1.2.8 
Summary0013825: Error adding Issues and bugnotes via soap api.
Description

I've been using SOAP for reporting issues and adding bugnotes quite successful until I wrote the plug-in, which processes events EVENT_BUGNOTE_DATA and EVENT_REPORT_BUG_DATA.

Even though the plug-in does nothing but returns bug_data and note_text without being changed I have an error message "looks like we got no XML document".

Further investigation showed that then the plug-in is installed there is an empty line before the xml content in response message.

Content-Length: 549 and 550 shows it clearly.

Additional Information

The plug-in is enabled but does nothing.

HTTP/1.1 200 OK
Date: Mon, 30 Jan 2012 16:07:04 GMT
Server: Apache/2.2.17
X-Powered-By: PHP/5.2.17
Set-Cookie: PHPSESSID=f4da9992ed6375a21e4c3e071055b6f5; path=/
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
X-SOAP-Server: NuSOAP/0.9.5 (1.123)
Content-Length: 550
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:mc_issue_note_addResponse xmlns:ns1="http://futureware.biz/mantisconnect"><return xsi:type="xsd:integer">189248</return></ns1:mc_issue_note_addResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>

The plug-in is disabled.

HTTP/1.1 200 OK
Date: Mon, 30 Jan 2012 16:09:37 GMT
Server: Apache/2.2.17
X-Powered-By: PHP/5.2.17
Set-Cookie: PHPSESSID=5ba63ab72062df7e137d4baf6bb9b8a0; path=/
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
X-SOAP-Server: NuSOAP/0.9.5 (1.123)
Content-Length: 549
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><ns1:mc_issue_note_addResponse xmlns:ns1="http://futureware.biz/mantisconnect"><return xsi:type="xsd:integer">189249</return></ns1:mc_issue_note_addResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>

TagsNo tags attached.
Attached Files
TextFormatting.zip (917 bytes)

Activities

atrol

atrol

2012-01-30 12:27

developer   ~0031081

Is it fixed by removing the closing ?> in your plugin?

olegk

olegk

2012-01-31 03:03

reporter   ~0031083

Thanks very much for your help it works.
The issue can be closed.

rombert

rombert

2012-01-31 03:09

reporter   ~0031084

Great, thanks.

atrol

atrol

2012-01-31 03:11

developer   ~0031085

To understand what happened read http://php.net/manual/en/language.basic-syntax.instruction-separation.php especially the note

Note:
The closing tag of a PHP block at the end of a file is optional, and in some cases omitting it is helpful when using include() or require(), so unwanted whitespace will not occur at the end of files, and you will still be able to add headers to the response later. It is also handy if you use output buffering, and would not like to see added unwanted whitespace at the end of the parts generated by the included files.