01-22-2014 09:27 AM
Since upgrading Unity Connection from 9.1.(1) to 9.1(2) SU1 I can no longer establish a connection using the CUPI API.
The result code reported by the API is simply:
"Login failed to Connection server:unitypub.nait.ca"
I'm using the .NET CUPI Fast Start API version 3.0.28.0. In order to rule out my own app as the problem I've also attempted to use the CUPIFastStart project and receive the same result.
I've enabled VMREST micro traces on the publisher and collected the following from the Tomcat logs:
23:08:57.577 |12710,,,VMREST,3,DEBUG [http-bio-443-exec-3] com.cisco.connection.rest.SecurityFilter - IMS result code: 0
23:08:57.578 |12710,,,VMREST,3,DEBUG [http-bio-443-exec-3] com.cisco.connection.rest.RequestFilter - REQUEST GET version
23:08:57.578 |12710,,,VMREST,3,DEBUG [http-bio-443-exec-3] com.cisco.connection.rest.helper.DataHelper - executeQuery: query='SELECT FIRST 1 Product FROM tbl_SchemaInformation WHERE IsCurrent=1'
23:08:57.579 |12710,,,VMREST,3,DEBUG [http-bio-443-exec-3] com.cisco.connection.rest.helper.DataHelper - getValuesFromQuery: product=9.1.1.2TT1
23:08:57.579 |12710,,,VMREST,3,DEBUG [http-bio-443-exec-3] com.cisco.connection.rest.ResponseFilter - RESPONSE filter IN
I interpret the first line of the debug to be a successful login attempt based on the information provided from http://docwiki.cisco.com/wiki/Cisco_Unity_Connection_APIs_--_Troubleshooting
From what I can tell this all seems normal. Fiddler also seems to indicate that the JSON response is being sent back to the client application.
JSON
name=vmrest
version=9.1.1.2TT1
As a further confirmation, I've stood up a new 9.1(0.32) version of Unity Connection and tested both the CUPIFastStart and my own code and it works just fine. Something has definitely changed in 9.1(2).
I also did some further debugging of the ConnectionServerRest API code and found that the WebCallResult for the GetVersionInfo function returned the following:
{ WebCallResults contents:
URL Sent: https://unitypub:8443/vmrest/version
Method Sent: GET
Body Sent:
Success returned: False
Status returned 200:Ok
Error Text: No version version returned logging into Connection server: unitypub, return text={"name":"vmrest","version":"9.1.1.2TT1"}
Raw Response Text: {"name":"vmrest","version":"9.1.1.2TT1"}
Total object count: 0
Status description: OK
}
ErrorText: "No version version returned logging into Connection server: unitypub, return text={\"name\":\"vmrest\",\"version\":\"9.1.1.2TT1\"}"
JsonDictionary: Count = 2
Method: "GET"
Misc: null
RequestBody: ""
ResponseText: "{\"name\":\"vmrest\",\"version\":\"9.1.1.2TT1\"}"
ReturnedObjectId: null
StatusCode: 200
StatusDescription: "OK"
Success: false
TotalObjectCount: 0
Url: "https://unitypub:8443/vmrest/version"
XmlElement: null
It seems odd that the StatusCode is 200 yet the Success is false.
Solved! Go to Solution.
02-06-2014 09:19 PM
The latest version is 3.0.30.0.
You can import latest code from Tortoise SVN. Please verify that version mentioned in AssemblyInfo.cs is AssemblyVersion("3.0.30.0")
I checked in lab and able to login successfully and got Success=True and 200 OK in response.
02-05-2014 02:59 PM
Can you provide the error in the logs? I see you pointed out "Login failed to Connection server:unitypub.nait.ca" but was there anything else before or after that line?
Thanks,
Adrienne
02-05-2014 03:43 PM
The login failure message was what the CUPI FastStart sample project returns. What actually is returned from the webservice call GetVersionInfo is the following WebCallResult object:
{ WebCallResults contents:
URL Sent: https://unitypub:8443/vmrest/version
Method Sent: GET
Body Sent:
Success returned: False
Status returned 200:Ok
Error Text: No version version returned logging into Connection server: unitypub, return text={"name":"vmrest","version":"9.1.1.2TT1"}
Raw Response Text: {"name":"vmrest","version":"9.1.1.2TT1"}
Total object count: 0
Status description: OK
}
ErrorText: "No version version returned logging into Connection server: unitypub, return text={\"name\":\"vmrest\",\"version\":\"9.1.1.2TT1\"}"
JsonDictionary: Count = 2
Method: "GET"
Misc: null
RequestBody: ""
ResponseText: "{\"name\":\"vmrest\",\"version\":\"9.1.1.2TT1\"}"
ReturnedObjectId: null
StatusCode: 200
StatusDescription: "OK"
Success: false
TotalObjectCount: 0
Url: "https://unitypub:8443/vmrest/version"
XmlElement: null
of was what was being returned following an attempt to connect to the "after That message is from the CUPI FastStart project.
The Tomcat debug logs and Fiddler seem to indicate that the data is indeed being sent.
02-05-2014 10:25 PM
Hi,
When i hit the url https://ucbu-aricent-vm207.cisco.com/vmrest/version in browser, success is returned after entering admin credentials.
<VersionInformation><name>vmrest</name><version>9.1.1.2TT1</version></VersionInformation>
Thus issue can be in the tool, which you are using.
02-06-2014 03:02 PM
I am also able to retrieve a response from the Webservice when calling it directly.
Where I get the failure is when attempting to utilize the REST .NET SDK published on ciscounitytools.com. See the link below:
http://www.ciscounitytools.com/CodeSamples/Connection/CUPI/CUPI.html
I am using the current version. 3.0.28.
Regards,
Mario
02-06-2014 08:50 PM
Ok Mario,
I will discuss with Jeff, who developed and posted this tool.
02-06-2014 09:19 PM
The latest version is 3.0.30.0.
You can import latest code from Tortoise SVN. Please verify that version mentioned in AssemblyInfo.cs is AssemblyVersion("3.0.30.0")
I checked in lab and able to login successfully and got Success=True and 200 OK in response.
02-06-2014 10:27 PM
That did it! Thanks very much, I'm back in business.
04-23-2014 11:13 AM
just as a follow up - recent versions of the CUPI API (among others) are now hosted on NuGet - it's lots easier to add them to your .NET projects using NuGet and then you can automatically check for updates and load them on the fly - very handy.
Most of the tools I post on CiscoUnityTools.com are built with the ODBC and REST SDKs and most are on NuGet now - saves a lot of headaches.
To be clear the 9.1 line added new security protocols (and 10.0 added far stricter timing control on anonymous logins etc...) these changes had to be accounted for in the REST based SDKs
Check the CUPI REST SDK home page for details:
http://www.ciscounitytools.com/CodeSamples/Connection/CUPI/CUPI.html
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide