From: <ken...@gm...> - 2007-01-31 22:27:19
|
If not, how do i describe this structure in my WSDL file? On Jan 30, 5:41 pm, "keniche...@gmail.com" <keniche...@gmail.com> wrote: > Hi all, > I have a simple ZSI server that returns a list of object and the SOAP > response from the server is: > > <SOAP-ENV:Body> > <searchResponse> > <Eoe52e18 SOAP-ENC:arrayType="xsd:anyType[5]"> > <SearchResult> > <id id="oa0ad58" xsi:type="xsd:string">5847</id> > <name id="oa0ade8" xsi:type="xsd:string">name 1</title> > </SearchResult> > <SearchResult> > <id id="oa0ad58" xsi:type="xsd:string">5848</id> > <name id="oa0ade8" xsi:type="xsd:string">name 2</title> > </SearchResult> > <SearchResult> > <id id="oa0ad58" xsi:type="xsd:string">5849</id> > <name id="oa0ade8" xsi:type="xsd:string">name 3</title> > </SearchResult> > </Eoe52e18> > </searchResponse> > </SOAP-ENV:Body> > > The problem is that the name of the array is randomly created. Is > there a way to specify an array type containing all of the results? > > Here's the server code: > > import os > from ZSI import dispatch, TC > > class Result: > def __init__(self, id, name): > self.id = id > self.name = name > > def search(): > result1 = Result(1, 'name 1') > result2 = Result(2, 'name 2') > result3 = Result(3, 'name 3') > results = [result1, result2, result3] > return results > > Result.typecode = TC.Struct(Result, [ > TC.Integer('id'), > TC.String('name'), > ], pname='SearchResult') > if __name__ == '__main__': > dispatch.AsServer(port=8080) > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys - and earn cashhttp://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DE... > _______________________________________________ > Pywebsvcs-talk mailing list > Pywebsvcs-t...@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/pywebsvcs-talk > Also archived athttp://groups.google.com/group/pywebsvcs |