hello all, new to the boards and only relatively new to Python in general. I'm having a problem with ZSI and the return of complex data. I have tried searching the web for information and examples, but nothing seems to work, so I'm going for the mercy of the court. :}
The environment is ZSI 2.0 release (source) installed under Mac OS X 10.4 and Python 2.5.1.
I used wsdl2py -b on our product's service and created the _services and _types files.
Using all the examples I have, I prepare my request:
However, in the parsing I always get the following exception:
Element "_strFullName" missing from complexType
Is there some special parameter I need to invoke to properly parse the returned complex, or am I seeing a bug with Python on the Mac?
I'm curious if others have had problems getting the complex stuff to work on the mac. If you need more details please let me know and I'll see what I can put up. Thanks
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
let me ask how you built the complex type in Python. When using wsdl2py -b ZSI installs setter and getter function as set_element_ANAME and get_element_ANAME. Maybe if you do it that way, the error doesn't occur any longer.
Here a quick example. In your WSDL you have a part of a return type "cow", where cow is a complextype with the elements "pattern" and "sex".
So in your server you could build it like this:
I just encountered a similar issue, and its due to responses not including an element when minOccurs=1. However, its unclear if the SOAP server incorrectly omitting the element, or ZSI incorrectly setting minOccurs.
Changing missing element minOccurs to 0 allowed me to parse the reply, which makes me think its set incorrectly, either in the WSDL file or by ZSI.
Does anyone know the default value of minOccurs? This is for name_Def() methods in foo_types.py.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
hello all, new to the boards and only relatively new to Python in general. I'm having a problem with ZSI and the return of complex data. I have tried searching the web for information and examples, but nothing seems to work, so I'm going for the mercy of the court. :}
The environment is ZSI 2.0 release (source) installed under Mac OS X 10.4 and Python 2.5.1.
I used wsdl2py -b on our product's service and created the _services and _types files.
Using all the examples I have, I prepare my request:
request = CommunityGetNameIn()
request._CommunityID = iCommunity
reponse = self.server.CommunityGetName(request)
I saw lots of examples that had things like "Wrapper" or such added to the functions, but I did not see these in the generated files.
When I invoke the request I am expecting back a complex structure of two strings.
The SOAP coming back is:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
<soap:Body soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<snp:CommunityGetName xmlns:snp="http://www.connected.com/AdminAPI/v7.5/">
<Names>
<strFullName>BC2000</strFullName>
<strShortName>BC2000</strShortName>
</Names>
</snp:CommunityGetName>
</soap:Body>
</soap:Envelope>
However, in the parsing I always get the following exception:
Element "_strFullName" missing from complexType
Is there some special parameter I need to invoke to properly parse the returned complex, or am I seeing a bug with Python on the Mac?
I'm curious if others have had problems getting the complex stuff to work on the mac. If you need more details please let me know and I'll see what I can put up. Thanks
Hi,
let me ask how you built the complex type in Python. When using wsdl2py -b ZSI installs setter and getter function as set_element_ANAME and get_element_ANAME. Maybe if you do it that way, the error doesn't occur any longer.
Here a quick example. In your WSDL you have a part of a return type "cow", where cow is a complextype with the elements "pattern" and "sex".
So in your server you could build it like this:
>return_cow = new_cow()
>return_cow.set_element_pattern = "Black and White"
>return_cow.set_element_sex = "female"
Finally you would return return_cow:
>return return_cow
Does it help at all? ;)
P.S.: I just found it documented: http://pywebsvcs.sourceforge.net/cookbook.pdf
I just encountered a similar issue, and its due to responses not including an element when minOccurs=1. However, its unclear if the SOAP server incorrectly omitting the element, or ZSI incorrectly setting minOccurs.
Changing missing element minOccurs to 0 allowed me to parse the reply, which makes me think its set incorrectly, either in the WSDL file or by ZSI.
Does anyone know the default value of minOccurs? This is for name_Def() methods in foo_types.py.