VCO get entry to vcops via snmp

You ask someone succesffuly was able to enter data into vcops vco.

I followed this guide. vCenter integration of Operations with vCenter Orchestrator in 5 minutes or less | VMware vCenter Orchestrator Blog - VMwar...

was really great.

However, in the journal of politics, I see mainly

13:06:17.342 2014-08-15] [I]

> > > Trap for oid 1.3.6.1.4.1.6876.4.5.1.0.13 jumped!

This means that the script in politics does not know this oid. .

After further research it seems you have to set manually in the oid name match and must also be in the configuration of vcop attributes (self-titled) If you can run

workflow.

is that correct, has anyone used previously?

OK, I solved the problem... fixed code of vmware. .. I don't know there is a cleaner for it... way just not a lot of time to devote to this. so quick fixie

var trapOid = data.get ("oid");

from here on out to the bottom we are switching.

System.log ("it is before regex \n");

System.log ("TrapOid:" + trapOid + "\n");

var temptrapOid = trapOid;

var RES = temptrapOid.split (".", 9);

var trapOid = res [0] + "." + [1] + '.' + res [2] + '.' + res [3] + '.' + res [4] + '.' + res [5] + '.' + res [6] + '.' + res [7] + '.' + res [8];

System.log ("it's after regex \n");

System.log ("TrapOid:" + trapOid + "\n");

up to far.

Tags: VMware

Similar Questions

  • SGE2010 how to trigger backups via SNMP?

    Hello

    I've tried, so unsucessfully, to trigger backups on our switches SGE201 TFTP server. I have backups testesd TFTP through the web interface, and who does not. I need SNMP as I need a method for trgiger scriptable backups on a regular basis. I run the query SNMP from a RedHat Linux server. So far, I have the following query worked, but it is a failure:

    snmpset - v - 1 c COMMUNITY SWITCH. MGMT. JPM ADDRESS 1.3.6.1.4.1.9.6.1.101.87.2.1.7 I have 2 1.3.6.1.4.1.9.6.1.101.87.2.1.8 I have 3 1.3.6.1.4.1.9.6.1.101.87.2.1.9 has TFTP.SERVER.IP.ADDRESS 1.3.6.1.4.1.9.6.1.101.87.2.1.11 s 1.3.6.1.4.1.9.6.1.101.87.2.1.17 FILE name I have 4

    The error I get is generic, and the same query failed on several switches operating the 3.0.0.18 software. The switch is set with the community having full access from the IP address of the SNMP-admin server.

    If someone here was able to run SNMP triggers backups and would be ready to post their query and/or software that would be greatly appreciated. Any other suggestions, comments or tips are also welcome. Thank you for your time.

    Jeff,

    The procedure to download or update the config via SNMP is as follows:

    (1) download the MIB files that we officially freed from cisco.com

    http://www.Cisco.com/Cisco/software/release.html?mdfid=282414069&flowid=3650&softwareid=283415684&release=3.0.0&relind=available&rellifecycle=&RelType=latest

    (2) compile the MIB on MIB browser in format for example MG-SOFT, Kortright. Make sure that there is no error in compilation.

    (3) configure SNMPv2 or SNMPv3 accordingly on switch SGE2010

    (4) search for the CISCOSBCopy.mib file.

    The OID is SNMPv2 - SMI:enterprises (1.3.6.1.4.1) .cisco (9) .otherEnterpise (6) .ciscosb (1) .odm1 (101). CISCOSBCopy (87)

    With the help of rlCopyTable (2), create a new entry on this particular table:

    a. rlCopyRowStatus: 4 (createAndgo)

    b. rlCopySourceLocation: 1 (local)
    c. rlCopySourceIpAddress: 0.0.0.0

    d. rlCopySourceUnitNumber: 1
    e. rlCopySourceFileName: (empty)
    f. rlCopySourceFileType: 3 (config startup), 2 is for execution of config

    g. rlCopyDestinationLocation: 3 (tftp)
    h. rlCopyDestinationIpAddress: 192.168.10.22 (ip address of the tftp server)

    i. rlCopyDestinationUnitNumber: 1
    j. rlCopyDestinationFileName: 0 x 61: 62:63 (in hexadecimal, abc)

    By doing this, it should be able to backup startup config devices unit to remove the tftp server.

  • Access to the table of dynamic addresses via SNMP

    Hello

    I am trying to access the table of dynamic addresses via SNMP, with a PowerConnect 6248 switch. I tried to follow the instructions [1], as other parts of the BRIDGE-MIB are ok on this switch.

    When snmpwalk'ing BRIDGE - MIB:dot1dTpFdbEntry, I have nothing, while, on the switch web interface there are entries in the table.

    Any idea?

    [1] http://www.cisco.com/en/US/tech/tk648/tk362/technologies_tech_note09186a00801c9199.shtml


  • I am trying to install a program and I get entry point getdlldirectoryw could not be found in the library of links Dynamics kernel32.dll file and the same for shreggetvaluesw to shlwapi.dll

    I am trying to install a program and I get entry point getdlldirectoryw could not be found in the library of links Dynamics kernel32.dll file and the same for shreggetvaluesw in shlwapi.dll. How can I fix the problem.

    You have all your current updates?
    Go to windows updates and see if there are updates that you do not have installed.
    The error message seems to indicate that your copy of XP has not been updated.

    Updated and let us know if you still receive the error message.

    Thank you

    Marilyn

  • Access to the use of memory and processing power charge connect 6224 via SNMP.

    Hi support them

    Is it possible to access the use of memory and processing power charge connect 6224 via SNMP? If possible, should the mib I use?

    Thanks in advance

    Rogerio

    When looking through the available MIB found in the zip file for download of the latest firmware.  I see that the MIB fastpathswitching mentions 'agentSwitchCpuProcessGroup '.

    MIB fastpathlogging has 'agentLogInMemoryConfigGroup '.

    There is no reference document material about what offer different MIB.

    I hope this helps.

  • 802. 1 X port management via SNMP

    Hello

    Could someone tell me how to disable 802. 1 X for the specific port via snmp command?

    That is to say, I can do it in the cli "not auto port of authentication control." But I need to do it in the form of "script" more.

    as we can disable/enable the port like this:

    The VALUE ON (1) switch (2) by interface ID
    snmpset-v2c private switch.host.name - c 1.3.6.1.2.1.2.2.1.7.10102 I 2

    I tried to browse the CISCO-PAE-MIB and has not found the solution...

    Links or ideas?

    Thank you.

    Catalyst 2960 S PS Series...

    Hello

    don't know if this will work, but you can try to set to dot1xAuthAuthControlledPortControl by default (3:forceAuthorized):

     snmpset -v2c -c private switch.host.name 1.0.8802.1.1.1.1.2.1.1.6. i 3

    (Note that the Cisco Object Navigator showes an incorrect OID).

    HTH

    Rolf

  • Energy via SNMP

    I was asked to collect periodically switches using SNMP data.

    The command 'Show power' gives me information on the command line (see below), but I can't find the data via SNMP. This data is available via SNMP? Is something specific must be activated to enable it? The switch in question runs the software following if it helps.

    Software Cisco IOS, Catalyst 4500 L3 Switch Software (cat4500e-ENTSERVICESK9-M), Version 12.2 (53) SG2

    show power
    Power                                             Fan      Inline
    Supply  Model No          Type       Status       Sensor   Status
    ------  ----------------  ---------  -----------  -------  -------
    PS1     PWR-C45-4200ACV   AC 4200W   good         good     good
    PS1-1                         220V   good
    PS1-2                         220V   good
    PS2     PWR-C45-4200ACV   AC 4200W   good         good     good
    PS2-1                         220V   good
    PS2-2                         220V   good

    Power supplies needed by system    : 1
    Power supplies currently available : 2

    Power Summary                      Maximum
    (in Watts)              Used     Available
    ----------------------   ----     ---------
    System Power (12V)       1162        1360
    Inline Power (-50V)      1007        2998
    Backplane Power (3.3V)     40          40
    ----------------------   ----     ---------
    Total                    2209 (not to exceed Total Maximum Available = 4200)

    Power Measurement    Inline Power (-50V)
    (in Watts)             (+/- 50Watts)
    ------------------   -------------------
    PS1                         350
    PS2                         350
    ------------------   -------------------
    Total                       700

    Thanks for any help.

    Jon.

    I have been asked to collect data periodically from switches using SNMP.

    The "show power" command gives me that information on the command line (see below), but I am unable to find this data via SNMP. Is this data available via SNMP? Does something specific have to be enabled to allow it? The switch in question is running the following software if it helps.

    Cisco IOS Software, Catalyst 4500 L3 Switch Software  (cat4500e-ENTSERVICESK9-M), Version 12.2(53)SG2

    show power
    Power                                             Fan      Inline
    Supply  Model No          Type       Status       Sensor   Status
    ------  ----------------  ---------  -----------  -------  -------
    PS1     PWR-C45-4200ACV   AC 4200W   good         good     good
    PS1-1                         220V   good
    PS1-2                         220V   good
    PS2     PWR-C45-4200ACV   AC 4200W   good         good     good
    PS2-1                         220V   good
    PS2-2                         220V   good

    Power supplies needed by system    : 1
    Power supplies currently available : 2

    Power Summary                      Maximum
    (in Watts)              Used     Available
    ----------------------   ----     ---------
    System Power (12V)       1162        1360
    Inline Power (-50V)      1007        2998
    Backplane Power (3.3V)     40          40
    ----------------------   ----     ---------
    Total                    2209 (not to exceed Total Maximum Available = 4200)

    Power Measurement    Inline Power (-50V)
    (in Watts)             (+/- 50Watts)

    Hello

    Try with below mib for consumption OID is available as long as the cdp is enabled.

    Maybe one of these MIBs displays the info you are looking for.

    cefcFRUPowerSupplyGroupTable.1.1
    cefcFRUPowerSupplyGroupTable.1.2
    cefcFRUPowerSupplyGroupTable.1.3
    cefcFRUPowerSupplyGroupTable.1.4
    cefcFRUPowerSupplyGroupTable.1.5
    cefcFRUPowerStatusTable.1.1
    cefcFRUPowerStatusTable.1.2
    cefcFRUPowerStatusTable.1.3
    cefcMaxDefaultInLinePower
    cefcFRUPowerSupplyValueTable.1.1
    cefcFRUPowerSupplyValueTable.1.2
    cefcFRUPowerSupplyValueTable.1.3
    cefcFRUPowerSupplyValueTable.1.4
    ciscoEntityFRUControlMIB.1.1.5

    Hope to help!

    Ganesh.H

    Don't forget to note the useful message

  • How can I get multi channel audio via the HDMI port on an early 2015 MacBook Pro?

    I try to get the 7.1 audio channels to flow from my MacBook Pro to a cinema set up. The display works fine now I plug the HDMI in however the sound still Mac speakers. I checked the settings and no HDMI output is available. An airtime option is available, but that returns only two channels as a maximum to the receiver. When I go to the configuration of the source on the receiver it receives video at 1080 p 60herts however it is specifically stated No Audio from the Source.

    Also, I have connected my iPhone 6 s more using an Apple through the same HDMI cable adapter and it works perfectly. We also use HDMI with our PS4 occasionally and it works perfectly, even with the 3D.

    Thus, the MacBook Pro is early 2015 with an i5, the receiver is a Harmon Kardon AVR 2700 (we run 7.1 channels of this) and we are connecting via the HDMI port through a 50 ft HDMI before. The receiver sends the audio to a projector with 1080 p 60 hertz if it changes anything...

    Also if it helps the receiver supports dts - hd master audio decoding, Dolby True HD/Digital Plus decoding, HDMI 1.4 (HDMI is compatible 2.0), as well as multi-channel input and PCM and linear PCM.

    I use a "Behringer UCA202' audio device I bought on amazon.com for only $29.

    It works very well for the audio 5.1 or 7.2. Works connect optical toslink. Just plug it into a usb port on your Mac and a cable optical toslink to your AV receiver.

    My Yahmaha 7.2 audio/video receiver is measuring process the digital signal in THX, DTS, Dolby digital Pro logic, a cinema, etc.

  • Thunbird does not open after upgrade, I get entry point not found cubeb_get_min_latency could not be located in gkmedias.dll

    Thunderbird just failed after an update. It does not open. I get the following message:
    Not found entry point cubeb_get_min_latency could not be located in gkmedias.dll
    Any help with what I can do to manage this?
    Thank you very much
    Chris

    Download a complete Installer and reinstall. You can get it here:

  • my search bar (22 FF) has suddenly become unusable; hitting enter does nothing (now get only toward sites via links and bookmarks)

    I am a FF user for a long time. Now uses version 22 (which seems to have updated from 18 in itself even if I had it to ask me before the update - but 22 2 has worked well for me once I had solved the problem of screen being so great he hid my menu at the top and tabs). Now, all of a sudden, just in the last week, recording a (valid) url in the search bar and pressing on enter "does not" do anything. No search functionality at all because that hitting enter does not cause FF take any notice of putting me in a URL for a site that I want to go to the (I use the same sites over and over so not only some new site acting upward).

    Not my keyboard or mouse is defective; they work as usual in other programs I constantly use - email, database of inventory - and no update or the other program, in Word, Excel, NotePad, my photo program, what that is. Security Essentials last updated a week ago, but I can't see inside to see if it changed anything. Am a XP Pro user and update (until next year, at least!). Keyboard is a real Elite Force, the change (wired) mouse. Have used for a couple of years is therefore not new to me.

    Only way that I can use 22 FF in the last days to get to "any" site, including mine, is to spend on websites pinned to my screen open or my favorites. I tried unpin some sites on my logon screen and then type in their URL and pressing on enter but which has not changed anything - the search bar is always unusable and hit "enter" doesn't do anything.

    So why my search bar did stop working? Is there a solution?

    Hi aaabooks

    You are running Firefox in compatibility mode?

    You can open the properties of the desktop Firefox shortcut via the context menu and check under the tab "compatibility".

    Make sure that all items are disabled in the tab "Compatibility" in the Properties window.

    Create a new profile as a test to see if your profile is the source of the problems.

    See "create a profile":

    If the new profile works then you can transfer files from a profile in the new profile, but be careful not to copy files corrupted to avoid transporting on the problem.

  • Get FrontPanel control references via ActiveX

    Hello

    I tried to get the references to controls frontpanel via LabVIEW ActiveX Server, equivalent to the LabVIEW code:

    but I can't find the ActiveX methods / propertis to use.   Is there a way to do this?

    / LeifS

    The ActiveX Automation Server interface to the LabVIEW VI server exposes only a very small subset to the real VI LabVIEW server. Basically, it's enough to load and run special and pass the values to the controls on the front panel by name, but that's all.

    The reason is twofold. When VI Server was introduced in around LabVIEW LabVIEW 5.0, it was especially exposed total VI server functionality. He was not at all script and controls only limited access to the hierarchy of the objects of the façade. Even in this case the ActiveX interface not only exposes all methds and VI server properties, in part because exposure of LabVIEW internas would have required a vast typelibrary ActiveX, in part because it was not a major concern to be able to do more than launch screw through it. It was better than the DDE interface already by a long stretch.

    VI server was then extended in later versions, but the ActiveX interface was really changed much, also because Microsoft had .net and declared the exaggeration of the ActiveX from a few years earlier to be discouraged anyway.

  • How to get tickets Kebores initializtion via VPN

    How to get the ticket of Kebores initializtion via the VPN for Single Sign on

    Hello

    The question you have posted is related to a virtual private network and would be better suited to the TechNet community.
    Please visit the link below to find a community that will provide the support you want.
    http://social.technet.Microsoft.com/forums/en-us/itproxpsp/threads

    I hope this helps.
  • Redirect 302 get only when connected via BES loop

    Hello

    I have a problem when I am connected via BES, I get a server redirection loop (it returns a 302 with the originial URL response in the "location" header field). When it is connected via the BIS-B, WiFi or carrier, the server returns redirects as expected and the app works. However I require a BES connection and him give a priority when they are available.

    Note that I checked the connection returned by Networking.java string is correct (we add ";) (deviceside = false' when BES is to be using).

    Here's the network code I use:

    package [redacted]
    
    /*
     * Networking.java
     *
     * This code is based on the connection code developed by Mike Nelson of AccelGolf.
     * http://blog.accelgolf.com/2009/05/22/blackberry-cross-carrier-and-cross-network-http-connection
     *
     */
    
    import net.rim.device.api.system.CoverageInfo;
    import net.rim.device.api.system.DeviceInfo;
    import net.rim.device.api.system.WLANInfo;
    
    public class Networking
    {
        Networking()
        {
        }
    
    // Whether or not to the simulator should use MDS to connect.
    // By default this should be false, however if you are testing
    // in an environment where MDS will be the expected connection method,
    // set this to true to have the simulator attempt to use MDS.  This variable
    // has no effect on what happens on a real device.
        private static final boolean isMDS = false;
    
        // the timeout
        public static final int TIMEOUT = 30000;
    
        /**
         * Determines what connection type to use and returns the necessary string
         * to use it.
         *
         * @return A string with the connection info
         */
        public static String getConnectionString()
        {
    
            String connectionString = null;
    
            // Simulator behavior is controlled by the USE_MDS_IN_SIMULATOR variable.
            if (DeviceInfo.isSimulator())
            {
                if (isMDS)
                {
                    connectionString = ";ConnectionTimeout=" + TIMEOUT + ";deviceside=false";
                }
                else
                {
                    connectionString = ";ConnectionTimeout=" + TIMEOUT + ";deviceside=true";
                }
            }
    
            // Check for an MDS connection instead (BlackBerry Enterprise Server)
            else if ((CoverageInfo.getCoverageStatus() & CoverageInfo.COVERAGE_MDS) == CoverageInfo.COVERAGE_MDS)
            {
                System.out.println("MDS coverage found");
                connectionString = ";ConnectionTimeout=" + TIMEOUT + ";deviceside=false";
            }
    
            else if ((CoverageInfo.getCoverageStatus() & CoverageInfo.COVERAGE_BIS_B) == CoverageInfo.COVERAGE_BIS_B)
            {
                // otherwise, use the Uid to construct a valid carrier BIS-B request
                System.out.println("Using BIS");
                connectionString = ";ConnectionTimeout=" + TIMEOUT + ";deviceside=false;ConnectionType=[redacted]";
            }
    
            // Wifi is the preferred transmission method
            else if (WLANInfo.getWLANState() == WLANInfo.WLAN_STATE_CONNECTED)
            {
                System.out.println("Using WIFI");
                connectionString = ";interface=wifi";
            }
    
            // Is the carrier network the only way to connect?
            else if ((CoverageInfo.getCoverageStatus() & CoverageInfo.COVERAGE_DIRECT) == CoverageInfo.COVERAGE_DIRECT)
            {
    
                // Has carrier coverage, but not BIBS.  So use the carrier's TCP network
                System.out.println("Device is connected Direct");
                connectionString = ";ConnectionTimeout=" + TIMEOUT + ";deviceside=true";
    
            }
    
            // If there is no connection available abort to avoid bugging the user unnecssarily.
            else if (CoverageInfo.getCoverageStatus() == CoverageInfo.COVERAGE_NONE)
            {
                System.out.println("There is no available connection.");
            }
    
            // In theory, all bases are covered so this shouldn't be reachable.
            else
            {
                System.out.println("no other options found, assuming device.");
                connectionString = ";ConnectionTimeout=" + TIMEOUT + ";deviceside=true";
            }
    
            return connectionString;
        }
    }
    

    Here is sendRequest managed the connection method and the redirection:

    public HttpResponse sendRequest(HttpRequest request)
        {
            String url = request.getUrl();
            if (url == null)
            {
                HttpResponse result = new HttpResponse();
                result.responseCode = 404;
                result.responseMessage = "Not Found";
                return result;
            }
    
            ConnectionWrapper cw = connectionWrapperForRequest(request);
            if (cw == null)
            {
                return null;
            }
    
            boolean compressionEnabled = !request.disableCompression() && COMPRESSION_ENABLED;
    
            HttpResponse result = new HttpResponse();
            try
            {
                String finalURL = url.trim() + Networking.getConnectionString();
                cw.connection = (HttpConnection) Connector.open(finalURL, Connector.READ_WRITE, false);
                System.out.println("Connection string: " + Networking.getConnectionString());
                System.out.println("Full connec.  URL: " + finalURL);
    
                if (cw.connection == null)
                {
                    result.errorMessage = "Could not open a network connection.";
                    result.completedWithError = true;
                    return result;
                }
    
                cw.connection.setRequestMethod(request.getHttpMethod());
    
                if (compressionEnabled)
                {
                    cw.connection.setRequestProperty("Accept-Encoding", "gzip");
                }
    
                cw.connection.setRequestProperty("User-Agent",
                        "" + DeviceInfo.getManufacturerName() + "/" + DeviceInfo.getDeviceName() + "/" + Config.getVersionNumber());
                if (request.username() != null)
                {
                    cw.connection.setRequestProperty("Authorization", "Basic " + Utils.base64Encode(request.username() + ":" + request.password()));
                }
    
                // set this header so BES servers will not change the content of the headers
                cw.connection.setRequestProperty("x-rim-transcode-content", "none");
    
                //add cookies
                if (HttpCookieJar.getInstance().cookieCount() > 0)
                {
                    cw.connection.setRequestProperty("Cookie", HttpCookieJar.getInstance().getCookiesAsString());
                }
    
                //pull request headers from HttpRequest
    
                Hashtable headers = request.getHeaders();
                for (Enumeration e = headers.keys(); e.hasMoreElements();)
                {
                    String key = (String) e.nextElement();
                    cw.connection.setRequestProperty(key, (String) headers.get(key));
                }
    
                byte[] upstreamBytes = request.requestBytes();
                if (upstreamBytes != null && upstreamBytes.length > 0)
                {
                    Logger.getLogger().log(new String(upstreamBytes));
                    cw.connection.setRequestProperty(HttpProtocolConstants.HEADER_CONTENT_TYPE,
                            HttpProtocolConstants.CONTENT_TYPE_APPLICATION_X_WWW_FORM_URLENCODED);
                    cw.connection.setRequestProperty(HttpProtocolConstants.HEADER_CONTENT_LENGTH, String.valueOf(upstreamBytes.length));
                    cw.outputStream = cw.connection.openOutputStream();
                    cw.outputStream.write(upstreamBytes);
                }
    
                Logger.getLogger().log("Get response");
    
                result.responseCode = cw.connection.getResponseCode();
                result.responseMessage = cw.connection.getResponseMessage();
    
                Logger.getLogger().log("Status Code: " + result.responseCode);
                Logger.getLogger().log("Status Message: " + result.responseMessage);
    
                //suck out the cookies here
                int fieldNo = 0;
                String headerField;
                while ((headerField = cw.connection.getHeaderField(fieldNo)) != null)
                {
                    if (cw.connection.getHeaderFieldKey(fieldNo).equals("Set-Cookie"))
                    {
                        HttpCookieJar.getInstance().setCookie(headerField);
                    }
                    fieldNo++;
                }
    
                System.out.println("get redirect");
    
                //get redirect location
                String location;
                if ((location = cw.connection.getHeaderField("Location")) != null)
                {
                    if (location == url.trim())
                    {
                        Logger.getLogger().log("Redirect loop");
                    }
                    Logger.getLogger().log("Redirect: " + location);
                    result.redirectLocation = location.trim();
                }
                else
                    result.redirectLocation = null;
    
                byte[] buffer = new byte[HTTP_BUFFER_SIZE];
                int count;
    
                System.out.println("compression");
    
                cw.inputStream = cw.connection.openInputStream();
                if (compressionEnabled)
                {
                    String encoding = cw.connection.getEncoding();
                    if ("gzip".equalsIgnoreCase(encoding))
                    {
                        cw.inputStream = new GZIPInputStream(cw.inputStream);
                    }
                }
    
                cw.inputStream = new DataInputStream(cw.inputStream);
    
                System.out.println("output stream");
    
                ByteArrayOutputStream out = new ByteArrayOutputStream();
                try
                {
                    while ((count = cw.inputStream.read(buffer)) >= 0)
                    {
                        out.write(buffer, 0, count);
                    }
                    result.bytes = out.toByteArray();
                }
                finally
                {
                    out.close();
                }
                cw.close();
                Logger.getLogger().log("Response complete");
            }
            catch (IOException e)
            {
                result.errorMessage = e.getMessage();
                result.completedWithError = true;
                Logger.getLogger().log("ERROR!:" + e.getMessage());
            }
            finally
            {
                removeConnectionWrapper(cw);
            }
            return result;
        }
    

    Here's the whole HttpService.java for the context of the SendRequest method above:

    //#preprocess
    
    //package
    //imports
    
    public class HttpService
    {
        private static HttpService _instance;
    
        private static final boolean COMPRESSION_ENABLED = false;
        private static final int HTTP_BUFFER_SIZE = 1024;
    
        public static synchronized HttpService instance()
        {
            if (_instance == null)
            {
                _instance = new HttpService();
            }
            return _instance;
        }
    
        private WorkQueue _requestQueue = new WorkQueue(1024, 4);
        private Hashtable _connections = new Hashtable(10);
    
        private HttpService()
        {
            // singleton
        }
    
        private ConnectionWrapper connectionWrapperForRequest(HttpRequest request)
        {
            ConnectionWrapper cw = null;
            synchronized (request)
            {
                if (!request.cancelled())
                {
                    cw = new ConnectionWrapper(request);
                    synchronized (_connections)
                    {
                        _connections.put(request, cw);
                    }
                }
            }
            return cw;
        }
    
        private void removeConnectionWrapper(ConnectionWrapper cw)
        {
            synchronized (_connections)
            {
                _connections.remove(cw.request);
            }
            cw.close();
        }
    
        public void cancelRequest(HttpRequest request)
        {
            ConnectionWrapper cw = null;
            synchronized (request)
            {
                synchronized (_connections)
                {
                    cw = (ConnectionWrapper) _connections.remove(request);
                }
                request.setCancelled();
            }
            if (cw != null)
            {
                cw.close();
            }
        }
    
        public void executeRequest(final HttpRequest request)
        {
            _requestQueue.addWorkItem(new Runnable()
            {
                public void run()
                {
                    HttpResponse response = sendRequest(request);
                    if (!request.cancelled() && response != null)
                    {
                        request.completeRequest(response);
                    }
                };
            });
        }
    
        public HttpResponse sendRequest(HttpRequest request)
        {
            String url = request.getUrl();
            if (url == null)
            {
                HttpResponse result = new HttpResponse();
                result.responseCode = 404;
                result.responseMessage = "Not Found";
                return result;
            }
    
            ConnectionWrapper cw = connectionWrapperForRequest(request);
            if (cw == null)
            {
                return null;
            }
    
            boolean compressionEnabled = !request.disableCompression() && COMPRESSION_ENABLED;
    
            HttpResponse result = new HttpResponse();
            try
            {
                String finalURL = url.trim() + Networking.getConnectionString();
                cw.connection = (HttpConnection) Connector.open(finalURL, Connector.READ_WRITE, false);
                System.out.println("Connection string: " + Networking.getConnectionString());
                System.out.println("Full connec.  URL: " + finalURL);
    
                if (cw.connection == null)
                {
                    result.errorMessage = "Could not open a network connection.";
                    result.completedWithError = true;
                    return result;
                }
    
                cw.connection.setRequestMethod(request.getHttpMethod());
    
                if (compressionEnabled)
                {
                    cw.connection.setRequestProperty("Accept-Encoding", "gzip");
                }
    
                cw.connection.setRequestProperty("User-Agent",
                        "" + DeviceInfo.getManufacturerName() + "/" + DeviceInfo.getDeviceName() + "/" + Config.getVersionNumber());
                if (request.username() != null)
                {
                    cw.connection.setRequestProperty("Authorization", "Basic " + Utils.base64Encode(request.username() + ":" + request.password()));
                }
    
                // set this header so BES servers will not change the content of the headers
                cw.connection.setRequestProperty("x-rim-transcode-content", "none");
    
                //add cookies
                if (HttpCookieJar.getInstance().cookieCount() > 0)
                {
                    cw.connection.setRequestProperty("Cookie", HttpCookieJar.getInstance().getCookiesAsString());
                }
    
                //pull request headers from HttpRequest
    
                Hashtable headers = request.getHeaders();
                for (Enumeration e = headers.keys(); e.hasMoreElements();)
                {
                    String key = (String) e.nextElement();
                    cw.connection.setRequestProperty(key, (String) headers.get(key));
                }
    
                byte[] upstreamBytes = request.requestBytes();
                if (upstreamBytes != null && upstreamBytes.length > 0)
                {
                    Logger.getLogger().log(new String(upstreamBytes));
                    cw.connection.setRequestProperty(HttpProtocolConstants.HEADER_CONTENT_TYPE,
                            HttpProtocolConstants.CONTENT_TYPE_APPLICATION_X_WWW_FORM_URLENCODED);
                    cw.connection.setRequestProperty(HttpProtocolConstants.HEADER_CONTENT_LENGTH, String.valueOf(upstreamBytes.length));
                    cw.outputStream = cw.connection.openOutputStream();
                    cw.outputStream.write(upstreamBytes);
                }
    
                Logger.getLogger().log("Get response");
    
                result.responseCode = cw.connection.getResponseCode();
                result.responseMessage = cw.connection.getResponseMessage();
    
                Logger.getLogger().log("Status Code: " + result.responseCode);
                Logger.getLogger().log("Status Message: " + result.responseMessage);
    
                //suck out the cookies here
                int fieldNo = 0;
                String headerField;
                while ((headerField = cw.connection.getHeaderField(fieldNo)) != null)
                {
                    if (cw.connection.getHeaderFieldKey(fieldNo).equals("Set-Cookie"))
                    {
                        HttpCookieJar.getInstance().setCookie(headerField);
                    }
                    fieldNo++;
                }
    
                System.out.println("get redirect");
    
                //get redirect location
                String location;
                if ((location = cw.connection.getHeaderField("Location")) != null)
                {
                    if (location == url.trim())
                    {
                        Logger.getLogger().log("Redirect loop");
                    }
                    Logger.getLogger().log("Redirect: " + location);
                    result.redirectLocation = location.trim();
                }
    
                byte[] buffer = new byte[HTTP_BUFFER_SIZE];
                int count;
    
                System.out.println("compression");
    
                cw.inputStream = cw.connection.openInputStream();
                if (compressionEnabled)
                {
                    String encoding = cw.connection.getEncoding();
                    if ("gzip".equalsIgnoreCase(encoding))
                    {
                        cw.inputStream = new GZIPInputStream(cw.inputStream);
                    }
                }
    
                cw.inputStream = new DataInputStream(cw.inputStream);
    
                System.out.println("output stream");
    
                ByteArrayOutputStream out = new ByteArrayOutputStream();
                try
                {
                    while ((count = cw.inputStream.read(buffer)) >= 0)
                    {
                        out.write(buffer, 0, count);
                    }
                    result.bytes = out.toByteArray();
                }
                finally
                {
                    out.close();
                }
                cw.close();
                Logger.getLogger().log("Response complete");
            }
            catch (IOException e)
            {
                result.errorMessage = e.getMessage();
                result.completedWithError = true;
                Logger.getLogger().log("ERROR!:" + e.getMessage());
            }
            finally
            {
                removeConnectionWrapper(cw);
            }
            return result;
        }
    
        private static class ConnectionWrapper
        {
            final HttpRequest request;
            InputStream inputStream = null;
            OutputStream outputStream = null;
            HttpConnection connection = null;
    
            public ConnectionWrapper(HttpRequest request)
            {
                this.request = request;
            }
    
            public void close()
            {
                try
                {
                    if (outputStream != null)
                        outputStream.close();
                }
                catch (Exception e)
                {
                }
                try
                {
                    if (inputStream != null)
                        inputStream.close();
                }
                catch (Exception e)
                {
                }
                try
                {
                    if (connection != null)
                        connection.close();
                }
                catch (Exception e)
                {
                }
            }
        }
    }
    

    Sorry for the amount of code.

    I had our BES admin visit problematic page via a browser on the Server BES itself.

    Running, the Web server was an update of AJAX-style page that informs the user that they had no access to that particular content. Programmatically, see us all is "the page has been moved here" - but in a browser, it's a different story.

    Thanks again Peter for your insight!

  • can I get the api access via http without redirection service token to the login page for the echo sign?

    Hi guys,.

    I don't have much experience with echo adobe sign api, I want to let my users send their agreements of my site and I do not redirect to Portal sign echo when sending documents.

    Is there a way I can get access to the api token without redirection to the Portal sign echo?

    Note: I noticed in the api v2 here REST API - documents electronic signature software - Adobe Document Cloud, allowed to get the token via login and password sent in the http request, does v5 api also supports something similar to that?

    Thank you!

    Hello Mary,.

    According to the mentioned workflow, it is not possible to achieve this goal without going through the platform of E-Sign using calls to API or OAuth.

    Kind regards

    -Usman

  • VCO get virtual machines by name never ends

    Hello

    I have a problem, when I run the virtual machines by name get, nothing is returned and it never ends. I have another script that tries to do:

    VcPlugin.getAllClusterComputeResouces)

    and it ends never either. I did successfully before but no it does not, it is as if something is wrong with the vCenter or something. If I log in the vCenter I can look up and see all the clusters and virtual machines, but I can't ask him to the VCO.

    Any ideas on this would be useful.

    Thank you

    The issue was the vCenter for this device VRO had run into issues and querying the vCenter did not work from the VRO device. After restarting the device of VRO polling was very good.

Maybe you are looking for

  • Pages to Microsoft Word

    HI guys, I have a document PAGES my MacBook Air, I have problems when I copy it to another Mac running Windows, all I get is an overview document, can anyone advise how I can convert my document Pages

  • Adding months to model number calendar

    Can't go beyond January 2016 - how do I create a 14 month calendar to manage a schedule for Planning newsletter.  I don't want to use the Apple calendar due to limitations in the formatting. Please help - thanksAbunch!

  • Device for pavilion g6 2303tx drivers

    Hey,. I am really surprised by the fact that why I'm here... Its not been another month of purchase. Here I found the link to hp support for my product, i.e. the laptop HP Pavilion 2303TX g6. It comes with Win 8 64 bit/Ubuntu/BACK. Now my question is

  • picture is sideways and I can't just it

    the screen is diaplaying everything on the side AND I don't know how to fix it

  • Get the blue screen error saying windows has shut down to prevent damage to this computer

    My sons computer is BLUE with a message saying that windows was arrested for not to damage your computer. And it is stuck on that screen. Do you know why windows shuts down his computer? * original title - my son computer is blue and a message indica