Changeset a94cb0a


Ignore:
Timestamp:
Nov 21, 2008 5:07:56 PM (16 years ago)
Author:
Ted Faber <faber@…>
Branches:
axis_example, compt_changes, info-ops, master, version-1.30, version-2.00, version-3.01, version-3.02
Children:
5576a47
Parents:
ac54ef3
Message:

restore serialize

Location:
fedd
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • fedd/fedd_client.py

    rac54ef3 ra94cb0a  
    1313
    1414from xmlrpclib import ServerProxy, Error, dumps, loads
    15 from ZSI import SoapWriter
    1615from ZSI.TC import QName, String, URI, AnyElement, UNBOUNDED, Any
    1716from ZSI.wstools.Namespaces import SOAP
     
    281280        if transport == "soap":
    282281            if serialize_only:
    283                 sw = SoapWriter()
    284                 sw.serialize(req)
    285                 print str(sw)
     282                print self.caller.serialize_soap(req_dict)
    286283                sys.exit(0)
    287284            else:
  • fedd/remote_service.py

    rac54ef3 ra94cb0a  
    55import M2Crypto.httpslib
    66from M2Crypto.m2xmlrpclib import SSL_Transport
    7 from ZSI import ParseException, FaultException
     7from ZSI import ParseException, FaultException, SoapWriter
    88
    99from service_error import *
     
    241241        self.tracefile = tracefile
    242242        self.__call__ = self.call_service
     243
     244    def serialize_soap(self, req):
     245        """
     246        Return a string containing the message that would be sent to call this
     247        service with the given request.
     248        """
     249        msg = self.request_message()
     250        set_element = getattr(msg, "set_element_%s" % self.request_body_name,
     251                None)
     252        if not set_element:
     253            raise service_error(service_error.internal,
     254                    "Cannot get element setting method for %s" % \
     255                            self.request_body_name)
     256        set_element(self.pack_soap(msg, self.request_body_name, req))
     257        sw = SoapWriter()
     258        sw.serialize(msg)
     259        return unicode(sw)
    243260
    244261    def call_xmlrpc_service(self, url, req, cert_file=None, cert_pwd=None,
Note: See TracChangeset for help on using the changeset viewer.