problem with Strings Array as input. I get the value "[u'string']"

Asked by Mr T

Having this simple web service code:

 @ladonize([PORTABLE_STRING], rtype=str)
 def simplest(self, p1, **exports):
  print "Received:"+str(p1)
  return str(p1)

will return and print "[u'string']", instead of what it is suposed to return & print.
I'm using taverna workbench as WS client, serving the WS with SOAP11

Question information

English Edit question
ladon Edit question
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Mr T (mrjaspe) said :

In case it is useful, I've captured the soap message. It is (more or less) sth like this:
<soapenv:Envelope.xmlns:soapenv="" xmlns:xsd="" xmlns:xsi="">
 <ns1:simplest.soapenv:encodingStyle="" xmlns:ns1="urn:BubuService">
  <p2.soapenc:arrayType="xsd:string[2]" xmlns:soapenc="" xsi:type="soapenc:Array">

Revision history for this message
Mr T (mrjaspe) said :

I found a solution for this,
modifying the file.
to pre-edit the soap message received in order to be compliant with the parser:
Something like (new lines with "+"):

class SOAP11RequestHandler(BaseRequestHandler):

 def parse_request(self,soap_body,sinfo,encoding):
+ # This lines are for fixing bug when parsing Tavernas SOAP messages:
+ soap_body=soap_body.replace('<string>','<item xsi:type="ns3:string">')
+ soap_body=soap_body.replace('</string>','</item>')

  parser = make_parser()
  ch = SOAP11ContentHandler(parser)
  inpsrc = InputSource()
  return ch.req_dict

Revision history for this message
Launchpad Janitor (janitor) said :

This question was expired because it remained in the 'Open' state without activity for the last 15 days.