<commit_before>package edu.iu.grid.oim.lib;

import java.io.InputStream;
import java.sql.SQLException;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;

import javax.mail.MessagingException;
import javax.xml.soap.*;

import org.apache.log4j.Logger;

import edu.iu.grid.oim.model.Context;
import edu.iu.grid.oim.model.db.record.ContactRecord;
import edu.iu.grid.oim.view.HtmlFileView;
import edu.iu.grid.oim.view.divrep.ResourceDowntimeEditor;

public class Footprint 
{
    static Logger log = Logger.getLogger(Footprint.class); 
    
	Context context;
	
	SOAPBody body;
	SOAPEnvelope env;
	SOAPConnection connection;
	SOAPMessage msg;
	
	public Footprint(Context _context)
	{
		context = _context;
		
		//using program listed here > http://blogs.sun.com/andreas/entry/no_more_unable_to_find
		//to create the trusted keystore
		System.setProperty("javax.net.ssl.trustStore", StaticConfig.getSSLTrustStorePath());
		
        //Init SOAP
		try {
			SOAPConnectionFactory scf = SOAPConnectionFactory.newInstance();
	        connection = scf.createConnection();
	        MessageFactory msgFactory = MessageFactory.newInstance();
	        msg = msgFactory.createMessage();
	        env = msg.getSOAPPart().getEnvelope();
	        env.addNamespaceDeclaration( "xsi", "http://www.w3.org/1999/XMLSchema-instance" );
	        env.addNamespaceDeclaration( "xsd", "http://www.w3.org/1999/XMLSchema" );
	        env.addNamespaceDeclaration( "namesp2", "http://xml.apache.org/xml-soap" );
	        env.addNamespaceDeclaration( "SOAP-ENC", "http://schemas.xmlsoap.org/soap/encoding/" );
	        body = env.getBody();
		} catch (UnsupportedOperationException e) {
			log.error("Failed to initialize Footprint object", e);
		} catch (SOAPException e) {
			log.error("Failed to initialize Footprint object", e);
		}
	}

	public void createNewResourceTicket(String resource_name, String sc_footprint_id, String vo_name)
	{
		HashMap<String, String> params = new HashMap<String, String>();
		params.put("##RESOURCE_NAME##", resource_name);
		HtmlFileView description = new HtmlFileView("footprints_new_resource_template.txt", params);
		
		try
        {
            SOAPElement invoke = body.addChildElement( env.createName("MRWebServices__createIssue_goc", "namesp1",StaticConfig.getFootprintsUri()) );
            
            // root parameters user/pass/extra/args
            SOAPElement username = invoke.addChildElement( env.createName("user") );
            username.addAttribute( env.createName("type","xsi",""), "xsd:string" );
            username.addTextNode(StaticConfig.getFootprintsUsername());
            
            SOAPElement password = invoke.addChildElement( env.createName("password") );
            password.addAttribute( env.createName("type","xsi",""), "xsd:string" );
            password.addTextNode(StaticConfig.getFootprintsPassword());
            
            SOAPElement extra_info = invoke.addChildElement( env.createName("extrainfo") );
            extra_info.addAttribute( env.createName("type","xsi",""), "xsd:string" );
            
            SOAPElement args = invoke.addChildElement( env.createName("args") );
            args.addAttribute( env.createName("type","xsi",""), "namesp2:SOAPStruct" );
            
            //Contat Information
            SOAPElement abfields = args.addChildElement( env.createName("abfields") );
            abfields.addAttribute( env.createName("type","xsi",""), "namesp2:SOAPStruct" );
            
            ContactRecord contact = context.getAuthorization().getContact();
            SOAPElement arg4_3_2 = abfields.addChildElement( env.createName("Last__bName") );
            arg4_3_2.addAttribute( env.createName("type","xsi",""), "xsd:string" );
            arg4_3_2.addTextNode(contact.getLastName());
            
            SOAPElement arg4_3_3 = abfields.addChildElement( env.createName("First__bName") );
            arg4_3_3.addAttribute( env.createName("type","xsi",""), "xsd:string" );
            arg4_3_3.addTextNode(contact.getFirstName());
            
            SOAPElement arg4_3_4 = abfields.addChildElement( env.createName("Email__baddress") );
            arg4_3_4.addAttribute( env.createName("type","xsi",""), "xsd:string" );
            arg4_3_4.addTextNode(contact.primary_email);
            
            SOAPElement arg4_3_5 = abfields.addChildElement( env.createName("Office__bPhone") );
            arg4_3_5.addAttribute( env.createName("type","xsi",""), "xsd:string" );
            arg4_3_5.addTextNode(contact.primary_phone);

            //Basic Information
            SOAPElement arg4_7 = args.addChildElement( env.createName("projectID") );
            arg4_7.addAttribute( env.createName("type","xsi",""), "xsd:int" );
            arg4_7.addTextNode(StaticConfig.getFootprintsProjectID().toString());       
            SOAPElement arg4_9 = args.addChildElement( env.createName("submitter") );
            arg4_9.addAttribute( env.createName("type","xsi",""), "xsd:string" );
            arg4_9.addTextNode("OSG-GOC");
            
            SOAPElement arg4_8 = args.addChildElement( env.createName("title") );
            arg4_8.addAttribute( env.createName("type","xsi",""), "xsd:string" );
            arg4_8.addTextNode("OIM Resource Registration - " + resource_name);
            
            SOAPElement arg4_1 = args.addChildElement( env.createName("priorityNumber") );
            arg4_1.addAttribute( env.createName("type","xsi",""), "xsd:int" );
            arg4_1.addTextNode("4");
            
            SOAPElement arg4_4 = args.addChildElement( env.createName("description") );
            arg4_4.addAttribute( env.createName("type","xsi",""), "xsd:string" );
            arg4_4.addTextNode(description.toString());

            SOAPElement arg4_5 = args.addChildElement( env.createName("assignees") );
            arg4_5.addAttribute( env.createName("type","xsi",""), "SOAP-ENC:Array" );
            arg4_5.addAttribute( env.createName("arrayType","SOAP-ENC",""), "xsd:string[3]" );//CHANGE [1] to [n] based on the number of items
            
	            SOAPElement arg4_5_1 = arg4_5.addChildElement( env.createName("item") );
	            arg4_5_1.addAttribute( env.createName("type","xsi",""), "xsd:string" );
	            arg4_5_1.addTextNode("kagross");
	            
	            SOAPElement arg4_5_2 = arg4_5.addChildElement( env.createName("item") );
	            arg4_5_2.addAttribute( env.createName("type","xsi",""), "xsd:string" );
	            arg4_5_2.addTextNode("echism");
	            
	            //assign the associated SC so that they will be notified of this resource registration
	            SOAPElement arg4_5_3 = arg4_5.addChildElement( env.createName("item") );
	            arg4_5_3.addAttribute( env.createName("type","xsi",""), "xsd:string" );
	            arg4_5_3.addTextNode(sc_footprint_id);
	            
            SOAPElement ccs = args.addChildElement( env.createName("permanentCCs") );
            ccs.addAttribute( env.createName("type","xsi",""), "SOAP-ENC:Array" );
            ccs.addAttribute( env.createName("arrayType","SOAP-ENC",""), "xsd:string[3]" );//CHANGE [1] to [n] based on the number of items
            
	            SOAPElement cc1 = ccs.addChildElement( env.createName("item") );
	            cc1.addAttribute( env.createName("type","xsi",""), "xsd:string" );
	            cc1.addTextNode("<EMAIL>");
	            
	            SOAPElement cc2 = ccs.addChildElement( env.createName("item") );
	            cc2.addAttribute( env.createName("type","xsi",""), "xsd:string" );
	            cc2.addTextNode("<EMAIL>");
	            
	            SOAPElement cc3 = ccs.addChildElement( env.createName("item") );
	            cc3.addAttribute( env.createName("type","xsi",""), "xsd:string" );
	            cc3.addTextNode("<EMAIL>");   
        
            //project fields
            SOAPElement projfields = args.addChildElement( env.createName("projfields") );
            projfields.addAttribute( env.createName("type","xsi",""), "namesp2:SOAPStruct" );
            
            SOAPElement orig_vo = projfields.addChildElement( env.createName("Originating__bVO__bSupport__bCenter") );
            orig_vo.addAttribute( env.createName("type","xsi",""), "xsd:string" );
            orig_vo.addTextNode("MIS");
            
            SOAPElement dest_vo = projfields.addChildElement( env.createName("Destination__bVO__bSupport__bCenter") );
            dest_vo.addAttribute( env.createName("type","xsi",""), "xsd:string" );
            if(vo_name == null) {
            	dest_vo.addTextNode("MIS");
            } else {
            	dest_vo.addTextNode(vo_name);
            }
            
            SOAPElement next_action = projfields.addChildElement( env.createName("ENG__bNext__bAction__bItem") );
            next_action.addAttribute( env.createName("type","xsi",""), "xsd:string" );
            next_action.addTextNode("Verify Information and Add to Ops Meeting Agenda");
            
            SOAPElement nad = projfields.addChildElement( env.createName("ENG__bNext__bAction__bDate__fTime__b__PUTC__p") );
            nad.addAttribute( env.createName("type","xsi",""), "xsd:string" );
            SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");  
            nad.addTextNode(format.format(new Date()));            
            
            SOAPElement type = projfields.addChildElement( env.createName("Ticket__uType") );
            type.addAttribute( env.createName("type","xsi",""), "xsd:string" );
            type.addTextNode("Problem__fRequest");  
            
            SOAPElement arg4_2 = args.addChildElement( env.createName("status") );
            arg4_2.addAttribute( env.createName("type","xsi",""), "xsd:string" );
            arg4_2.addTextNode("Engineering");
            msg.saveChanges();

            call();
        } catch(Exception e) {
			log.error("Failed to create resource ticket: ", e);
		}
	}
	
	public void createNewSCTicket(String sc_name)
	{		
		HashMap<String, String> params = new HashMap<String, String>();
		params.put("##SC_NAME##", sc_name);
		HtmlFileView description = new HtmlFileView("footprints_new_sc_template.txt", params);
		
		try
        {
            SOAPElement invoke = body.addChildElement( env.createName("MRWebServices__createIssue_goc", "namesp1",StaticConfig.getFootprintsUri()) );
            
            // root parameters user/pass/extra/args
            SOAPElement username = invoke.addChildElement( env.createName("user") );
            username.addAttribute( env.createName("type","xsi",""), "xsd:string" );
            username.addTextNode(StaticConfig.getFootprintsUsername());
            
            SOAPElement password = invoke.addChildElement( env.createName("password") );
            password.addAttribute( env.createName("type","xsi",""), "xsd:string" );
            password.addTextNode(StaticConfig.getFootprintsPassword());
            
            SOAPElement extra_info = invoke.addChildElement( env.createName("extrainfo") );
            extra_info.addAttribute( env.createName("type","xsi",""), "xsd:string" );
            
            SOAPElement args = invoke.addChildElement( env.createName("args") );
            args.addAttribute( env.createName("type","xsi",""), "namesp2:SOAPStruct" );
            
            //Contat Information
            SOAPElement abfields = args.addChildElement( env.createName("abfields") );
            abfields.addAttribute( env.createName("type","xsi",""), "namesp2:SOAPStruct" );
            
            ContactRecord contact = context.getAuthorization().getContact();
            SOAPElement arg4_3_2 = abfields.addChildElement( env.createName("Last__bName") );
            arg4_3_2.addAttribute( env.createName("type","xsi",""), "xsd:string" );
            arg4_3_2.addTextNode(contact.getLastName());
            
            SOAPElement arg4_3_3 = abfields.addChildElement( env.createName("First__bName") );
            arg4_3_3.addAttribute( env.createName("type","xsi",""), "xsd:string" );
            arg4_3_3.addTextNode(contact.getFirstName());
            
            SOAPElement arg4_3_4 = abfields.addChildElement( env.createName("Email__baddress") );
            arg4_3_4.addAttribute( env.createName("type","xsi",""), "xsd:string" );
            arg4_3_4.addTextNode(contact.primary_email);
            
            SOAPElement arg4_3_5 = abfields.addChildElement( env.createName("Office__bPhone") );
            arg4_3_5.addAttribute( env.createName("type","xsi",""), "xsd:string" );
            arg4_3_5.addTextNode(contact.primary_phone);

            //Basic Information
            SOAPElement arg4_7 = args.addChildElement( env.createName("projectID") );
            arg4_7.addAttribute( env.createName("type","xsi",""), "xsd:int" );
            arg4_7.addTextNode(StaticConfig.getFootprintsProjectID().toString());       
            SOAPElement arg4_9 = args.addChildElement( env.createName("submitter") );
            arg4_9.addAttribute( env.createName("type","xsi",""), "xsd:string" );
            arg4_9.addTextNode("OSG-GOC");
            
            SOAPElement arg4_8 = args.addChildElement( env.createName("title") );
            arg4_8.addAttribute( env.createName("type","xsi",""), "xsd:string" );
            arg4_8.addTextNode("OIM SC Registration - " + sc_name);
            
            SOAPElement arg4_1 = args.addChildElement( env.createName("priorityNumber") );
            arg4_1.addAttribute( env.createName("type","xsi",""), "xsd:int" );
            arg4_1.addTextNode("4");
            
            SOAPElement arg4_4 = args.addChildElement( env.createName("description") );
            arg4_4.addAttribute( env.createName("type","xsi",""), "xsd:string" );
            arg4_4.addTextNode(description.toString());

            SOAPElement arg4_5 = args.addChildElement( env.createName("assignees") );
            arg4_5.addAttribute( env.createName("type","xsi",""), "SOAP-ENC:Array" );
            arg4_5.addAttribute( env.createName("arrayType","SOAP-ENC",""), "xsd:string[2]" );//CHANGE [1] to [n] based on the number of items
            
	            SOAPElement arg4_5_1 = arg4_5.addChildElement( env.createName("item") );
	            arg4_5_1.addAttribute( env.createName("type","xsi",""), "xsd:string" );
	            arg4_5_1.addTextNode("kagross");
	            
	            SOAPElement arg4_5_2 = arg4_5.addChildElement( env.createName("item") );
	            arg4_5_2.addAttribute( env.createName("type","xsi",""), "xsd:string" );
	            arg4_5_2.addTextNode("echism");
            	            
            SOAPElement ccs = args.addChildElement( env.createName("permanentCCs") );
            ccs.addAttribute( env.createName("type","xsi",""), "SOAP-ENC:Array" );
            ccs.addAttribute( env.createName("arrayType","SOAP-ENC",""), "xsd:string[3]" );//CHANGE [1] to [n] based on the number of items
            
	            SOAPElement cc1 = ccs.addChildElement( env.createName("item") );
	            cc1.addAttribute( env.createName("type","xsi",""), "xsd:string" );
	            cc1.addTextNode("<EMAIL>");
	            
	            SOAPElement cc2 = ccs.addChildElement( env.createName("item") );
	            cc2.addAttribute( env.createName("type","xsi",""), "xsd:string" );
	            cc2.addTextNode("<EMAIL>");
	            
	            SOAPElement cc3 = ccs.addChildElement( env.createName("item") );
	            cc3.addAttribute( env.createName("type","xsi",""), "xsd:string" );
	            cc3.addTextNode("<EMAIL>");   	          
            
            //project fields
            SOAPElement projfields = args.addChildElement( env.createName("projfields") );
            projfields.addAttribute( env.createName("type","xsi",""), "namesp2:SOAPStruct" );
            
            SOAPElement orig_vo = projfields.addChildElement( env.createName("Originating__bVO__bSupport__bCenter") );
            orig_vo.addAttribute( env.createName("type","xsi",""), "xsd:string" );
            orig_vo.addTextNode("MIS");
            
            SOAPElement dest_vo = projfields.addChildElement( env.createName("Destination__bVO__bSupport__bCenter") );
            dest_vo.addAttribute( env.createName("type","xsi",""), "xsd:string" );
            dest_vo.addTextNode("MIS");
            
            SOAPElement next_action = projfields.addChildElement( env.createName("ENG__bNext__bAction__bItem") );
            next_action.addAttribute( env.createName("type","xsi",""), "xsd:string" );
            next_action.addTextNode("Verify Information and Add to Ops Meeting Agenda");
            
            SOAPElement nad = projfields.addChildElement( env.createName("ENG__bNext__bAction__bDate__fTime__b__PUTC__p") );
            nad.addAttribute( env.createName("type","xsi",""), "xsd:string" );
            SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");  
            nad.addTextNode(format.format(new Date()));            
            
            SOAPElement type = projfields.addChildElement( env.createName("Ticket__uType") );
            type.addAttribute( env.createName("type","xsi",""), "xsd:string" );
            type.addTextNode("Problem__fRequest");  
            
            SOAPElement arg4_2 = args.addChildElement( env.createName("status") );
            arg4_2.addAttribute( env.createName("type","xsi",""), "xsd:string" );
            arg4_2.addTextNode("Engineering");
            msg.saveChanges();

            call();
        } catch(Exception ex) {
			log.error("Failed to create sc ticket: ", ex);
        } 
	}
	
	public void createNewVOTicket(String vo_name, String sc_footprint_id)
	{	
		HashMap<String, String> params = new HashMap<String, String>();
		params.put("##VO_NAME##", vo_name);
		HtmlFileView description = new HtmlFileView("footprints_new_vo_template.txt", params);	
		
		try
        {
            SOAPElement invoke = body.addChildElement( env.createName("MRWebServices__createIssue_goc", "namesp1",StaticConfig.getFootprintsUri()) );
            
            // root parameters user/pass/extra/args
            SOAPElement username = invoke.addChildElement( env.createName("user") );
            username.addAttribute( env.createName("type","xsi",""), "xsd:string" );
            username.addTextNode(StaticConfig.getFootprintsUsername());
            
            SOAPElement password = invoke.addChildElement( env.createName("password") );
            password.addAttribute( env.createName("type","xsi",""), "xsd:string" );
            password.addTextNode(StaticConfig.getFootprintsPassword());
            
            SOAPElement extra_info = invoke.addChildElement( env.createName("extrainfo") );
            extra_info.addAttribute( env.createName("type","xsi",""), "xsd:string" );
            
            SOAPElement args = invoke.addChildElement( env.createName("args") );
            args.addAttribute( env.createName("type","xsi",""), "namesp2:SOAPStruct" );
            
            //Contat Information
            SOAPElement abfields = args.addChildElement( env.createName("abfields") );
            abfields.addAttribute( env.createName("type","xsi",""), "namesp2:SOAPStruct" );
            
            ContactRecord contact = context.getAuthorization().getContact();
            SOAPElement arg4_3_2 = abfields.addChildElement( env.createName("Last__bName") );
            arg4_3_2.addAttribute( env.createName("type","xsi",""), "xsd:string" );
            arg4_3_2.addTextNode(contact.getLastName());
            
            SOAPElement arg4_3_3 = abfields.addChildElement( env.createName("First__bName") );
            arg4_3_3.addAttribute( env.createName("type","xsi",""), "xsd:string" );
            arg4_3_3.addTextNode(contact.getFirstName());
            
            SOAPElement arg4_3_4 = abfields.addChildElement( env.createName("Email__baddress") );
            arg4_3_4.addAttribute( env.createName("type","xsi",""), "xsd:string" );
            arg4_3_4.addTextNode(contact.primary_email);
            
            SOAPElement arg4_3_5 = abfields.addChildElement( env.createName("Office__bPhone") );
            arg4_3_5.addAttribute( env.createName("type","xsi",""), "xsd:string" );
            arg4_3_5.addTextNode(contact.primary_phone);

            //Basic Information
            SOAPElement arg4_7 = args.addChildElement( env.createName("projectID") );
            arg4_7.addAttribute( env.createName("type","xsi",""), "xsd:int" );
            arg4_7.addTextNode(StaticConfig.getFootprintsProjectID().toString());       
            SOAPElement arg4_9 = args.addChildElement( env.createName("submitter") );
            arg4_9.addAttribute( env.createName("type","xsi",""), "xsd:string" );
            arg4_9.addTextNode("OSG-GOC");
            
            SOAPElement arg4_8 = args.addChildElement( env.createName("title") );
            arg4_8.addAttribute( env.createName("type","xsi",""), "xsd:string" );
            arg4_8.addTextNode("OIM VO Registration - " + vo_name);
            
            SOAPElement arg4_1 = args.addChildElement( env.createName("priorityNumber") );
            arg4_1.addAttribute( env.createName("type","xsi",""), "xsd:int" );
            arg4_1.addTextNode("4");
            
            SOAPElement arg4_4 = args.addChildElement( env.createName("description") );
            arg4_4.addAttribute( env.createName("type","xsi",""), "xsd:string" );
            arg4_4.addTextNode(description.toString());

            SOAPElement arg4_5 = args.addChildElement( env.createName("assignees") );
            arg4_5.addAttribute( env.createName("type","xsi",""), "SOAP-ENC:Array" );
            arg4_5.addAttribute( env.createName("arrayType","SOAP-ENC",""), "xsd:string[3]" );//CHANGE [1] to [n] based on the number of items
            
	            SOAPElement arg4_5_1 = arg4_5.addChildElement( env.createName("item") );
	            arg4_5_1.addAttribute( env.createName("type","xsi",""), "xsd:string" );
	            arg4_5_1.addTextNode("kagross");
	            
	            SOAPElement arg4_5_2 = arg4_5.addChildElement( env.createName("item") );
	            arg4_5_2.addAttribute( env.createName("type","xsi",""), "xsd:string" );
	            arg4_5_2.addTextNode("echism");
 
	            //assign the associated SC so that they will be notified of this resource registration
	            SOAPElement arg4_5_3 = arg4_5.addChildElement( env.createName("item") );
	            arg4_5_3.addAttribute( env.createName("type","xsi",""), "xsd:string" );
	            arg4_5_3.addTextNode(sc_footprint_id);
	            
            SOAPElement ccs = args.addChildElement( env.createName("permanentCCs") );
            ccs.addAttribute( env.createName("type","xsi",""), "SOAP-ENC:Array" );
            ccs.addAttribute( env.createName("arrayType","SOAP-ENC",""), "xsd:string[3]" );//CHANGE [1] to [n] based on the number of items
            
	            SOAPElement cc1 = ccs.addChildElement( env.createName("item") );
	            cc1.addAttribute( env.createName("type","xsi",""), "xsd:string" );
	            cc1.addTextNode("<EMAIL>");
	            
	            SOAPElement cc2 = ccs.addChildElement( env.createName("item") );
	            cc2.addAttribute( env.createName("type","xsi",""), "xsd:string" );
	            cc2.addTextNode("<EMAIL>");
	            
	            SOAPElement cc3 = ccs.addChildElement( env.createName("item") );
	            cc3.addAttribute( env.createName("type","xsi",""), "xsd:string" );
	            cc3.addTextNode("<EMAIL>");   
	            
            //project fields
            SOAPElement projfields = args.addChildElement( env.createName("projfields") );
            projfields.addAttribute( env.createName("type","xsi",""), "namesp2:SOAPStruct" );
            
            SOAPElement orig_vo = projfields.addChildElement( env.createName("Originating__bVO__bSupport__bCenter") );
            orig_vo.addAttribute( env.createName("type","xsi",""), "xsd:string" );
            orig_vo.addTextNode("MIS");<commit_msg>Added filter so that if OIM is running in debug mode (such as oim-itb), it will not assign real assignees / CC for generated FP tickets.<commit_after>package edu.iu.grid.oim.lib;

import java.io.InputStream;
import java.sql.SQLException;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.HashMap;

import javax.mail.MessagingException;
import javax.xml.soap.*;

import org.apache.log4j.Logger;

import edu.iu.grid.oim.model.Context;
import edu.iu.grid.oim.model.db.record.ContactRecord;
import edu.iu.grid.oim.view.HtmlFileView;
import edu.iu.grid.oim.view.divrep.ResourceDowntimeEditor;

public class Footprint 
{
    static Logger log = Logger.getLogger(Footprint.class); 
    
	Context context;
	
	SOAPBody body;
	SOAPEnvelope env;
	SOAPConnection connection;
	SOAPMessage msg;
	
	public Footprint(Context _context)
	{
		context = _context;
		
		//using program listed here > http://blogs.sun.com/andreas/entry/no_more_unable_to_find
		//to create the trusted keystore
		System.setProperty("javax.net.ssl.trustStore", StaticConfig.getSSLTrustStorePath());
		
        //Init SOAP
		try {
			SOAPConnectionFactory scf = SOAPConnectionFactory.newInstance();
	        connection = scf.createConnection();
	        MessageFactory msgFactory = MessageFactory.newInstance();
	        msg = msgFactory.createMessage();
	        env = msg.getSOAPPart().getEnvelope();
	        env.addNamespaceDeclaration( "xsi", "http://www.w3.org/1999/XMLSchema-instance" );
	        env.addNamespaceDeclaration( "xsd", "http://www.w3.org/1999/XMLSchema" );
	        env.addNamespaceDeclaration( "namesp2", "http://xml.apache.org/xml-soap" );
	        env.addNamespaceDeclaration( "SOAP-ENC", "http://schemas.xmlsoap.org/soap/encoding/" );
	        body = env.getBody();
		} catch (UnsupportedOperationException e) {
			log.error("Failed to initialize Footprint object", e);
		} catch (SOAPException e) {
			log.error("Failed to initialize Footprint object", e);
		}
	}

	public void createNewResourceTicket(String resource_name, String sc_footprint_id, String vo_name)
	{
		HashMap<String, String> params = new HashMap<String, String>();
		params.put("##RESOURCE_NAME##", resource_name);
		HtmlFileView description = new HtmlFileView("footprints_new_resource_template.txt", params);
		
		try
        {
            SOAPElement invoke = body.addChildElement( env.createName("MRWebServices__createIssue_goc", "namesp1",StaticConfig.getFootprintsUri()) );
            
            // root parameters user/pass/extra/args
            SOAPElement username = invoke.addChildElement( env.createName("user") );
            username.addAttribute( env.createName("type","xsi",""), "xsd:string" );
            username.addTextNode(StaticConfig.getFootprintsUsername());
            
            SOAPElement password = invoke.addChildElement( env.createName("password") );
            password.addAttribute( env.createName("type","xsi",""), "xsd:string" );
            password.addTextNode(StaticConfig.getFootprintsPassword());
            
            SOAPElement extra_info = invoke.addChildElement( env.createName("extrainfo") );
            extra_info.addAttribute( env.createName("type","xsi",""), "xsd:string" );
            
            SOAPElement args = invoke.addChildElement( env.createName("args") );
            args.addAttribute( env.createName("type","xsi",""), "namesp2:SOAPStruct" );
            
            //Contat Information
            SOAPElement abfields = args.addChildElement( env.createName("abfields") );
            abfields.addAttribute( env.createName("type","xsi",""), "namesp2:SOAPStruct" );
            
            ContactRecord contact = context.getAuthorization().getContact();
            SOAPElement arg4_3_2 = abfields.addChildElement( env.createName("Last__bName") );
            arg4_3_2.addAttribute( env.createName("type","xsi",""), "xsd:string" );
            arg4_3_2.addTextNode(contact.getLastName());
            
            SOAPElement arg4_3_3 = abfields.addChildElement( env.createName("First__bName") );
            arg4_3_3.addAttribute( env.createName("type","xsi",""), "xsd:string" );
            arg4_3_3.addTextNode(contact.getFirstName());
            
            SOAPElement arg4_3_4 = abfields.addChildElement( env.createName("Email__baddress") );
            arg4_3_4.addAttribute( env.createName("type","xsi",""), "xsd:string" );
            arg4_3_4.addTextNode(contact.primary_email);
            
            SOAPElement arg4_3_5 = abfields.addChildElement( env.createName("Office__bPhone") );
            arg4_3_5.addAttribute( env.createName("type","xsi",""), "xsd:string" );
            arg4_3_5.addTextNode(contact.primary_phone);

            //Basic Information
            SOAPElement arg4_7 = args.addChildElement( env.createName("projectID") );
            arg4_7.addAttribute( env.createName("type","xsi",""), "xsd:int" );
            arg4_7.addTextNode(StaticConfig.getFootprintsProjectID().toString());       
            SOAPElement arg4_9 = args.addChildElement( env.createName("submitter") );
            arg4_9.addAttribute( env.createName("type","xsi",""), "xsd:string" );
            arg4_9.addTextNode("OSG-GOC");
            
            SOAPElement arg4_8 = args.addChildElement( env.createName("title") );
            arg4_8.addAttribute( env.createName("type","xsi",""), "xsd:string" );
            arg4_8.addTextNode("OIM Resource Registration - " + resource_name);
            
            SOAPElement arg4_1 = args.addChildElement( env.createName("priorityNumber") );
            arg4_1.addAttribute( env.createName("type","xsi",""), "xsd:int" );
            arg4_1.addTextNode("4");
            
            SOAPElement arg4_4 = args.addChildElement( env.createName("description") );
            arg4_4.addAttribute( env.createName("type","xsi",""), "xsd:string" );
            arg4_4.addTextNode(description.toString());

    		if(StaticConfig.isDebug()) {
	            SOAPElement arg4_5 = args.addChildElement( env.createName("assignees") );
	            arg4_5.addAttribute( env.createName("type","xsi",""), "SOAP-ENC:Array" );
	            arg4_5.addAttribute( env.createName("arrayType","SOAP-ENC",""), "xsd:string[1]" );//CHANGE [1] to [n] based on the number of items
	            
		            SOAPElement arg4_5_1 = arg4_5.addChildElement( env.createName("item") );
		            arg4_5_1.addAttribute( env.createName("type","xsi",""), "xsd:string" );
		            arg4_5_1.addTextNode("hayashis");
		            
		        log.debug("DEBUG: assigning hayashis - in reality following would have assigned: kagross, echism, " + sc_footprint_id);
    		} else {
	            SOAPElement arg4_5 = args.addChildElement( env.createName("assignees") );
	            arg4_5.addAttribute( env.createName("type","xsi",""), "SOAP-ENC:Array" );
	            arg4_5.addAttribute( env.createName("arrayType","SOAP-ENC",""), "xsd:string[3]" );//CHANGE [1] to [n] based on the number of items
	            
		            SOAPElement arg4_5_1 = arg4_5.addChildElement( env.createName("item") );
		            arg4_5_1.addAttribute( env.createName("type","xsi",""), "xsd:string" );
		            arg4_5_1.addTextNode("kagross");
		            
		            SOAPElement arg4_5_2 = arg4_5.addChildElement( env.createName("item") );
		            arg4_5_2.addAttribute( env.createName("type","xsi",""), "xsd:string" );
		            arg4_5_2.addTextNode("echism");
		            
		            //assign the associated SC so that they will be notified of this resource registration
		            SOAPElement arg4_5_3 = arg4_5.addChildElement( env.createName("item") );
		            arg4_5_3.addAttribute( env.createName("type","xsi",""), "xsd:string" );
		            arg4_5_3.addTextNode(sc_footprint_id);
    		}
	            
    		if(StaticConfig.isDebug()) {
    			log.debug("DEBUG: following people would have been CC-ed in production mode: oim-dev@, <EMAIL>, <EMAIL>");
    		} else {
	            SOAPElement ccs = args.addChildElement( env.createName("permanentCCs") );
	            ccs.addAttribute( env.createName("type","xsi",""), "SOAP-ENC:Array" );
	            ccs.addAttribute( env.createName("arrayType","SOAP-ENC",""), "xsd:string[3]" );//CHANGE [1] to [n] based on the number of items
	            
		            SOAPElement cc1 = ccs.addChildElement( env.createName("item") );
		            cc1.addAttribute( env.createName("type","xsi",""), "xsd:string" );
		            cc1.addTextNode("<EMAIL>");
		            
		            SOAPElement cc2 = ccs.addChildElement( env.createName("item") );
		            cc2.addAttribute( env.createName("type","xsi",""), "xsd:string" );
		            cc2.addTextNode("<EMAIL>");
		            
		            SOAPElement cc3 = ccs.addChildElement( env.createName("item") );
		            cc3.addAttribute( env.createName("type","xsi",""), "xsd:string" );
		            cc3.addTextNode("<EMAIL>");   
    		}
            //project fields
            SOAPElement projfields = args.addChildElement( env.createName("projfields") );
            projfields.addAttribute( env.createName("type","xsi",""), "namesp2:SOAPStruct" );
            
            SOAPElement orig_vo = projfields.addChildElement( env.createName("Originating__bVO__bSupport__bCenter") );
            orig_vo.addAttribute( env.createName("type","xsi",""), "xsd:string" );
            orig_vo.addTextNode("MIS");
            
            SOAPElement dest_vo = projfields.addChildElement( env.createName("Destination__bVO__bSupport__bCenter") );
            dest_vo.addAttribute( env.createName("type","xsi",""), "xsd:string" );
            if(vo_name == null) {
            	dest_vo.addTextNode("MIS");
            } else {
            	dest_vo.addTextNode(vo_name);
            }
            
            SOAPElement next_action = projfields.addChildElement( env.createName("ENG__bNext__bAction__bItem") );
            next_action.addAttribute( env.createName("type","xsi",""), "xsd:string" );
            next_action.addTextNode("Verify Information and Add to Ops Meeting Agenda");
            
            SOAPElement nad = projfields.addChildElement( env.createName("ENG__bNext__bAction__bDate__fTime__b__PUTC__p") );
            nad.addAttribute( env.createName("type","xsi",""), "xsd:string" );
            SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");  
            nad.addTextNode(format.format(new Date()));            
            
            SOAPElement type = projfields.addChildElement( env.createName("Ticket__uType") );
            type.addAttribute( env.createName("type","xsi",""), "xsd:string" );
            type.addTextNode("Problem__fRequest");  
            
            SOAPElement arg4_2 = args.addChildElement( env.createName("status") );
            arg4_2.addAttribute( env.createName("type","xsi",""), "xsd:string" );
            arg4_2.addTextNode("Engineering");
            msg.saveChanges();

            call();
        } catch(Exception e) {
			log.error("Failed to create resource ticket: ", e);
		}
	}
	
	public void createNewSCTicket(String sc_name)
	{		
		HashMap<String, String> params = new HashMap<String, String>();
		params.put("##SC_NAME##", sc_name);
		HtmlFileView description = new HtmlFileView("footprints_new_sc_template.txt", params);
		
		try
        {
            SOAPElement invoke = body.addChildElement( env.createName("MRWebServices__createIssue_goc", "namesp1",StaticConfig.getFootprintsUri()) );
            
            // root parameters user/pass/extra/args
            SOAPElement username = invoke.addChildElement( env.createName("user") );
            username.addAttribute( env.createName("type","xsi",""), "xsd:string" );
            username.addTextNode(StaticConfig.getFootprintsUsername());
            
            SOAPElement password = invoke.addChildElement( env.createName("password") );
            password.addAttribute( env.createName("type","xsi",""), "xsd:string" );
            password.addTextNode(StaticConfig.getFootprintsPassword());
            
            SOAPElement extra_info = invoke.addChildElement( env.createName("extrainfo") );
            extra_info.addAttribute( env.createName("type","xsi",""), "xsd:string" );
            
            SOAPElement args = invoke.addChildElement( env.createName("args") );
            args.addAttribute( env.createName("type","xsi",""), "namesp2:SOAPStruct" );
            
            //Contat Information
            SOAPElement abfields = args.addChildElement( env.createName("abfields") );
            abfields.addAttribute( env.createName("type","xsi",""), "namesp2:SOAPStruct" );
            
            ContactRecord contact = context.getAuthorization().getContact();
            SOAPElement arg4_3_2 = abfields.addChildElement( env.createName("Last__bName") );
            arg4_3_2.addAttribute( env.createName("type","xsi",""), "xsd:string" );
            arg4_3_2.addTextNode(contact.getLastName());
            
            SOAPElement arg4_3_3 = abfields.addChildElement( env.createName("First__bName") );
            arg4_3_3.addAttribute( env.createName("type","xsi",""), "xsd:string" );
            arg4_3_3.addTextNode(contact.getFirstName());
            
            SOAPElement arg4_3_4 = abfields.addChildElement( env.createName("Email__baddress") );
            arg4_3_4.addAttribute( env.createName("type","xsi",""), "xsd:string" );
            arg4_3_4.addTextNode(contact.primary_email);
            
            SOAPElement arg4_3_5 = abfields.addChildElement( env.createName("Office__bPhone") );
            arg4_3_5.addAttribute( env.createName("type","xsi",""), "xsd:string" );
            arg4_3_5.addTextNode(contact.primary_phone);

            //Basic Information
            SOAPElement arg4_7 = args.addChildElement( env.createName("projectID") );
            arg4_7.addAttribute( env.createName("type","xsi",""), "xsd:int" );
            arg4_7.addTextNode(StaticConfig.getFootprintsProjectID().toString());       
            SOAPElement arg4_9 = args.addChildElement( env.createName("submitter") );
            arg4_9.addAttribute( env.createName("type","xsi",""), "xsd:string" );
            arg4_9.addTextNode("OSG-GOC");
            
            SOAPElement arg4_8 = args.addChildElement( env.createName("title") );
            arg4_8.addAttribute( env.createName("type","xsi",""), "xsd:string" );
            arg4_8.addTextNode("OIM SC Registration - " + sc_name);
            
            SOAPElement arg4_1 = args.addChildElement( env.createName("priorityNumber") );
            arg4_1.addAttribute( env.createName("type","xsi",""), "xsd:int" );
            arg4_1.addTextNode("4");
            
            SOAPElement arg4_4 = args.addChildElement( env.createName("description") );
            arg4_4.addAttribute( env.createName("type","xsi",""), "xsd:string" );
            arg4_4.addTextNode(description.toString());

    		if(StaticConfig.isDebug()) {
                SOAPElement arg4_5 = args.addChildElement( env.createName("assignees") );
                arg4_5.addAttribute( env.createName("type","xsi",""), "SOAP-ENC:Array" );
                arg4_5.addAttribute( env.createName("arrayType","SOAP-ENC",""), "xsd:string[1]" );//CHANGE [1] to [n] based on the number of items
                
    	            SOAPElement arg4_5_1 = arg4_5.addChildElement( env.createName("item") );
    	            arg4_5_1.addAttribute( env.createName("type","xsi",""), "xsd:string" );
    	            arg4_5_1.addTextNode("hayashis");
    			log.debug("DEBUG: following people would have been assigned in production mode: kagross, echism");
    		} else {
                SOAPElement arg4_5 = args.addChildElement( env.createName("assignees") );
                arg4_5.addAttribute( env.createName("type","xsi",""), "SOAP-ENC:Array" );
                arg4_5.addAttribute( env.createName("arrayType","SOAP-ENC",""), "xsd:string[2]" );//CHANGE [1] to [n] based on the number of items
                
    	            SOAPElement arg4_5_1 = arg4_5.addChildElement( env.createName("item") );
    	            arg4_5_1.addAttribute( env.createName("type","xsi",""), "xsd:string" );
    	            arg4_5_1.addTextNode("kagross");
    	            
    	            SOAPElement arg4_5_2 = arg4_5.addChildElement( env.createName("item") );
    	            arg4_5_2.addAttribute( env.createName("type","xsi",""), "xsd:string" );
    	            arg4_5_2.addTextNode("echism");    			
    		}
            	           
    		/*
            SOAPElement ccs = args.addChildElement( env.createName("permanentCCs") );
            ccs.addAttribute( env.createName("type","xsi",""), "SOAP-ENC:Array" );
            ccs.addAttribute( env.createName("arrayType","SOAP-ENC",""), "xsd:string[3]" );//CHANGE [1] to [n] based on the number of items
            
	            SOAPElement cc1 = ccs.addChildElement( env.createName("item") );
	            cc1.addAttribute( env.createName("type","xsi",""), "xsd:string" );
	            cc1.addTextNode("<EMAIL>");
	            
	            SOAPElement cc2 = ccs.addChildElement( env.createName("item") );
	            cc2.addAttribute( env.createName("type","xsi",""), "xsd:string" );
	            cc2.addTextNode("<EMAIL>");
	            
	            SOAPElement cc3 = ccs.addChildElement( env.createName("item") );
	            cc3.addAttribute( env.createName("type","xsi",""), "xsd:string" );
	            cc3.addTextNode("<EMAIL>");   	     
	        */
    		if(StaticConfig.isDebug()) {
    			log.debug("DEBUG: following people would have been CC-ed in production mode: oim-dev@, <EMAIL>, <EMAIL>");
    		} else {
	            SOAPElement ccs = args.addChildElement( env.createName("permanentCCs") );
	            ccs.addAttribute( env.createName("type","xsi",""), "SOAP-ENC:Array" );
	            ccs.addAttribute( env.createName("arrayType","SOAP-ENC",""), "xsd:string[3]" );//CHANGE [1] to [n] based on the number of items
	            
		            SOAPElement cc1 = ccs.addChildElement( env.createName("item") );
		            cc1.addAttribute( env.createName("type","xsi",""), "xsd:string" );
		            cc1.addTextNode("<EMAIL>");
		            
		            SOAPElement cc2 = ccs.addChildElement( env.createName("item") );
		            cc2.addAttribute( env.createName("type","xsi",""), "xsd:string" );
		            cc2.addTextNode("<EMAIL>");
		            
		            SOAPElement cc3 = ccs.addChildElement( env.createName("item") );
		            cc3.addAttribute( env.createName("type","xsi",""), "xsd:string" );
		            cc3.addTextNode("<EMAIL>");   
    		}
	            
            //project fields
            SOAPElement projfields = args.addChildElement( env.createName("projfields") );
            projfields.addAttribute( env.createName("type","xsi",""), "namesp2:SOAPStruct" );
            
            SOAPElement orig_vo = projfields.addChildElement( env.createName("Originating__bVO__bSupport__bCenter") );
            orig_vo.addAttribute( env.createName("type","xsi",""), "xsd:string" );
            orig_vo.addTextNode("MIS");
            
            SOAPElement dest_vo = projfields.addChildElement( env.createName("Destination__bVO__bSupport__bCenter") );
            dest_vo.addAttribute( env.createName("type","xsi",""), "xsd:string" );
            dest_vo.addTextNode("MIS");
            
            SOAPElement next_action = projfields.addChildElement( env.createName("ENG__bNext__bAction__bItem") );
            next_action.addAttribute( env.createName("type","xsi",""), "xsd:string" );
            next_action.addTextNode("Verify Information and Add to Ops Meeting Agenda");
            
            SOAPElement nad = projfields.addChildElement( env.createName("ENG__bNext__bAction__bDate__fTime__b__PUTC__p") );
            nad.addAttribute( env.createName("type","xsi",""), "xsd:string" );
            SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");  
            nad.addTextNode(format.format(new Date()));            
            
            SOAPElement type = projfields.addChildElement( env.createName("Ticket__uType") );
            type.addAttribute( env.createName("type","xsi",""), "xsd:string" );
            type.addTextNode("Problem__fRequest");  
            
            SOAPElement arg4_2 = args.addChildElement( env.createName("status") );
            arg4_2.addAttribute( env.createName("type","xsi",""), "xsd:string" );
            arg4_2.addTextNode("Engineering");
            msg.saveChanges();

            call();
        } catch(Exception ex) {
			log.error("Failed to create sc ticket: ", ex);
        } 
	}
	
	public void createNewVOTicket(String vo_name, String sc_footprint_id)
	{	
		HashMap<String, String> params = new HashMap<String, String>();
		params.put("##VO_NAME##", vo_name);
		HtmlFileView description = new HtmlFileView("footprints_new_vo_template.txt", params);	
		
		try
        {
            SOAPElement invoke = body.addChildElement( env.createName("MRWebServices__createIssue_goc", "namesp1",StaticConfig.getFootprintsUri()) );
            
            // root parameters user/pass/extra/args
            SOAPElement username = invoke.addChildElement( env.createName("user") );
            username.addAttribute( env.createName("type","xsi",""), "xsd:string" );
            username.addTextNode(StaticConfig.getFootprintsUsername());
            
            SOAPElement password = invoke.addChildElement( env.createName("password") );
            password.addAttribute( env.createName("type","xsi",""), "xsd:string" );
            password.addTextNode(StaticConfig.getFootprintsPassword());
            
            SOAPElement extra_info = invoke.addChildElement( env.createName("extrainfo") );
            extra_info.addAttribute( env.createName("type","xsi",""), "xsd:string" );
            
            SOAPElement args = invoke.addChildElement( env.createName("args") );
            args.addAttribute( env.createName("type","xsi",""), "namesp2:SOAPStruct" );
            
            //Contat Information
            SOAPElement abfields = args.addChildElement( env.createName("abfields") );
            abfields.addAttribute( env.createName("type","xsi",""), "namesp2:SOAPStruct" );
            
            ContactRecord contact = context.getAuthorization().getContact();
            SOAPElement arg4_3_2 = abfields.addChildElement( env.createName("Last__bName") );
            arg4_3_2.addAttribute( env.createName("type","xsi",""), "xsd:string" );
            arg4_3_2.addTextNode(contact.getLastName());
            
            SOAPElement arg4_3_3 = abfields.addChildElement( env.createName("First__bName") );
            arg4_3_3.addAttribute( env.createName("type","xsi",""), "xsd:string" );
            arg4_3_3.addTextNode(contact.getFirstName());
            
            SOAPElement arg4_3_4 = abfields.addChildElement( env.createName("Email__baddress") );
            arg4_3_4.addAttribute( env.createName("type","xsi",""), "xsd:string" );
            arg4_3_4.addTextNode(contact.primary_email);
            
            SOAPElement arg4_3_5 = abfields.addChildElement( env.createName("Office__bPhone") );
            arg4_3_5.addAttribute( env.createName("type","xsi",""), "xsd:string" );
            arg4_3_5.addTextNode(contact.primary_phone);

            //Basic Information
            SOAPElement arg4_7 = args.addChildElement( env.createName("projectID") );
            arg4_7.addAttribute( env.createName("type","xsi",""), "xsd:int" );
            arg4_7.addTextNode(StaticConfig.getFootprintsProjectID().toString());       
            SOAPElement arg4_9 = args.addChildElement( env.createName("submitter") );
            arg4_9.addAttribute( env.createName("type","xsi",""), "xsd:string" );
            arg4_9.addTextNode("OSG-GOC");
            
            SOAPElement arg4_8 = args.addChildElement( env.createName("title") );
            arg4_8.addAttribute( env.createName("type","xsi",""), "xsd:string" );
            arg4_8.addTextNode("OIM VO Registration - " + vo_name);
            
            SOAPElement arg4_1 = args.addChildElement( env.createName("priorityNumber") );
            arg4_1.addAttribute( env.createName("type","xsi",""), "xsd:int" );
            arg4_1.addTextNode("4");
            
            SOAPElement arg4_4 = args.addChildElement( env.createName("description") );
            arg4_4.addAttribute( env.createName("type","xsi",""), "xsd:string" );
            arg4_4.addTextNode(description.toString());

    		if(StaticConfig.isDebug()) {
	            SOAPElement arg4_5 = args.addChildElement( env.createName("assignees") );
	            arg4_5.addAttribute( env.createName("type","xsi",""), "SOAP-ENC:Array" );
	            arg4_5.addAttribute( env.createName("arrayType","SOAP-ENC",""), "xsd:string[1]" );//CHANGE [1] to [n] based on the number of items
	            
		            SOAPElement arg4_5_1 = arg4_5.addChildElement( env.createName("item") );
		            arg4_5_1.addAttribute( env.createName("type","xsi",""), "xsd:string" );
		            arg4_5_1.addTextNode("hayashis");
		            
		        log.debug("DEBUG: assigning hayashis - in production following would have assigned: kagross, echism, " + sc_footprint_id);
    		} else {
	            SOAPElement arg4_5 = args.addChildElement( env.createName("assignees") );
	            arg4_5.addAttribute( env.createName("type","xsi",""), "SOAP-ENC:Array" );
	            arg4_5.addAttribute( env.createName("arrayType","SOAP-ENC",""), "xsd:string[3]" );//CHANGE [1] to [n] based on the number of items
	            
		            SOAPElement arg4_5_1 = arg4_5.addChildElement( env.createName("item") );
		            arg4_5_1.addAttribute( env.createName("type","xsi",""), "xsd:string" );
		            arg4_5_1.addTextNode("kagross");
		            
		            SOAPElement arg4_5_2 = arg4_5.addChildElement( env.createName("item") );
		            arg4_5_2.addAttribute( env.createName("type","xsi",""), "xsd:string" );
		            arg4_5_2.addTextNode("echism");
		            
		            //assign the associated SC so that they will be notified of this resource registration
		            SOAPElement arg4_5_3 = arg4_5.addChildElement( env.createName("item") );
		            arg4_5_3.addAttribute( env.createName("type","xsi",""), "xsd:string" );
		            arg4_5_3.addTextNode(sc_footprint_id);
    		}
	            
    		if(StaticConfig.isDebug()) {
    			log.debug("DEBUG: following people would have been CC-ed in production mode: oim-dev@, <EMAIL>, <EMAIL>");
    		} else {
	            SOAPElement ccs = args.addChildElement( env.createName("permanentCCs") );
	            ccs.addAttribute( env.createName("type","xsi",""), "SOAP-ENC:Array" );
	            ccs.addAttribute( env.createName("arrayType","SOAP-ENC",""), "xsd:string[3]" );//CHANGE [1] to [n] based on the number of items
	            
		            SOAPElement cc1 = ccs.addChildElement( env.createName("item") );
		            cc1.addAttribute( env.createName("type","xsi",""), "xsd:string" );
		            cc1.addTextNode("<EMAIL>");
		            
		            SOAPElement cc2 = ccs.addChildElement( env.createName("item") );
		            cc2.addAttribute( env.createName("type","xsi",""), "xsd:string" );
		            cc2.addTextNode("<EMAIL>");
		            
		            SOAPElement cc3 = ccs.addChildElement( env.createName("item") );
		            cc3.addAttribute( env.createName("type","xsi",""), "xsd:string" );
		            cc3.addTextNode("<EMAIL>");   
    		} 
	            
            //project fields
            SOAPElement projfields = args.addChildElement( env.createName("projfields") );
            projfields.addAttribute( env.createName("type","xsi",""), "namesp2:SOAPStruct" );
            
            SOAPElement orig_vo = projfields.addChildElement( env.createName("Originating__bVO__bSupport__bCenter") );
            orig_vo.addAttribute( env.createName("type","xsi",""), "xsd:string" );
            orig_vo.addTextNode("MIS");
{'fraction_non_alphanumeric': 0.14453633509457078, 'fraction_numerical': 0.015927712688567273, 'mean_word_length': 2.7050145400383006, 'pattern_counts': {'":': 0, '<': 42, '<?xml version=': 0, '>': 44, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 8}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1352784', 'n_tokens_mistral': 16584, 'n_tokens_neox': 15582, 'n_words': 2272}