IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 32070


Ignore:
Timestamp:
Aug 10, 2011, 11:45:02 AM (15 years ago)
Author:
rhenders
Message:

now calling stripped-down version of old Perl script to poll ODM

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippToPsps/jython/pollOdm.py

    r32029 r32070  
    11#!/usr/bin/env jython
    22
     3from subprocess import call, PIPE, Popen
     4import tempfile
     5import logging.config
     6from pslogger import PSLogger
     7
     8
     9# set up logging
     10logging.config.fileConfig("logging.conf")
     11logging.setLoggerClass(PSLogger)
     12logger = logging.getLogger("pollODM")
     13logger.setLevel(logging.INFO)
     14
     15
     16
     17tempFile = tempfile.NamedTemporaryFile(mode='w+b')
     18
     19p = Popen("../perl/checkOdmStatus.pl -b B00117239 -f " + tempFile.name, shell=True, stdout=PIPE)
     20p.wait()
     21
     22if p.returncode != 0:
     23   logger.errorPair("ODM polling", "failed")
     24else:
     25   logger.infoPair("ODM polling", "successful")
     26
     27
     28tempFile.close()
     29
     30
     31
     32'''
    333from javax.xml.soap import *
    434from javax.xml.namespace import QName
    535from java.util import Iterator
    636from java.net import URL
     37
     38
    739
    840mf = MessageFactory.newInstance()
     
    1143soapEnvelope = soapPart.getEnvelope()
    1244soapBody = soapEnvelope.getBody()
     45soapFactory  = SOAPFactory.newInstance()
     46bodyName = soapFactory.createName("GetBatchStatus","","")
     47body = soapEnvelope.getBody()
     48bodyElement = body.addBodyElement(bodyName)
     49                                                                         
    1350
    14 soapMessage.getMimeHeaders().addHeader("GetBatchStatus", "PanSTARRS.Services.OdmWebService")
    1551
    16 soapBody.addChildElement("batchNameFilter").addTextNode("%B00117239")
    17 soapBody.addChildElement("statusFilter").addTextNode("*")
    18 soapBody.addChildElement("fromFilter").addTextNode("2010-01-01")
    19 soapBody.addChildElement("toFilter").addTextNode("2099-01-01")
     52
     53
     54
     55
     56
     57
     58
     59
     60
     61#soapMessage.getMimeHeaders().addHeader("GetBatchStatus", "")
     62
     63bodyElement.addChildElement("batchNameFilter").addTextNode("%B00117239")
     64bodyElement.addChildElement("statusFilter").addTextNode("*")
     65bodyElement.addChildElement("fromFilter").addTextNode("2010-01-01")
     66bodyElement.addChildElement("toFilter").addTextNode("2099-01-01")
    2067
    2168soapMessage.saveChanges()
     69
     70
    2271
    2372connectionFactory = SOAPConnectionFactory.newInstance()
     
    2978try:
    3079    resp = soapConnection.call(soapMessage, url)
    31     print resp
     80    print "RESPNSE" +  resp
    3281except:
    3382    print "dsdsds"
    3483
    3584soapConnection.close();
    36 
     85'''
Note: See TracChangeset for help on using the changeset viewer.