View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0011151 | mantisbt | api soap | public | 2009-11-10 10:34 | 2010-07-29 10:45 |
Reporter | magnomp | Assigned To | rombert | ||
Priority | normal | Severity | major | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Product Version | 1.1.8 | ||||
Target Version | 1.2.2 | Fixed in Version | 1.2.2 | ||
Summary | 0011151: Can't upload attachment to issue via soap interface | ||||
Description | Attachments sent to issues through the soap interface are always empty. I mean: The attachment do appear on the issue page, but with size = 0. My attachments are stored on database. I haven't tried this with other methods. | ||||
Steps To Reproduce | Call mc_issue_attachment_add to upload any file to an existing issue. | ||||
Additional Information | I noticed the mc_issue_attachment_add implementation calls base64_decode to decode the attachment data. I removed the call to base64_decode and now it works. Here's my modified version of mc_issue_attachment_add: I also suggest to change the documentation regarding $p_content parameter, as it says it's base64, when the function actually receivess binary data. | ||||
Tags | No tags attached. | ||||
The client must sent base64 encoded content, as specified by the WSDL. It will then be decoded by NuSOAP. |
|
Are you sure it's a duplicate of 0010235? The issue page says it has been fixed in 1.1.7, but I've experienced it on 1.1.8 |
|
I am sure since as a developer of the Mylyn-Mantis connector, which uses the SOAP API, have tested ( and have workarounds ) for both 1.1.6 ( pre-fix ) and 1.1.7 ( post-fix ). |
|
Have you tested with 1.1.8? Perhaps the bug has been reintroduced, or maybe it's a new bug which happens to have the same symptoms. But I'm sure this feature isn't working on 1.1.8. The data is already being sent base64 encoded, I've intercepted the soap request to check it. The problem here is that the decoding is hapenning twice: First inside NuSOAP, and then inside mc_issue_attachment_add implementation. As the seccond base64_decode call receives raw binary data, it returns nothing. |
|
I'll take a closer look then. |
|
I have encountered the same issue in Mantis version 1.2.0. It seems like this issue is a duplicate of 0010235 yet it still exists in 1.2.0. As magnomp said, the fix was to remove the call to base64_decode() in the mc_issue_attachment_add() function. |
|
I was able to reproduce this using the SOAP UI. I am not sure why both the PHP tests and the Eclipse integration worked, but this is a bug and I will fix it. |
|
I've committed a fix in the soap-attachments branch ( commit at http://git.mantisbt.org/?p=mantisbt.git;a=commit;h=b836b267cfc77aa516968fe05d1804743df133d7 ). Please verify that it does solve the problem you've reported. |
|
MantisBT: master dd284661 2010-04-28 14:25 Details Diff |
Only decode attachments once when using the SOAP API Attachments uploaded using the SOAP API calls are decoded by NuSOAP. Up till now, we are also decoding the attachments, which caused the attached files to be unreadable. Although workarounds do exist, the correct way is to let NuSOAP apply the Base64-decoding. The requirement for the users of the SOAP API is to Base64-encode the attachments passed to mc_issue_attachment_add mc_project_attachment_add and to Base64-decode the attachments retrieved with mc_issue_attachment_get and mc_project_attachment_get. Fixes 0011151: Can't upload attachment to issue via soap interface |
Affected Issues 0011151 |
|
mod - api/soap/mc_issue_attachment_api.php | Diff File | ||
mod - api/soap/mc_project_attachment_api.php | Diff File | ||
mod - tests/soap/AttachmentTest.php | Diff File | ||
MantisBT: master-1.2.x d04d8ea5 2010-04-28 14:25 Details Diff |
Only decode attachments once when using the SOAP API Attachments uploaded using the SOAP API calls are decoded by NuSOAP. Up till now, we are also decoding the attachments, which caused the attached files to be unreadable. Although workarounds do exist, the correct way is to let NuSOAP apply the Base64-decoding. The requirement for the users of the SOAP API is to Base64-encode the attachments passed to mc_issue_attachment_add mc_project_attachment_add and to Base64-decode the attachments retrieved with mc_issue_attachment_get and mc_project_attachment_get. Fixes 0011151: Can't upload attachment to issue via soap interface |
Affected Issues 0011151 |
|
mod - api/soap/mc_issue_attachment_api.php | Diff File | ||
mod - api/soap/mc_project_attachment_api.php | Diff File | ||
mod - tests/soap/AttachmentTest.php | Diff File |