怎样在SOAP中返回对象?用ZSI
在ZSI中
用 wsdl2py 和 wsdl2dispatch 自动生成了一堆代码,但返回错误
不知道怎样才能用生成的代码返回一个object
aa_service_server.py
def soap_Query(self, ps):
self.request = ps.Parse(QueryRequest.typecode)
acc = self.request.Acc
# If we have an implementation object use it
if hasattr(self,'impl'):
parameters = self.impl.Query(acc)
result = QueryPasswordResponse()
#此处以上代码都好
#就是这个return,哎
return result
|
aa_services.py
......
QueryRequest = ns0.Query_Dec().pyclass
QueryResponse = ns0.QueryResponse_Dec().pyclass
|
aa_services_types.py
.......
class QueryResponse_Dec(ElementDeclaration):
literal = "QueryResponse"
schema = "urn:GAME"
def __init__(self, **kw):
kw["pname"] = ("urn:GAME","QueryResponse")
kw["aname"] = "_QueryResponse"
if ns0.TQueryResponse_Def not in ns0.QueryResponse_Dec.__bases__:
bases = list(ns0.QueryResponse_Dec.__bases__)
bases.insert(0, ns0.TQueryResponse_Def)
ns0.QueryResponse_Dec.__bases__ = tuple(bases)
ns0.TQueryResponse_Def.__init__(self, **kw)
if self.pyclass is not None: self.pyclass.__name__ = "QueryResponse_Dec_Holder"
|
还有其他相关的代码