kartagis / pysimplesoap

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

Problems with wsdl containing xs:base64Binary Master-Key mismatch #177

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?

I am trying to use a method on a server with a wdsl description containing a 
type="xs:base64Binary". The method is used to attach binary-encoded data.

The wsdl-part looks like that:

 <xs:complexType name="attachData">
- <xs:sequence>
  <xs:element name="Id" type="xs:int" /> 
  <xs:element minOccurs="0" name="filename" type="xs:string" /> 
  <xs:element minOccurs="0" name="data" type="xs:base64Binary" /> 
  </xs:sequence>
  </xs:complexType>

All other methods on the server are working fine with simplesoap (because they 
don't contain a "base64Binary"-type.
The method 'attachData' itself is working fine, too, when I use it with soapUI 
or other utilities - except for simplesoap.

The problem is, that the wsdl_validation fails: Simplesoap tells me, that the 
test key does not match the master key.

Which is true: The master key for data looks like that *{}*. But it should say 
type<str> here.

The problem seems to be in parsing the wsdl. xs:base64Binary is not parsed 
correctly since it ends up beeing translated to  *{}*. 
I was not able to figure out, how the parsing of the wsdl is done, so I 
couldn't fix the problem myself.

What is the expected output? What do you see instead?
The expectet  output is a correctly working xml. The xml is not built at all, 
because of the describded error. The output is:
Traceback (most recent call last):
  File "D:\tools\python2.7\app\lib\pysimplesoap\client.py", line 141, in <lambda>
    return lambda *args, **kwargs: self.wsdl_call(attr, *args, **kwargs)
  File "D:\tools\python2.7\app\lib\pysimplesoap\client.py", line 288, in wsdl_call
    method, params = self.wsdl_call_get_params(method, input, *args, **kwargs)
  File "D:\tools\python2.7\app\lib\pysimplesoap\client.py", line 326, in wsdl_call_get_params
    raise ValueError('Invalid Args Structure. Errors: %s' % errors)
ValueError: Invalid Args Structure. Errors: [u"type mismatch for value. 
master(<class 'pysimplesoap.simplexml.OrderedDic
t'>): **{}**, test(<type 'str'>): 
UEsDBBQAAAAIAPROWkZNqIfioQIAAIsKAAAYAAAAeGwvd29ya3NoZWV0cy9zaGVldDEueG1sjZZbb6Mw
EIXf91 [...]

What version of the product are you using? On what operating system?
1.10 on windows server 2008 r2

Please attach the related WSDL (if any), a small code fragment to reproduce
and provide any additional information below.
I can't provide the whole wsdl, since it is not a public code. But as I have 
said: it is working fine with simplesoap except for the base64string.

Original issue reported on code.google.com by andreas....@gmail.com on 26 Feb 2015 at 9:01

GoogleCodeExporter commented 8 years ago
You could add base64 to TYPE_MAP:

https://code.google.com/p/pysimplesoap/source/browse/pysimplesoap/helpers.py#517

{} is the equivalent to "any value", maybe this check could be relaxed in the 
wsdl_call_get_params validation

We would need a complete WSDL and .py to reproduce, if you can attach it that 
would be great

Original comment by reingart@gmail.com on 7 Mar 2015 at 7:14