UCCX 5.0(2) with Connectwise PSA integration help

Unanswered Question
Mar 26th, 2010

Has anyone tried to integrate UCCX 5 Premium with Connectwise PSA? I have a help desk with 10 agents. I have a script that prompts the caller for their customer ID. When the caller enters their customer ID, I want to look up the customer ID in Connectwise PSA and automatically create a ticket for the customer.

Connectwise PSA API uses an HTTP POST request and returns an XML document with the information I want. I wrote able the initial script to read an XML file from a web page, but I am having problems getting UCCX to communicate with Connectwise. The XML file I have is identical to the output of the Connectwise API, and my script works with the test file, but the actual API. I can probably access connectwise through the SQL database, but I prefer to use the API.

One thing I noticed is Connectwise requires HTTPS, and it seems UCCX 5.0 does not.

I am just curious if anyone has worked with this before, or if anyone could point me in the right direction.

Thanks,

Brian Burns

I have this problem too.
0 votes
  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 0 (0 ratings)
Loading.
Anthony Holloway Fri, 03/26/2010 - 12:43

UCCX scripting supports HTTPS, but it does not support HTTP Basic Auth without writing a little Java.

Can you share a bit more about how your are trying to send your HTTP post to the ConnectWise server?  Also, what errors are you receiving.

bgburns Fri, 03/26/2010 - 13:11

The ConnectWise API uses an HTTP Post request to the following website.

https://host/v4_6_release/services/system_io/integration_io/processclientaction.rails

The HTTP POST includes a form element with the name of actionString. The action string to request the company information should be formatted as:

actionString=tmpusernamepasswordPhoneNumberSystem.String

I use the Create URL Document step to setup the call to ConnectWise with the Post method. I setup a parameter with the name "actionString" and the text of the action string is the XML above.

I then use the Create XML Document to setup the XML Document. Connectwise should then return with an XML document formated as follows:

<?xml version="1.0" standalone="yes"?>

 
  
    132 main street
    suite 200
  
   anycity
   xy
   123456
   0
   false
 

Company A
12345


0


If I save the XML code to a file and put it on a web server, I can go to the following url http://server/Company.xml, and everything works fine. But when I use the HTTP POST with the URL and actionString, I get the following error when I test this through Reactive Script.

Connection refused: connect; nested exception is:
java.net.ConnectException: Connection refused: connect


Result: §com.cisco.wf.steps.io.XMLDocument§com.cisco.wf.steps.io.XMLDoc[email protected]§

I'm not sure if I have provided enough information, but please let me know if there is any other information I can provide.

Thanks,

Brian Burns

bgburns Fri, 03/26/2010 - 21:36

If I browse to the URL without the actionString, I receive the following error...

Thanks,

Brian Burns

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ArgumentNullException: Value cannot be null.
Parameter name: s

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

<pre>[ArgumentNullException: Value cannot be null.
Parameter name: s]
   System.IO.StringReader..ctor(String s) +7532482
   ConnectWise.PSA.Common.PartnerApi.ApiTypeFinder.GetTypeFromSerializationString(String actionString, IEnumerable`1 projectSearchPriority, String controlLocation) +124
   ConnectWise.PSA.Common.PartnerApi.PartnerApiActionProcessor.getAction(String actionString, String controlLocation, IEnumerable`1 projectSearchPriority) +51
   ConnectWise.PSA.Common.PartnerApi.PartnerApiActionProcessor.getAction(String actionString) +137
   ConnectWise.PSA.Common.PartnerApi.PartnerApiActionProcessor.Process(String actionString) +74
   v4.Controllers.Services.System_IO.IntegrationIoController.ProcessClientAction(String actionString) +381

[TargetInvocationException: Exception has been thrown by the target of an invocation.]
   Castle.MonoRail.Framework.ControllerLifecycleExecutor.PerformErrorHandling() +76
   Castle.MonoRail.Framework.ControllerLifecycleExecutor.ProcessSelectedAction(IDictionary actionArgs) +548
   Castle.MonoRail.Framework.MonoRailHttpHandler.Process(IRailsEngineContext context) +361
   Castle.MonoRail.Framework.MonoRailHttpHandler.ProcessRequest(HttpContext context) +21
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +181
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75
</pre>

Server Error in '/v4_6_release' Application.

Value cannot be null.
Parameter name: s

bgburns Sun, 03/28/2010 - 09:20

Anthony,

Thanks for your replies.

I've looked over your Java SOAP example with UCCX 5.X. I don't really know the first thing about SOAP, but I think that is going to be the way to get this to work. The only question I have is how do I pass the "actionString=" with the soapRequestTXT.

Anyway, this is the output I receive when I enter the URL with the action string into the browser.

<?xml version="1.0" encoding="utf-16"?>
http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  member
  companyname
  username
  password
  8088
 
   
     
       
          123 Anywhere St
         
       
        Raleigh
        NC
        27609
        12860
        true
        8088
     
   
    CompanyName
    CompanyName
    9195557777
    http://www.website.com
    8088
    TerritoryName
 

Thanks,

Brian Burns

Anthony Holloway Mon, 03/29/2010 - 07:39

So, it's giving you the option for GET.

Try this:

Variables

String xml_response = ""

Script

Set xml_response = URL[https://host/v4_6_release/services/system_io/integration_io/processclientaction.rails?actionString=tmpusernamepasswordPhoneNumberSystem.String]

Just create a new script with one vairable, and this one step, then press F10 twice.  What is now stored in xml_response?

bgburns Mon, 03/29/2010 - 08:36

Thanks for the response,

The connectwise documentation says it uses HTTP POST and HTTP GET, but they recommend the HTTP POST method.

I setup the script with a single string variable and step. This is the value I receive in the xml_response string:

Result: U"\r\n\r\n\r\n\r\nhttp://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\r\n\r\n xmlns=\"http://www.w3.org/1999/xhtml\" >\r\n\r\n\tConnectWise PSA: User Login\r\n\r\n    \r\n         BODY {\r\n\t        margin: 0;\r\n         }\r\n         \r\n         .text {\r\n\t         font-family: tahoma, ms sans serif;\r\n\t         font-size: 12px;\r\n\t         color: black;\r\n         } \r\n         \r\n         .smtext {\r\n\t         font-family: tahoma, ms sans serif;\r\n\t         font-size: 11px;\r\n\t         color: black;\r\n\t         font-weight: normal;\r\n         } \r\n\r\n         .enabled {\r\n \t        height: 15px;\r\n\t        border: 1px solid black;\r\n\t        padding: 2px;\r\n\t        background-color: #FFFFFF;\r\n         }\r\n         \r\n         .enabledActive {\r\n\t        border: 2 outset threedhighlight;\r\n \t        padding: 1;\r\n \t        height: 20px;\r\n\t        background-color: #FFFFFF;\r\n         }\r\n          .frmbtnOff  {\r\n  \t        color : buttontext;\r\n          }\r\n          \r\n          .frmbtnOn  {\r\n  \t        color : blue;\r\n          }\r\n          \r\n         .disabled {\r\n\t        border: 1 solid threeddarkshadow;\r\n\t        padding: 2;\r\n\t        background-color: #CCCCCC;\r\n         }\r\n        .style1\r\n        {\r\n            height: 62px;\r\n        }\r\n    \r\n    \r\n    \r\n    \r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n

\r\n\r\n\t\r\n\t\t\r\n\t\r\n
 
\r\nClick here to refresh after logging in.\r\n      \r\n\r\n    \r\n    \r\n
\r\n\t\r\n    \r\n\r\n\t\r\n\t\t\r\n\t\r\n

\r\n\r\n    \t\t\t\t\r\n\t\t\t\t\t   
\r\n\t\t\t\t\t\t   

ConnectWise requires Microsoft Internet Explorer Version 6.0 or \r\n                                higher.\t   

Please upgradehttp://www.microsoft.com/windows/ie\">upgrade> now.

\r\n\t\t\t\t\t   
\r\n    \t\t\t\t\r\n\t\t\t   
\r\n       \r\n        \r\n    \r\n        \r\n\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\r\n\t\r\n\t\t\r\n\t\r\n
\r\n                           
\r\n                           
\r\n                               
\r\n                   
\r\n\r\n    \r\n         \r\n    \r\n   
\r\n
\r\n\r\n\r\n\r\n"

Thanks,

Brian Burns

Anthony Holloway Mon, 03/29/2010 - 08:43
but they recommend the HTTP POST method
ConnectWise requires Microsoft Internet Explorer Version 6.0 or \r\n                                higher.

That's probably why.  They are sniffing the browser agent, and will not let you connect because you are not using IE 6+.  It's a poor implementation.

You can still try HTTP POST though.  Try this, replace your current set step with this step (swap in the real data, I didn't feel like posting it again):

Script:

URL["http://host/url/here", TEXT[actionString=]]
bgburns Mon, 03/29/2010 - 09:19

I set the xml_response = URL["https://cw.company.com/v4_6_release/services/system_io/integration_io/processclientaction.rails", TEXT[actionString=abcContactCenterpassword08088] ]

When I press F10 to start the debugging, I get the following error.

I tried to run through your SimpleSOAP example over the weekend thinking I was going to have to go through that route. I updated the URL and XML request with my information. I received the same IE version error as seen earlier. I kind of thought it might be checking the browser version. I tried to update the SimpleSOAP code to include the User Agent to try and make ConnectWise think the connection was from IE6 or higher.

conn.setRequestProperty("User-Agent", "Mozilla/4.0 (compatible; MSIE 6.1; Windows XP)");

But I still receive the same IE version error.

Thanks,

Brian Burns

Anthony Holloway Mon, 03/29/2010 - 09:26

So we're right back where we started with the Connection Refused error... hmm.  Let me think about this, and get back to you.  In the mean time, hopefully another NetPro will chime in with the real answer.  =)

bgburns Mon, 03/29/2010 - 13:45

Anthony,

Thanks for all of your help. I don't know if this will help any, but here is what I have been able to get to work in a browser:



  Get Company


 
   function formLoaded()
   {
    $(btnGet).onclick = getTicketInfo;
   }
  
   function $(strName)
   {
    return document.getElementsByName(strName)[0];
   }

   function getCompanyInfo()
  
   {
    var url = "https://cw.company.com/v4_6_release/services/system_io/integration_io/processclientaction.rails";
    var request = window.XMLHttpRequest ? new XMLHttpRequest() : new ActiveXObject("MSXML2.XMLHTTP.3.0");
    request.open("POST", url, true)
    request.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
    request.onreadystatechange = function() {
     if (request.readyState == 4)
     {
      var text = request.responseText;
       $("divResponse").innerText = text+unescape(contents);
     }
    }
   
   $("divResponse").innerHTML = "Please wait... "
   contents = "actionString=abcUCCXpassword08088";
   request.send(contents);
   }
 
  
  Get Company Info


  Response from server:

 



It seems to run fine from a browser, but not outside of a browser. Is there any way to connect from UCCX to the a Web Service URL and make it look like Internet Explorer?

Thanks,

Brian Burns

bgburns Mon, 03/29/2010 - 13:50

I don't know if this would help, but here is the information on the Web Service API:

1.1.3 API Entrypoint Webservice

The entry point to the API is located at:

https:///services/system_io/integration_io.asmx

The WSDL file is available by navigating to:

https:///services/system_io/integration_io.asmx?wsdl

SSL is required on production PSA servers when accessing the API. Any calls received via regular HTTP will be denied on production systems.

1.1.4 ProcessClientAction Web Method

A single web method is used to process the actions received from the integration software. The method signature is:

public string

ProcessClientAction(string actionString)

The actionString consists of the XML string of the action that you would like to perform. The action strings are listed in the reference section of this document.

1.1.5 Plain HTTP POST access to API

In addition to the web services entry point, we also provide a means of accessing the API via direct HTTP POST calls. Get requests are also allowed, but are discouraged.

The entry point for plain HTTP is:

http:///v4_6_release/services/system_io/integration_io/processclientaction.rails

You will pass the actionString (described below) as a form element with a name of "actionString."

Here is an example of a web page that can be used to connect to a psa server and pull down information on a given ticket. Please note that this example requires full trust in IE (only minor changes would be necessary to run it in other browsers) to run against servers other than the one you load the page from.

I am working on a crash course in SOAP and trying to figure out how to get this working. The ConnectWise techsupport is not very helpful. This documentation was about all I could get out of them.

Thanks for any and all help,

Brian Burns

Anthony Holloway Tue, 03/30/2010 - 08:25
It seems to run fine from a browser, but not outside of a browser. Is there any way to connect from UCCX to the a Web Service URL and make it look like Internet Explorer?

Not with the standard steps.  You will need to venture over to the dark side and use some Java kung fu.  Which, reading your previous comments, you have already tried.

Here is the default header plus request, which a script sends when making the below call to my own server:

Set http_response = URL["http://www.avholloway.com/vtools/ipcc/employees/", TEXT[id=1]]

POST /vtools/ipcc/employees/ HTTP/1.1

accept-language: en-US

User-Agent: Java/1.6.0_12

Host: www.avholloway.com

Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2

Connection: keep-alive

Content-type: application/x-www-form-urlencoded

Content-Length: 4

id=1

Perhaps, take a look at this page, and pick a couple more user agent strings to try out.

This really is as easy as the example above.  The ConnectWise is your pain point.

bgburns Thu, 04/08/2010 - 08:08

Thanks for all of the help. I think I am making some progress. I did some research and had a crash course on remote web services with JAX-WS. I'm still trying to flounder my way through this, but here is what I have so far.


I imported the WSDL file from the Connectwise web service API and generated proxy methods using wsimport.exe. I wrote a java class similar to the SimpleSOAP example, compiled this, and successfully tested my connection to the Connectwise server from the command line. I had to specify all the JAX-WS jar files on the command line in the classpath.


I uploaded my Java class, all the JAX-WS .jars, and the classes created by wsimport from the Connectwise WSDL file. I've added all of these .jar files to the classpath and restarted the CRS Engine. I created a new script with a single step similar to the SimpleSOAP example.

When I run this from the command line, every thing runs fine. When I run this through a Contact Center script, I get an exception of java.lang.NoSuchMethodError. I've done some debugging and found that the exception occurs when the script executes the line from my class: response = port.processClientAction(this.action);

I'm not sure why it runs from the command line, but not from Contact Center.

Here is my ConnectWiseAPI.class

import java.io.*;
import java.net.*;
import javax.xml.ws.WebServiceRef;
import org.tempuri.IntegrationIo;
import org.tempuri.IntegrationIoSoap;
import org.tempuri.ProcessClientAction;

public class ConnectWiseAPI {
    @WebServiceRef(wsdlLocation="https://connectwise.company.com/v4_6_release/services/system_io/integration_io.asmx?wsdl")
    IntegrationIo service = new IntegrationIo();
   
    public ConnectWiseAPI(String action) {
        String this.action = action;
    }

    public String getRequest() {
        try {
            IntegrationIoSoap port = service.getIntegrationIoSoap();
            String response = port.processClientAction(this.action);
            return response;
        } catch(Exception e) {
            return "Caught Exception: " + e.getMessage();
        }
    }
}

Here is my CRS script

Start

Set xmlResponse = {

                                   {
                                       ConnectWiseAPI connectwise = new ConnectWiseAPI("abcuccxuserpassword08088");
                                       String xml = connectwise.getRequest();
                                       return xml;
                                   }

                              }

xmlDocument = Create XML Document (xmlDocument)

CustomerID = Get XML Document Data (xmlDocument, "/descendant::Company/child::CompanyID")

End

Here is my RunMyCode.java

public class RunMyCode {
    public static void main(String args[]) {
        String xml;
       
        if (args.length > 0) {
            ConnectWiseAPI connectwise = new ConnectWiseAPI(args[0]);
            xml = connectwise.getRequest();
        } else {
            xml = "No Action String";
        }

        System.out.println(xml);
    }
}

Here is the response I get from the command line when the argument is the action string in the CRS Script.

<?xml version="1.0" encoding="utf-16"?>
http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  zadmin
  abc
  uccxuser
  password
  8088
 
   
     
       
          123 Anywhere St
         
       
        Ralrigh
        NC
        27609
        12860
        true
        8088
     
   
    Company Name, Inc
    ComanyABC
    919-555-1212
    8088
    Company Name
 

I'm still trying to figure other ways to accomplish this, but I don't understand why this runs from the command line but not from the CRS script.

Thanks for any help.

Brian Burns

Valber Carvalho Fri, 04/13/2012 - 11:40

Hi Brian!

Are you ok? I hope so.

Did you have any success about this issue?

Nowadays, I have the same problems than you. Using the Netbeans, I can connect on my Web Service normally by SOAP request or importing the WSDL.

When I try to use the CCX Editor HTTP components I have some problems.

Could you update this post, please?

Have a nice weekend,

Valber

jsteinberg Fri, 05/08/2015 - 07:20

Anthony - is there a way to change the user agent (or any other headers for that matter) with the standard URL[] function in CCX ?

Actions

This Discussion