This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
from html_service import HTMLService | |
TEMPLATE = """<!doctype html> | |
<html> | |
<head> | |
<title>Sample HTML template</title> | |
</head> | |
<body> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from zato.client import JSONClient | |
address = 'http://localhost:11223' | |
path = '/rates/get-rate' | |
client = JSONClient(address, path) | |
payload = {'code_from':'USD', 'code_to':'EUR'} | |
response = client.invoke(payload) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ curl localhost:11223/rates/create-exchange-pair -d '{"code_from":"USD", "code_to":"EUR"}' | |
$ | |
(and after a couple of minutes once the cache has been populated) | |
$ curl localhost:11223/rates/get-rate -d '{"code_from":"USD", "code_to":"EUR"}' | |
{"response": {"rate": "0.7395"}} | |
$ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from zato.server.service import Service | |
class MyService(Service): | |
def handle(self): | |
self.outgoing.jms_wmq.send('my-message', 'outgoing-connection-name', 'QUEUE.1') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from springpython.jms.core import JmsTemplate | |
from springpython.jms.factory import WebSphereMQConnectionFactory | |
qm_name = 'QM.1' | |
channel = 'SVRCONN1.1' | |
host = '192.168.1.121' | |
listener_port = '1434' | |
queue1 = 'TEST.1' | |
factory = WebSphereMQConnectionFactory(qm_name, channel, host, listener_port) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
# stdlib | |
from datetime import datetime | |
# dateutil | |
from dateutil.parser import parse | |
# lxml | |
from lxml import etree |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.. | |
[profiler] | |
enabled=True | |
.. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
John Brown | |
Dixie Black |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
s = """<ns:request | |
xmlns:ns="http://example.com/ns" | |
xmlns:ns2="http://example.com/ns2"> | |
<ns:customer> | |
<ns:id>123</ns:id> | |
<ns:name type="NCHZ">John Brown</ns:name> | |
<ns2:name type="NCHZ">Dixie Black</ns2:name> | |
</ns:customer> | |
</ns:request> | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
INFO - <type 'lxml.objectify.ObjectifiedElement'> | |
INFO - 123 | |
INFO - John Brown | |
INFO - NCHZ |