Giter VIP home page Giter VIP logo

Comments (11)

plq avatar plq commented on May 18, 2024

this is also needed to transform soaplib from a soap server library to a generic soap parsing library.

from spyne.

plq avatar plq commented on May 18, 2024

the plan is to split wsgi.Application class in two. The part that will remain in wsgi module will obviously handle only the wsgi-related parts. everything else will be moved to the soaplib.Application class. it will have at least those public methods:

class Application(object):
    def parse_request(self,istr):
        """Takes an input stream containing ONE soap message.
        Returns the native python object.
        """
        pass

    def process_request(self,req_obj)
        """Takes the native request object.
        Returns the response to the request as a native python object
        """
        pass

    def push_response(self,ostr, resp_obj)
        """Pushes the native python object to the output stream as a 
        soap response
        """
        pass

    def get_wsdl(self):
        """Returns the application wsdl"""
        pass

from spyne.

caustin avatar caustin commented on May 18, 2024

This is great. I was sitting down this morning to plan work on this issues for the rest of the week. Also, I just did a pull master and I see that you've begun implementing the plan.

I'd really like to help with this but, I don't want to step on your toes.

Can you let me know where you'd prefer I'd pitch in on this? I've got plenty of time to work on this right now since soaplib looks pretty core to some of our new project's.

from spyne.

plq avatar plq commented on May 18, 2024

the interface has changed a bit, but it's essentially the same.

let me stabilize the api, then we'll talk.

from spyne.

plq avatar plq commented on May 18, 2024

i think i've got the basics to work. please hunt down bugs by writing tests / fixing the ones that fail.

this is the public api. what do you think?

class Application(object):
    def deserialize_soap(self, envelope_string, charset=None):
        """Takes a string containing ONE soap message.
        Returns the corresponding native python object, along with the request
        context

        Not meant to be overridden.
        """

    def process_request(self,ctx,req_obj):
        """Takes the native request object.
        Returns the response to the request as a native python object.

        Not meant to be overridden.
        """

    def serialize_soap(self, ctx, native_obj):
        """Pushes the native python object to the output stream as a
        soap response

        Not meant to be overridden.
        """

    def get_namespace_prefix(self, ns):
        """Returns the namespace prefix for the given namespace.
        Creates a new one automatically if it doesn't exist

        Not meant to be overridden.
        """

    def set_namespace_prefix(self, ns, pref):
        """Forces a namespace prefix on a namespace by either 
        creating it or moving the existing namespace to a new prefix

        Not meant to be overridden.
        """

    def get_name(self):
        """Returns service name that is seen in the name attribute
        of the definitions tag.

        Not meant to be overridden.
        """

    def get_tns(self):
        """Returns default namespace that is seen in the targetNamespace 
        attribute of the definitions tag.

        Not meant to be overridden.
        """

    def get_service_class(self, method_name):
        """This call maps method names to the services that will handle 
        them.

        Override this function to alter the method mappings. Just try
        not to get too crazy with regular expressions :)
        """

    def get_service(self, service, http_req_env=None):
        """The function that maps service classes to service instances.
        Overriding this function is useful in case e.g. you need to
        pass additional parameters to service constructors.
        """

    def get_schema(self):
        """Simple accessor method that caches application's xml schema,
        once generated.

        Not meant to be overridden.
        """

    def get_wsdl(self, url):
        """Simple accessor method that caches the wsdl of the
        application, once generated.

        Not meant to be overridden.
        """

    def validate_request(self, payload):
        """Method to be overriden to perform any sort of custom input
        validation.
        """

    def on_exception_object(self, exc):
        '''Called when the app throws an exception. (might be inside or
        outside the service call.

        @param the wsgi environment
        @param the fault object
        '''

    def on_exception_xml(self, fault_xml):
        '''Called when the app throws an exception. (might be inside or
        outside the service call.

        @param the wsgi environment
        @param the xml element containing the xml serialization of the
               fault
        '''

from spyne.

caustin avatar caustin commented on May 18, 2024

I thinks looks pretty good. I've started working on the tests today I should have a pull request for you tomorrow.

from spyne.

plq avatar plq commented on May 18, 2024

i'm not happy with two properties of the context object:

  1. it's created only by the serialize_soap call.
  2. it's in fact the service definition object.

here's how i think those issues should be addressed:

  1. separate context creation into its own public method: create_call_context
  2. the said function will return an RpcContext object that will have the service definition instance in a public instance variable called 'service'.

i haven't started implementing this yet. if anyone does, please drop a notice here so that we don't step on each other's toes.

from spyne.

plq avatar plq commented on May 18, 2024

the above is implemented in 6e41a83.

from spyne.

plq avatar plq commented on May 18, 2024

http://github.com/arskom/soaplib/commit/897eef1d47591b91621085c74be53cf78035e842#commitcomment-165824

from spyne.

plq avatar plq commented on May 18, 2024

the next step is to implement alternative transports and patterns in order to validate current api and its implementation.

from spyne.

plq avatar plq commented on May 18, 2024

zeromq transport is implemented. i consider this job accomplished. closing issue.

from spyne.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.