"stockPrice": xsd.Element(StockPrice) }) def get_stock_price(request, gsp): print(gsp.company, gsp.datetime) sp = StockPrice(nillable=xsd.NIL) sp.prices.append(13.29) sp.prices.append(4.56) sp.prices.append(xsd.NIL) return sp get_stock_price_method = xsd.Method( function=get_stock_price, soapAction="http://code.google.com/p/soapfish/stock/get_stock_price", input="getStockPrice", output="stockPrice", operationName="GetStockPrice") SERVICE11 = soap.Service( name="StockService", targetNamespace= "http://code.google.com/p/soapfish/stock.wsdl", # WSDL targetNamespce version=soap.SOAPVersion.SOAP11, # The url were request should be send. location="http://127.0.0.1:8000/stock/soap11", schemas=[Schema], methods=[get_stock_price_method]) SERVICE12 = soap.Service( # WSDL targetNamespce
return NotifiqueLaRespuestaResponse() def ValideElServicio(request, ValideElServicio): dev = receptorclient.valide_servicio() return ValideElServicioResponse.create(dev) ############################################################################## # Methods NotifiqueLaRespuesta_method = xsd.Method( function=NotifiqueLaRespuesta, soapAction=settings.RECEPTOR_HOST + 'NotifiqueLaRespuesta', input='NotifiqueLaRespuesta', inputPartName='parameters', output='NotifiqueLaRespuestaResponse', outputPartName='parameters', operationName='NotifiqueLaRespuesta', style='document', ) ValideElServicio_method = xsd.Method( function=ValideElServicio, soapAction=settings.RECEPTOR_HOST + 'ValideElServicio', input='ValideElServicio', inputPartName='parameters', output='ValideElServicioResponse', outputPartName='parameters', operationName='ValideElServicio', style='document', )
Schema = xsd.Schema(targetNamespace='http://flightdataservices.com/ops.xsd', elementFormDefault='unqualified', simpleTypes=[Pilot], attributeGroups=[], groups=[], complexTypes=[Airport, Weight, Ops, Status], elements={ 'ops': xsd.Element('Ops'), 'status': xsd.Element('Status') }) PutOps_method = xsd.Method( soapAction='http://polaris.flightdataservices.com/ws/ops/PutOps', input='ops', # Pointer to Schema.elements inputPartName='body', output='status', # Pointer to Schema.elements outputPartName='body', operationName='PutOps') PutOpsPort_SERVICE = soap.Service( name='PutOpsPort', targetNamespace='http://flightdataservices.com/ops.wsdl', location='http://127.0.0.1:8088/mockPutOpsBinding', schema=Schema, version=soap.SOAPVersion.SOAP11, methods=[PutOps_method]) class PutOpsPortServiceStub(soap.Stub): SERVICE = PutOpsPort_SERVICE
minOccurs=0) @classmethod def create(cls): instance = cls() return instance ############################################################################## # Methods GetResponse_method = xsd.Method( soapAction='urn:GetResponse', input='GetResponseRequest', inputPartName='parameters', output='GetResponseResponse', outputPartName='parameters', operationName='GetResponse', style='document', ) GetStatus_method = xsd.Method( soapAction='urn:GetStatus', input='GetStatusRequest', inputPartName='parameters', output='GetStatusResponse', outputPartName='parameters', operationName='GetStatus', style='document', )
SoliciteLaValidacionDelCertificadoDeAutenticacionResponse()), 'ValideElServicio': xsd.Element(ValideElServicio()), 'ValideElServicioResponse': xsd.Element(ValideElServicioResponse()) }, ) ############################################################################## # Methods SoliciteLaValidacionDelCertificadoDeAutenticacion_method = xsd.Method( soapAction=settings.FVA_HOST + 'SoliciteLaValidacionDelCertificadoDeAutenticacion', input='SoliciteLaValidacionDelCertificadoDeAutenticacion', inputPartName='parameters', output='SoliciteLaValidacionDelCertificadoDeAutenticacionResponse', outputPartName='parameters', operationName='SoliciteLaValidacionDelCertificadoDeAutenticacion', style='document', ) ValideElServicio_method = xsd.Method( soapAction=settings.FVA_HOST + 'ValideElServicio', input='ValideElServicio', inputPartName='parameters', output='ValideElServicioResponse', outputPartName='parameters', operationName='ValideElServicio', style='document', )
"stockPrice": xsd.Element(StockPrice) }) def get_stock_price(request, gsp): print gsp.company, gsp.datetime sp = StockPrice(nillable=xsd.NIL) sp.prices.append(13.29) sp.prices.append(4.56) sp.prices.append(xsd.NIL) return sp get_stock_price_method = xsd.Method( function=get_stock_price, soapAction="http://code.google.com/p/soapfish/stock/get_stock_price", input="getStockPrice", output="stockPrice", operationName="GetStockPrice") SERVICE11 = soap.Service( name="StockService", targetNamespace= "http://code.google.com/p/soapfish/stock.wsdl", # WSDL targetNamespce version=SOAPVersion.SOAP11, # The url were request should be send. location="http://127.0.0.1:8000/stock/soap11", schema=Schema, methods=[get_stock_price_method]) SERVICE12 = soap.Service( # WSDL targetNamespce
attributeGroups=[], groups=[], complexTypes=[SolicitudDeFirma, RespuestaDeLaSolicitud, SolicitudDeFirmaPdf], elements={'RecibaLaSolicitudDeSelladoElectronicoXmlEnvelopedCoFirma': xsd.Element(RecibaLaSolicitudDeSelladoElectronicoXmlEnvelopedCoFirma()), 'RecibaLaSolicitudDeSelladoElectronicoXmlEnvelopedCoFirmaResponse': xsd.Element(RecibaLaSolicitudDeSelladoElectronicoXmlEnvelopedCoFirmaResponse()), 'RecibaLaSolicitudDeSelladoElectronicoXmlEnvelopedContraFirma': xsd.Element(RecibaLaSolicitudDeSelladoElectronicoXmlEnvelopedContraFirma()), 'RecibaLaSolicitudDeSelladoElectronicoXmlEnvelopedContraFirmaResponse': xsd.Element(RecibaLaSolicitudDeSelladoElectronicoXmlEnvelopedContraFirmaResponse()), 'RecibaLaSolicitudDeSelladoElectronicoMSOffice': xsd.Element(RecibaLaSolicitudDeSelladoElectronicoMSOffice()), 'RecibaLaSolicitudDeSelladoElectronicoMSOfficeResponse': xsd.Element(RecibaLaSolicitudDeSelladoElectronicoMSOfficeResponse()), 'RecibaLaSolicitudDeSelladoElectronicoPdf': xsd.Element(RecibaLaSolicitudDeSelladoElectronicoPdf()), 'RecibaLaSolicitudDeSelladoElectronicoPdfResponse': xsd.Element(RecibaLaSolicitudDeSelladoElectronicoPdfResponse()), 'RecibaLaSolicitudDeSelladoElectronicoOdf': xsd.Element(RecibaLaSolicitudDeSelladoElectronicoOdf()), 'RecibaLaSolicitudDeSelladoElectronicoOdfResponse': xsd.Element(RecibaLaSolicitudDeSelladoElectronicoOdfResponse()), 'ElServicioEstaDisponible': xsd.Element(ElServicioEstaDisponible()), 'ElServicioEstaDisponibleResponse': xsd.Element(ElServicioEstaDisponibleResponse())}, ) ############################################################################## # Methods RecibaLaSolicitudDeSelladoElectronicoXmlEnvelopedCoFirma_method = xsd.Method( soapAction=settings.FVA_HOST + 'RecibaLaSolicitudDeSelladoElectronicoXmlEnvelopedCoFirma', input='RecibaLaSolicitudDeSelladoElectronicoXmlEnvelopedCoFirma', inputPartName='parameters', output='RecibaLaSolicitudDeSelladoElectronicoXmlEnvelopedCoFirmaResponse', outputPartName='parameters', operationName='RecibaLaSolicitudDeSelladoElectronicoXmlEnvelopedCoFirma', style='document', ) RecibaLaSolicitudDeSelladoElectronicoXmlEnvelopedContraFirma_method = xsd.Method( soapAction=settings.FVA_HOST + 'RecibaLaSolicitudDeSelladoElectronicoXmlEnvelopedContraFirma', input='RecibaLaSolicitudDeSelladoElectronicoXmlEnvelopedContraFirma', inputPartName='parameters', output='RecibaLaSolicitudDeSelladoElectronicoXmlEnvelopedContraFirmaResponse', outputPartName='parameters', operationName='RecibaLaSolicitudDeSelladoElectronicoXmlEnvelopedContraFirma', style='document', )
xsd.Element(ExisteUnaSolicitudDeFirmaCompletaResponse()), 'ValideElServicio': xsd.Element(ValideElServicio()), 'ValideElServicioResponse': xsd.Element(ValideElServicioResponse()) }, ) ############################################################################## # Methods ExisteUnaSolicitudDeFirmaCompleta_method = xsd.Method( soapAction=settings.FVA_HOST + 'ExisteUnaSolicitudDeFirmaCompleta', input='ExisteUnaSolicitudDeFirmaCompleta', inputPartName='parameters', output='ExisteUnaSolicitudDeFirmaCompletaResponse', outputPartName='parameters', operationName='ExisteUnaSolicitudDeFirmaCompleta', style='document', ) ValideElServicio_method = xsd.Method( soapAction=settings.FVA_HOST + 'ValideElServicio', input='ValideElServicio', inputPartName='parameters', output='ValideElServicioResponse', outputPartName='parameters', operationName='ValideElServicio', style='document', )
'stockPrice': xsd.Element(StockPrice) }) def get_stock_price(request, gsp): print gsp.company, gsp.datetime sp = StockPrice(nillable=xsd.NIL) sp.prices.append(13.29) sp.prices.append(4.56) sp.prices.append(xsd.NIL) return sp get_stock_price_method = xsd.Method( function=get_stock_price, soapAction='http://code.google.com/p/soapfish/stock/get_stock_price', input='getStockPrice', output='stockPrice', operationName='GetStockPrice') SERVICE11 = soap.Service( name='StockService', targetNamespace= 'http://code.google.com/p/soapfish/stock.wsdl', # WSDL targetNamespce version=soap.SOAPVersion.SOAP11, # The url were request should be send. location='http://127.0.0.1:8000/stock/soap11', schemas=[Schema], methods=[get_stock_price_method]) SERVICE12 = soap.Service( # WSDL targetNamespce
return getUserPropertiesResponse def getUserDetails(request, getUserDetails): # TODO: Put your implementation here. return getUserDetailsResponse ############################################################################## # Methods getUserProperties_method = xsd.Method( function=getUserProperties, soapAction='', input='getUserProperties', inputPartName='parameters', output='getUserPropertiesResponse', outputPartName='parameters', operationName='getUserProperties', style='document', ) getUserDetails_method = xsd.Method( function=getUserDetails, soapAction='', input='getUserDetails', inputPartName='parameters', output='getUserDetailsResponse', outputPartName='parameters', operationName='getUserDetails', style='document', )
xsd.Element(ValideElDocumentoPdfResponse()), 'ValideElServicio': xsd.Element(ValideElServicio()), 'ValideElServicioResponse': xsd.Element(ValideElServicioResponse()) }, ) ############################################################################## # Methods ValideElDocumentoXmlEnvelopedCoFirma_method = xsd.Method( soapAction=settings.FVA_HOST + 'ValideElDocumentoXmlEnvelopedCoFirma', input='ValideElDocumentoXmlEnvelopedCoFirma', inputPartName='parameters', output='ValideElDocumentoXmlEnvelopedCoFirmaResponse', outputPartName='parameters', operationName='ValideElDocumentoXmlEnvelopedCoFirma', style='document', ) ValideElDocumentoXmlEnvelopedContraFirma_method = xsd.Method( soapAction=settings.FVA_HOST + 'ValideElDocumentoXmlEnvelopedContraFirma', input='ValideElDocumentoXmlEnvelopedContraFirma', inputPartName='parameters', output='ValideElDocumentoXmlEnvelopedContraFirmaResponse', outputPartName='parameters', operationName='ValideElDocumentoXmlEnvelopedContraFirma', style='document', )
Schema = xsd.Schema(targetNamespace="http://flightdataservices.com/ops.xsd", elementFormDefault="unqualified", simpleTypes=[Pilot], attributeGroups=[], groups=[], complexTypes=[Airport, Weight, Ops, Status], elements={ "ops": xsd.Element("Ops"), "status": xsd.Element("Status") }) PutOps_method = xsd.Method( soapAction="http://polaris.flightdataservices.com/ws/ops/PutOps", input="ops", # Pointer to Schema.elements inputPartName="body", output="status", # Pointer to Schema.elements outputPartName="body", operationName="PutOps") PutOpsPort_SERVICE = soap.Service( name="PutOpsPort", targetNamespace="http://flightdataservices.com/ops.wsdl", location="http://127.0.0.1:8088/mockPutOpsBinding", schema=Schema, version=soap.SOAPVersion.SOAP11, methods=[PutOps_method]) class PutOpsPortServiceStub(soap.Stub): SERVICE = PutOpsPort_SERVICE
# FIXME 自分のものに差し替え # TODO: Put your implementation here. # return ResponseInterface return ResponseInterface( returnMessage=f'Hello, {RequestInterface.userName}') ############################################################################## # Methods requestMessage_method = xsd.Method( function=requestMessage, soapAction='http://example.com/HelloWorld/requestMessage', input='RequestInterface', inputPartName='parameters', output='ResponseInterface', outputPartName='parameters', operationName='requestMessage', ) ############################################################################## # SOAP Service HelloServicePort_SERVICE = soap.Service( name='HelloServicePort', targetNamespace='http://example.com/HelloWorld', # FIXME 自分の設定へと修正 location='http://localhost/hello', # location='${scheme}://${host}/hello',
fid = user.id users = Users() for i in range(0, 10): uu = User(name="Sandro - {}".format(i), city="São Paulo", email="*****@*****.**", mobile="11991504030", address="Rua xpto", cep="013312000", neighborhood="jd america", numb="11") users.user.append(uu) # user.nnn = 'dasasd' return users get_user_method = xsd.Method(function=get_user, soapAction="http://next.me/user/get_user", input="getUser", output="users", operationName="http://next.me/user") SERVICE = soap.Service( name="NextUser", targetNamespace="http://next.me/user.wsdl", # WSDL targetNamespce version=soap.SOAPVersion.SOAP11, # location="http://test-api.next.me:5000/user", location="http://127.0.0.1:5000/user", schemas=[Schema], methods=[get_user_method])
complexTypes=[SolicitudDeAutenticacion, ExtensionDataObject, RespuestaDeLaSolicitud, InformacionSuscriptorDesconectado], elements={'RecibaLaSolicitudDeAutenticacion': xsd.Element(RecibaLaSolicitudDeAutenticacion()), 'RecibaLaSolicitudDeAutenticacionResponse': xsd.Element( RecibaLaSolicitudDeAutenticacionResponse()), 'ValideElServicio': xsd.Element(ValideElServicio()), 'ValideElServicioResponse': xsd.Element(ValideElServicioResponse())}, ) ############################################################################## # Methods RecibaLaSolicitudDeAutenticacion_method = xsd.Method( soapAction=settings.FVA_HOST + 'RecibaLaSolicitudDeAutenticacion', input='RecibaLaSolicitudDeAutenticacion', inputPartName='parameters', output='RecibaLaSolicitudDeAutenticacionResponse', outputPartName='parameters', operationName='RecibaLaSolicitudDeAutenticacion', style='document', ) ValideElServicio_method = xsd.Method( soapAction=settings.FVA_HOST + 'ValideElServicio', input='ValideElServicio', inputPartName='parameters', output='ValideElServicioResponse', outputPartName='parameters', operationName='ValideElServicio', style='document', )
_msg = 'SOAP Internal ERROR: {}'.format(e) logger.error(_msg) return SystemException() if not res: logger.warn('The user [{}] does not exists'.format(user_id)) return UserNotFoundException() user = User(**res) logger.debug('User [{}] found'.format(user)) return user get_user_details_method = xsd.Method( function=get_user_details, soapAction='{}/soap/user_registry/get_user_details'.format(settings.FQDN), input='getUser', # inputPartName='parameters', output='User', # outputPartName='parameters', operationName='GetUser', # style='document' ) UserRegistrySoapService = soap.Service( name = 'UserRegistrySoapPort', targetNamespace='{}/soap/user_registry.wsdl'.format(settings.FQDN), location='{}/soap/user_registry'.format(settings.FQDN), # where request should be sent. schemas=[Schema_User, # Schema_UserNotFoundException, # Schema_SystemException ], # version=soap.SOAPVersion.SOAP11,