Search in sources :

Example 1 with HPD_IncidentInterface_Create_WSPortTypePortType

use of org.opennms.integration.remedy.ticketservice.HPD_IncidentInterface_Create_WSPortTypePortType in project opennms by OpenNMS.

the class RemedyTicketerPlugin method save.

private void save(Ticket newTicket) throws PluginException {
    HPD_IncidentInterface_Create_WSPortTypePortType port = getCreateTicketServicePort(m_createportname, m_createendpoint);
    try {
        String incident_number = port.helpDesk_Submit_Service(getRemedyAuthenticationHeader(), getRemedyCreateInputMap(newTicket)).getIncident_Number();
        LOG.debug("created new remedy ticket with reported incident number: {}", incident_number);
        newTicket.setId(incident_number);
    } catch (RemoteException e) {
        e.printStackTrace();
        throw new PluginException("Problem saving ticket", e);
    }
}
Also used : HPD_IncidentInterface_Create_WSPortTypePortType(org.opennms.integration.remedy.ticketservice.HPD_IncidentInterface_Create_WSPortTypePortType) RemoteException(java.rmi.RemoteException)

Example 2 with HPD_IncidentInterface_Create_WSPortTypePortType

use of org.opennms.integration.remedy.ticketservice.HPD_IncidentInterface_Create_WSPortTypePortType in project opennms by OpenNMS.

the class RemedyTicketerPlugin method getCreateTicketServicePort.

/**
 * Convenience method for initialising the ticketServicePort and correctly setting the endpoint.
 *
 * @return TicketServicePort to connect to the remote service.
 */
private HPD_IncidentInterface_Create_WSPortTypePortType getCreateTicketServicePort(String portname, String endpoint) throws PluginException {
    HPD_IncidentInterface_Create_WSServiceLocator service = new HPD_IncidentInterface_Create_WSServiceLocator();
    HPD_IncidentInterface_Create_WSPortTypePortType port = null;
    try {
        service.setEndpointAddress(portname, endpoint);
        port = service.getHPD_IncidentInterface_Create_WSPortTypeSoap();
    } catch (ServiceException e) {
        LOG.error("Failed initialzing Remedy TicketServicePort", e);
        throw new PluginException("Failed initialzing Remedy TicketServicePort", e);
    }
    return port;
}
Also used : ServiceException(javax.xml.rpc.ServiceException) HPD_IncidentInterface_Create_WSServiceLocator(org.opennms.integration.remedy.ticketservice.HPD_IncidentInterface_Create_WSServiceLocator) HPD_IncidentInterface_Create_WSPortTypePortType(org.opennms.integration.remedy.ticketservice.HPD_IncidentInterface_Create_WSPortTypePortType)

Aggregations

HPD_IncidentInterface_Create_WSPortTypePortType (org.opennms.integration.remedy.ticketservice.HPD_IncidentInterface_Create_WSPortTypePortType)2 RemoteException (java.rmi.RemoteException)1 ServiceException (javax.xml.rpc.ServiceException)1 HPD_IncidentInterface_Create_WSServiceLocator (org.opennms.integration.remedy.ticketservice.HPD_IncidentInterface_Create_WSServiceLocator)1