| Anonymous | Login | Signup for a new account | 2010-07-29 10:09 EDT | ![]() |
| Main | My View | View Issues | Change Log | Roadmap | Wiki | ManTweet | Repositories |
| View Issue Details [ Jump to Notes ] [ Wiki ] | [ Issue History ] [ Print ] | |||||
| ID | Project | Category | View Status | Date Submitted | Last Update | |
| 0011111 | mantisbt | api soap | public | 2009-11-02 11:12 | 2009-11-18 10:18 | |
| Reporter | warden | |||||
| Assigned To | rombert | |||||
| Priority | normal | Severity | minor | Reproducibility | always | |
| Status | closed | Resolution | no change required | |||
| Platform | OS | OS Version | ||||
| Product Version | 1.2.0rc2 | |||||
| Target Version | Fixed in Version | |||||
| Summary | 0011111: unable to add comments to issues | |||||
| Description | When trying to add new comment via SOAP I get the following: *** Incoming SOAP ****************************************************** <?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><SOAP-ENV:Fault><faultcode xsi:type="xsd:string">Server</faultcode><faultactor xsi:type="xsd:string"></faultactor><faultstring xsi:type="xsd:string">Error Type: SYSTEM NOTICE, Error Description: Array to string conversion, Stack Trace: mc_api.php L0 mc_error_handler() utility_api.php L66 trim() mc_api.php L44 is_blank() mc_issue_api.php L784 mci_check_login() nusoap.php L0 mc_issue_note_add() nusoap.php L4000 call_user_func_array() nusoap.php L3689 invoke_method() mantisconnect.php L1391 service() mantisconnect.php L0 {main}() </faultstring><detail xsi:type="xsd:string"></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope> ************************************************************************ | |||||
| Steps To Reproduce | *** Outgoing SOAP ****************************************************** <?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" [^] xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" [^] xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" [^] xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" [^] xmlns:xsd="http://www.w3.org/1999/XMLSchema" [^] > <SOAP-ENV:Body> <ns1:mc_issue_note_add xmlns:ns1="http://futureware.biz/mantisconnect" [^] SOAP-ENC:root="1"> <note> <text xsi:type="xsd:string">New comment</text> </note> <username xsi:type="xsd:string">user</username> <password xsi:type="xsd:string">pass</password> <issue_id xsi:type="xsd:int">146</issue_id> </ns1:mc_issue_note_add> </SOAP-ENV:Body> </SOAP-ENV:Envelope> ************************************************************************ | |||||
| Additional Information | Tested with normal and LDAP auth. | |||||
| Tags | No tags attached. | |||||
| Attached Files | ||||||
Notes |
|
|
rombert (developer) 2009-11-02 14:10 |
The correct parts are:
username: xsd:string
password: xsd:string
issue_id: xsd:integer
note: tns:IssueNoteData
|
|
warden (reporter) 2009-11-02 16:51 |
erm, yes? <note> <text xsi:type="xsd:string">New comment</text> </note> <username xsi:type="xsd:string">user</username> <password xsi:type="xsd:string">pass</password> <issue_id xsi:type="xsd:int">146</issue_id> </ns1:mc_issue_note_add> i'm using it in the same way as with creating issue with python: note = { text: 'New comment' } issueid = 146 service.mc_issue_note_add(username=username,password=password,issue_id = issueid, note = note) point me where's the error because I might be blind today ;) (and anyway, it should exit with exception gracefully as I looked up the code of mc_issue_note_addwhen something is not set,no? Not with this ugly stacktrace of invalid casting) |
|
rombert (developer) 2009-11-03 02:54 |
The XML you've pasted seems to indicate that the note comes first for some reason, e.g. note username password issue_id although your method invocation seems right ( is that python ? ). |
|
warden (reporter) 2009-11-03 18:37 |
yes, that is python. Indeed in the request XML the note element is first. But since when XML is order-aware? The order should not matter. |
|
rombert (developer) 2009-11-04 16:18 |
>>Indeed in the request XML the note element is first. But since when XML is order-aware? The order should not matter. I could not find a definite reference, but this is not plain XML, it's validated by a schema (WSDL). In any case, it's something out of my control and tends to fall into the NUSOAP teritory, which I'm afraid I can't fix. |
|
warden (reporter) 2009-11-04 17:55 |
Well, something is definitely wrong here ;-) Check the fun part, I was trying to debug in many ways and once, I changed the invocation to: server.mc_issue_note_add( username=username, password=password, issue_id=146, nota = note ) and.. guess what. it worked, suddenly the order was right, and the comment has been added. So, I said ok, let's try notexxx. Then I got: Traceback (most recent call last): File "./mailer.py", line 61, in <module> server.mc_issue_note_add( username=username, password=password, issue_id=146, notexxx = nota ) File "/var/lib/python-support/python2.5/SOAPpy/Client.py", line 470, in __call__ return self.__r_call(*args, **kw) File "/var/lib/python-support/python2.5/SOAPpy/Client.py", line 492, in __r_call self.__hd, self.__ma) File "/var/lib/python-support/python2.5/SOAPpy/Client.py", line 406, in __call raise p SOAPpy.Types.faultType: <Fault Client: Access Denied: > But the order is still ok. Only when I'm using "note" as it should be from WSDL, the order is wrong.. No idea what's happening here. |
|
rombert (developer) 2009-11-05 02:34 |
I expect sending invalid XML to generate an error response from NuSOAP. Please paste the output of the XML you have sent, so that I can tell what's going on. |
|
warden (reporter) 2009-11-05 05:51 |
You have it the steps to reproduce. This is still the same 'order' issue. |
|
rombert (developer) 2009-11-05 06:00 |
I actually don't have the steps to reproduce, since I don't know the XML request you are sending. |
|
warden (reporter) 2009-11-05 06:09 |
#!/usr/bin/python import sys from SOAPpy import SOAPProxy from SOAPpy.wstools import WSDLTools import re, email, quopri import email.header from email.Parser import Parser url = '' username = '' password = '' namespace = 'http://futureware.biz/mantisconnect' [^] server = SOAPProxy(url, namespace) server.config.dumpSOAPOut = 1 server.config.dumpSOAPIn = 1 note = { 'text' : 'Komentarz' } try: server.mc_issue_note_add( username=username, password=password, issue_id=146, note = note ) except StandardError,err: print err sys.exit() |
|
rombert (developer) 2009-11-05 16:37 |
This is still not the raw XML message that I need I'm afraid. Nonetheless, I still don't know what is the exact problem you're reporting. Is it that you can't send arguments in a variable order? To my understanding this is a requirement of the schema applied to our web service, so it can't be changed. The fact that both the Python client library and the PHP server library are silent is more of a tribute to their dynamic, forgiving nature than a testimony to it being standard. I have seen cases where SOAP messages accepted by the PHP SOAP extensions were rejected by Axis ( Java ) , so this is not proof of an error. -- Bottom line is that I would be very happy to fix the problem you're encountering, but I need a clear description - unless it's this reordering, which I feel disinclined to tackle - and what changes I should bring to the SOAP API. |
|
warden (reporter) 2009-11-05 16:49 edited on: 2009-11-05 16:50 |
Rombert, the raw XML is in the steps to reproduce. You cannot get more raw than that.... And again, this *IS* the reordering thing. Which is caused by "i don't know what" but as you see the invocation of WS is the proper way. |
|
rombert (developer) 2009-11-09 17:49 |
I've just tried your python script and it does fail. I'm no python guru, so I googled pysoap and ran into http://www.diveintopython.org/soap_web_services/index.html [^] . I see no indication of named arguments, all invocations are positional. I have no idea what happens in Python when you use named arguments, but when using positional arguments, i.e.server.mc_issue_note_add( username, password, 762, note ); things worked as expected *** Outgoing SOAP ****************************************************** <?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" [^] xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" [^] xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" [^] xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" [^] xmlns:xsd="http://www.w3.org/1999/XMLSchema" [^] > <SOAP-ENV:Body> <ns1:mc_issue_note_add xmlns:ns1="http://futureware.biz/mantisconnect" [^] SOAP-ENC:root="1"> <v1 xsi:type="xsd:string">administrator</v1> <v2 xsi:type="xsd:string">root</v2> <v3 xsi:type="xsd:int">762</v3> <v4> <text xsi:type="xsd:string">Komentarz</text> </v4> </ns1:mc_issue_note_add> </SOAP-ENV:Body> </SOAP-ENV:Envelope> ************************************************************************ *** Incoming SOAP ****************************************************** <?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope 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">287</return></ns1:mc_issue_note_addResponse></SOAP-ENV:Body></SOAP-ENV:Envelope> ************************************************************************ |
|
warden (reporter) 2009-11-18 08:46 |
Thanks for that! Weird issue, indeed the positional arguments work perfectly fine for now. |
|
rombert (developer) 2009-11-18 09:32 |
Thanks for the confirmation. Can I close this report then? |
|
warden (reporter) 2009-11-18 10:11 |
Sure, thanks a lot! |
Issue History |
|||
| Date Modified | Username | Field | Change |
| 2009-11-02 11:12 | warden | New Issue | |
| 2009-11-02 14:10 | rombert | Note Added: 0023547 | |
| 2009-11-02 14:10 | rombert | Status | new => resolved |
| 2009-11-02 14:10 | rombert | Resolution | open => no change required |
| 2009-11-02 14:10 | rombert | Assigned To | => rombert |
| 2009-11-02 16:51 | warden | Note Added: 0023549 | |
| 2009-11-03 02:54 | rombert | Note Added: 0023552 | |
| 2009-11-03 18:37 | warden | Note Added: 0023559 | |
| 2009-11-04 16:18 | rombert | Note Added: 0023569 | |
| 2009-11-04 17:55 | warden | Note Added: 0023571 | |
| 2009-11-04 17:55 | warden | Status | resolved => feedback |
| 2009-11-04 17:55 | warden | Resolution | no change required => reopened |
| 2009-11-05 02:34 | rombert | Note Added: 0023581 | |
| 2009-11-05 05:51 | warden | Note Added: 0023585 | |
| 2009-11-05 05:51 | warden | Status | feedback => assigned |
| 2009-11-05 06:00 | rombert | Note Added: 0023586 | |
| 2009-11-05 06:00 | rombert | Status | assigned => feedback |
| 2009-11-05 06:09 | warden | Note Added: 0023587 | |
| 2009-11-05 06:09 | warden | Status | feedback => assigned |
| 2009-11-05 16:37 | rombert | Note Added: 0023602 | |
| 2009-11-05 16:37 | rombert | Status | assigned => feedback |
| 2009-11-05 16:49 | warden | Note Added: 0023603 | |
| 2009-11-05 16:49 | warden | Status | feedback => assigned |
| 2009-11-05 16:50 | warden | Note Edited: 0023603 | View Revisions |
| 2009-11-09 17:49 | rombert | Note Added: 0023628 | |
| 2009-11-09 17:49 | rombert | Status | assigned => feedback |
| 2009-11-18 08:46 | warden | Note Added: 0023748 | |
| 2009-11-18 08:46 | warden | Status | feedback => assigned |
| 2009-11-18 09:32 | rombert | Note Added: 0023750 | |
| 2009-11-18 10:11 | warden | Note Added: 0023751 | |
| 2009-11-18 10:18 | rombert | Status | assigned => closed |
| 2009-11-18 10:18 | rombert | Resolution | reopened => no change required |
| MantisBT 1.2.2 git master-1.2.x[^]
Copyright © 2000 - 2010 MantisBT Group
Time: 0.2920 seconds. memory usage: 2,024 KB |