<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def add_methods(self, service):
 """Build method view for service."""

        bindings = {
            "document/literal": Document(self),
            "rpc/literal": RPC(self),
            "rpc/encoded": Encoded(self)}
        for p in service.ports:
            binding = p.binding
            ptype = p.binding.type
            operations = p.binding.type.operations.values()
            for name in (op.name for op in operations):
                m = Facade("Method")
                m.name = name
                m.location = p.location
                m.binding = Facade("binding")
                op = binding.operation(name)
                m.soap = op.soap
                key = "/".join((op.soap.style, op.soap.input.body.use))
                m.binding.input = bindings.get(key)
                key = "/".join((op.soap.style, op.soap.output.body.use))
                m.binding.output = bindings.get(key)
                p.methods[name] = m