本文整理汇总了Python中pysimplesoap.client.SoapClient.sendMedicamentosDHSerie方法的典型用法代码示例。如果您正苦于以下问题:Python SoapClient.sendMedicamentosDHSerie方法的具体用法?Python SoapClient.sendMedicamentosDHSerie怎么用?Python SoapClient.sendMedicamentosDHSerie使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pysimplesoap.client.SoapClient
的用法示例。
在下文中一共展示了SoapClient.sendMedicamentosDHSerie方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: TestTrazamed
# 需要导入模块: from pysimplesoap.client import SoapClient [as 别名]
# 或者: from pysimplesoap.client.SoapClient import sendMedicamentosDHSerie [as 别名]
class TestTrazamed(unittest.TestCase):
internal = 1
def setUp(self):
self.client = SoapClient(
wsdl=WSDL, cache=None, ns="tzmed", soap_ns="soapenv", soap_server="jetty"
) # needed to handle list
# fix location (localhost:9050 is erroneous in the WSDL)
self.client.services["IWebServiceService"]["ports"]["IWebServicePort"]["location"] = LOCATION
# Set WSSE security credentials
if False:
# deprecated, do not use in new code! (just for testing)
self.client["wsse:Security"] = {
"wsse:UsernameToken": {"wsse:Username": "testwservice", "wsse:Password": "testwservicepsw"}
}
else:
# new recommended style using plugins
wsse_token = UsernameToken(username="testwservice", password="testwservicepsw")
self.client.plugins.append(wsse_token)
def test_send_medicamentos(self):
# self.client.help("sendMedicamentos")
# Create the complex type (medicament data transfer object):
medicamentosDTO = dict(
f_evento=datetime.datetime.now().strftime("%d/%m/%Y"),
h_evento=datetime.datetime.now().strftime("%H:%M"),
gln_origen="9999999999918",
gln_destino="glnws",
n_remito="1234",
n_factura="1234",
vencimiento=(datetime.datetime.now() + datetime.timedelta(30)).strftime("%d/%m/%Y"),
gtin="GTIN1",
lote=datetime.datetime.now().strftime("%Y"),
numero_serial=int(time.time()),
id_obra_social=None,
id_evento=134,
cuit_origen="20267565393",
cuit_destino="20267565393",
apellido="Reingart",
nombres="Mariano",
tipo_documento="96",
n_documento="26756539",
sexo="M",
direccion="Saraza",
numero="1234",
piso="",
depto="",
localidad="Hurlingham",
provincia="Buenos Aires",
n_postal="1688",
fecha_nacimiento="01/01/2000",
telefono="5555-5555",
)
# Call the webservice to inform a medicament:
res = self.client.sendMedicamentos(arg0=medicamentosDTO, arg1="pruebasws", arg2="pruebasws")
# Analyze the response:
ret = res["return"]
self.assertIsInstance(ret["codigoTransaccion"], basestring)
self.assertEqual(ret["resultado"], True)
def test_send_medicamentos_dh_serie(self):
self.client.help("sendMedicamentosDHSerie")
# Create the complex type (medicament data transfer object):
medicamentosDTODHSerie = dict(
f_evento=datetime.datetime.now().strftime("%d/%m/%Y"),
h_evento=datetime.datetime.now().strftime("%H:%M"),
gln_origen="9999999999918",
gln_destino="glnws",
n_remito="1234",
n_factura="1234",
vencimiento=(datetime.datetime.now() + datetime.timedelta(30)).strftime("%d/%m/%Y"),
gtin="GTIN1",
lote=datetime.datetime.now().strftime("%Y"),
desde_numero_serial=int(time.time()) + 1,
hasta_numero_serial=int(time.time()) - 1,
id_obra_social=None,
id_evento=134,
)
# Call the webservice to inform a medicament:
res = self.client.sendMedicamentosDHSerie(arg0=medicamentosDTODHSerie, arg1="pruebasws", arg2="pruebasws")
# Analyze the response:
ret = res["return"]
# Check the results:
self.assertIsInstance(ret["codigoTransaccion"], basestring)
self.assertEqual(ret["errores"][0]["_c_error"], "3004")
self.assertEqual(
ret["errores"][0]["_d_error"], "El campo Hasta Nro Serial debe ser mayor o igual al campo Desde Nro Serial."
)
self.assertEqual(ret["resultado"], False)
#.........这里部分代码省略.........
示例2: TestTrazamed
# 需要导入模块: from pysimplesoap.client import SoapClient [as 别名]
# 或者: from pysimplesoap.client.SoapClient import sendMedicamentosDHSerie [as 别名]
class TestTrazamed(unittest.TestCase):
internal = 1
def setUp(self):
self.client = SoapClient(
wsdl=WSDL,
cache=None,
ns="tzmed",
soap_ns="soapenv",
#soap_server="jbossas6",
trace="--trace" in sys.argv)
# fix location (localhost:9050 is erroneous in the WSDL)
self.client.services['IWebServiceService']['ports']['IWebServicePort']['location'] = LOCATION
# Set WSSE security credentials
self.client['wsse:Security'] = {
'wsse:UsernameToken': {
'wsse:Username': 'testwservice',
'wsse:Password': 'testwservicepsw',
}
}
def test_send_medicamentos(self):
self.client.help("sendMedicamentos")
res = self.client.sendMedicamentos(
arg0={'f_evento': "25/11/2011",
'h_evento': "04:24",
'gln_origen': "glnws",
'gln_destino': "glnws",
'n_remito': "1234",
'n_factura': "1234",
'vencimiento': "30/11/2011",
'gtin': "GTIN1",
'lote': "1111",
'numero_serial': "12345",
'id_obra_social': 1,
'id_evento': 133,
'cuit_origen': "20267565393",
'cuit_destino': "20267565393",
'apellido': "Reingart",
'nombres': "Mariano",
'tipo_docmento': "96",
'n_documento': "26756539",
'sexo': "M",
'direccion': "Saraza",
'numero': "1234",
'piso': "",
'depto': "",
'localidad': "Hurlingham",
'provincia': "Buenos Aires",
'n_postal': "B1688FDD",
'fecha_nacimiento': "01/01/2000",
'telefono': "5555-5555",
},
arg1='pruebasws',
arg2='pruebasws',
)
ret = res['return']
self.assertEqual(ret[0]['codigoTransaccion'], None)
self.assertEqual(ret[1]['errores']['_c_error'], '3019')
self.assertEqual(ret[1]['errores']['_d_error'], "No ha informado la recepcion del medicamento que desea enviar.")
self.assertEqual(ret[-1]['resultado'], False)
def test_send_medicamentos_dh_serie(self):
self.client.help("sendMedicamentosDHSerie")
res = self.client.sendMedicamentosDHSerie(
arg0={'f_evento': "25/11/2011",
'h_evento': "04:24",
'gln_origen': "glnws",
'gln_destino': "glnws",
'n_remito': "1234",
'n_factura': "1234",
'vencimiento': "30/11/2011",
'gtin': "GTIN1",
'lote': "1111",
'desde_numero_serial': 2,
'hasta_numero_serial': 1,
'id_obra_social': 1,
'id_evento': 133,
'cuit_origen': "20267565393",
'cuit_destino': "20267565393",
'apellido': "Reingart",
'nombres': "Mariano",
'tipo_docmento': "96",
'n_documento': "26756539",
'sexo': "M",
'direccion': "Saraza",
'numero': "1234",
'piso': "",
'depto': "",
'localidad': "Hurlingham",
'provincia': "Buenos Aires",
'n_postal': "B1688FDD",
'fecha_nacimiento': "01/01/2000",
'telefono': "5555-5555",
},
#.........这里部分代码省略.........
示例3: __init__
# 需要导入模块: from pysimplesoap.client import SoapClient [as 别名]
# 或者: from pysimplesoap.client.SoapClient import sendMedicamentosDHSerie [as 别名]
#.........这里部分代码省略.........
params = { 'f_evento': f_evento,
'h_evento': h_evento,
'gln_origen': gln_origen,
'gln_destino': gln_destino,
'n_remito': n_remito,
'n_factura': n_factura,
'vencimiento': vencimiento,
'gtin': gtin,
'lote': lote,
'desde_numero_serial': desde_numero_serial,
'hasta_numero_serial': hasta_numero_serial,
'id_obra_social': id_obra_social or None,
'id_evento': id_evento,
'cuit_origen': cuit_origen,
'cuit_destino': cuit_destino,
'apellido': apellido,
'nombres': nombres,
'tipo_documento': tipo_documento,
'n_documento': n_documento,
'sexo': sexo,
'direccion': direccion,
'numero': numero,
'piso': piso,
'depto': depto,
'localidad': localidad,
'provincia': provincia,
'n_postal': n_postal,
'fecha_nacimiento': fecha_nacimiento,
'telefono': telefono,
'nro_asociado': nro_asociado,
}
# actualizo con parámetros generales:
params.update(self.params)
res = self.client.sendMedicamentosDHSerie(
arg0=params,
arg1=usuario,
arg2=password,
)
ret = res['return']
self.CodigoTransaccion = ret['codigoTransaccion']
self.__analizar_errores(ret)
return True
@inicializar_y_capturar_excepciones
def SendCancelacTransacc(self, usuario, password, codigo_transaccion):
" Realiza la cancelación de una transacción"
res = self.client.sendCancelacTransacc(
arg0=codigo_transaccion,
arg1=usuario,
arg2=password,
)
ret = res['return']
self.CodigoTransaccion = ret['codigoTransaccion']
self.__analizar_errores(ret)
return True
@inicializar_y_capturar_excepciones
def SendCancelacTransaccParcial(self, usuario, password, codigo_transaccion,
gtin_medicamento=None, numero_serial=None):
" Realiza la cancelación parcial de una transacción"
示例4: TestTrazamed
# 需要导入模块: from pysimplesoap.client import SoapClient [as 别名]
# 或者: from pysimplesoap.client.SoapClient import sendMedicamentosDHSerie [as 别名]
class TestTrazamed(unittest.TestCase):
def setUp(self):
self.client = SoapClient(
wsdl = WSDL,
cache = None,
ns="tzmed",
soap_ns="soapenv",
soap_server="jetty", # needed to handle list
trace = "--trace" in sys.argv)
# fix location (localhost:9050 is erroneous in the WSDL)
self.client.services['IWebServiceService']['ports']['IWebServicePort']['location'] = LOCATION
# Set WSSE security credentials
self.client['wsse:Security'] = {
'wsse:UsernameToken': {
'wsse:Username': 'testwservice',
'wsse:Password': 'testwservicepsw',
}
}
def test_send_medicamentos(self):
#self.client.help("sendMedicamentos")
# Create the complex type (medicament data transfer object):
medicamentosDTO = dict(
f_evento=datetime.datetime.now().strftime("%d/%m/%Y"),
h_evento=datetime.datetime.now().strftime("%H:%M"),
gln_origen="9999999999918", gln_destino="glnws",
n_remito="1234", n_factura="1234",
vencimiento=(datetime.datetime.now() +
datetime.timedelta(30)).strftime("%d/%m/%Y"),
gtin="GTIN1", lote=datetime.datetime.now().strftime("%Y"),
numero_serial=int(time.time()),
id_obra_social=None, id_evento=134,
cuit_origen="20267565393", cuit_destino="20267565393",
apellido="Reingart", nombres="Mariano",
tipo_docmento="96", n_documento="26756539", sexo="M",
direccion="Saraza", numero="1234", piso="", depto="",
localidad="Hurlingham", provincia="Buenos Aires",
n_postal="1688", fecha_nacimiento="01/01/2000",
telefono="5555-5555",
)
# Call the webservice to inform a medicament:
res = self.client.sendMedicamentos(
arg0=medicamentosDTO,
arg1='pruebasws',
arg2='pruebasws',
)
# Analyze the response:
ret = res['return']
self.assertIsInstance(ret['codigoTransaccion'], unicode)
self.assertEqual(ret['resultado'], True)
def test_send_medicamentos_dh_serie(self):
self.client.help("sendMedicamentosDHSerie")
# Create the complex type (medicament data transfer object):
medicamentosDTODHSerie = dict(
f_evento=datetime.datetime.now().strftime("%d/%m/%Y"),
h_evento=datetime.datetime.now().strftime("%H:%M"),
gln_origen="9999999999918", gln_destino="glnws",
n_remito="1234", n_factura="1234",
vencimiento=(datetime.datetime.now() +
datetime.timedelta(30)).strftime("%d/%m/%Y"),
gtin="GTIN1", lote=datetime.datetime.now().strftime("%Y"),
desde_numero_serial=10,
hasta_numero_serial=0,
id_obra_social=None, id_evento=134,
)
# Call the webservice to inform a medicament:
res = self.client.sendMedicamentosDHSerie(
arg0=medicamentosDTODHSerie,
arg1='pruebasws',
arg2='pruebasws',
)
# Analyze the response:
ret = res['return']
# Check the results:
self.assertIsInstance(ret['codigoTransaccion'], unicode)
self.assertEqual(ret['errores'][0]['_c_error'], '3004')
self.assertEqual(ret['errores'][0]['_d_error'], "El campo Hasta Nro Serial debe ser mayor o igual al campo Desde Nro Serial.")
self.assertEqual(ret['resultado'], False)
def test_get_transacciones_no_confirmadas(self):
# Call the webservice to query all the un-confirmed transactions:
res = self.client.getTransaccionesNoConfirmadas(
arg0='pruebasws',
arg1='pruebasws',
)
# Analyze the response:
#.........这里部分代码省略.........
示例5: TestTrazamed
# 需要导入模块: from pysimplesoap.client import SoapClient [as 别名]
# 或者: from pysimplesoap.client.SoapClient import sendMedicamentosDHSerie [as 别名]
class TestTrazamed(unittest.TestCase):
def setUp(self):
self.client = SoapClient(
wsdl=WSDL,
cache=None,
ns="tzmed",
soap_ns="soapenv",
# soap_server="jbossas6",
trace="--trace" in sys.argv,
)
# fix location (localhost:9050 is erroneous in the WSDL)
self.client.services["IWebServiceService"]["ports"]["IWebServicePort"]["location"] = LOCATION
# Set WSSE security credentials
self.client["wsse:Security"] = {
"wsse:UsernameToken": {"wsse:Username": "testwservice", "wsse:Password": "testwservicepsw"}
}
def test_send_medicamentos(self):
self.client.help("sendMedicamentos")
res = self.client.sendMedicamentos(
arg0={
"f_evento": "25/11/2011",
"h_evento": "04:24",
"gln_origen": "glnws",
"gln_destino": "glnws",
"n_remito": "1234",
"n_factura": "1234",
"vencimiento": "30/11/2011",
"gtin": "GTIN1",
"lote": "1111",
"numero_serial": "12345",
"id_obra_social": 1,
"id_evento": 133,
"cuit_origen": "20267565393",
"cuit_destino": "20267565393",
"apellido": "Reingart",
"nombres": "Mariano",
"tipo_docmento": "96",
"n_documento": "26756539",
"sexo": "M",
"direccion": "Saraza",
"numero": "1234",
"piso": "",
"depto": "",
"localidad": "Hurlingham",
"provincia": "Buenos Aires",
"n_postal": "B1688FDD",
"fecha_nacimiento": "01/01/2000",
"telefono": "5555-5555",
},
arg1="pruebasws",
arg2="pruebasws",
)
ret = res["return"]
self.assertEqual(ret[0]["codigoTransaccion"], None)
self.assertEqual(ret[1]["errores"]["_c_error"], "3019")
self.assertEqual(
ret[1]["errores"]["_d_error"], "No ha informado la recepcion del medicamento que desea enviar."
)
self.assertEqual(ret[-1]["resultado"], False)
def test_send_medicamentos_dh_serie(self):
self.client.help("sendMedicamentosDHSerie")
res = self.client.sendMedicamentosDHSerie(
arg0={
"f_evento": "25/11/2011",
"h_evento": "04:24",
"gln_origen": "glnws",
"gln_destino": "glnws",
"n_remito": "1234",
"n_factura": "1234",
"vencimiento": "30/11/2011",
"gtin": "GTIN1",
"lote": "1111",
"desde_numero_serial": 2,
"hasta_numero_serial": 1,
"id_obra_social": 1,
"id_evento": 133,
"cuit_origen": "20267565393",
"cuit_destino": "20267565393",
"apellido": "Reingart",
"nombres": "Mariano",
"tipo_docmento": "96",
"n_documento": "26756539",
"sexo": "M",
"direccion": "Saraza",
"numero": "1234",
"piso": "",
"depto": "",
"localidad": "Hurlingham",
"provincia": "Buenos Aires",
"n_postal": "B1688FDD",
"fecha_nacimiento": "01/01/2000",
"telefono": "5555-5555",
},
#.........这里部分代码省略.........