0

Just need a point in the right direction with this one.

I've created the Cisco Unified Call Manager API via the instructions provided by Cisco, the API for CUCM is called AXL. It's currently in my C# WPF project and works just fine (i've retrieved some phone data successfully), the issue is that the API is in a single CS file that's 345K lines long. This is causing an extremely long delay when I attempt the first action using the API (after it has compiled).

As one user on the Cisco forum advised:

There is a very high chance that your problem is with the time that it takes the .net framework to generate the xml serialization assembly.

Pre-generate the xml serialization assembly when using AXL on .net and your first response will be MUCH faster.

I've tried to pre-generate it using the instructions from user brain backup in this thread. Unfortunately the first use of the API is still around ~45 seconds (it did reduce it by about a minute). I'm not extremely savvy with the debugging tools within Visual Studio so unsure how to check what exactly is causing the issue (but it certainly looks like an issue related to generating the XML).

I was wondering if anyone could recommend of a way to remove the unnecessary methods from the CS file (99% of it won't be used anyway) without having to manually re-create it. Any type of tool that can pull/delete methods and their dependencies from a CS file would be absolutely brilliant.

Erik
  • 91
  • 12
  • 45 seconds is ridiculously long, but it is a magic number. It is the default TCP/IP connection timeout on most machines. Use SysInternals' TcpView utility to see who is getting called. – Hans Passant Mar 06 '18 at 13:52
  • I'll have a look into TcpView when I have a moment. Unfortunately I don't think that it's a timeout issue as the debugger in Visual Studio shows a bunch of garbage collection, constant 20% CPU usage and RAM increases: https://i.imgur.com/ydPbUVw.png the little notch is where the results were finally returned, the CPU usage went back down to idle as well. The data returned isn't much and further runs of the same code only take a second. – Erik Mar 06 '18 at 14:18
  • Well, it is certainly working very hard on *something*. You can use the simple kind of code profiling when it takes that long. Use Debug > Break All and look at the call stack, a couple of times if necessary. – Hans Passant Mar 06 '18 at 14:27

3 Answers3

0

There is a way to check whether you method has been used or not and if used how many times and where check this out.

https://visualstudiomagazine.com/Blogs/Tool-Tracker/2014/12/Finding-Method-Property-Variable.aspx
Mihir Dave
  • 3,954
  • 1
  • 12
  • 28
  • This is neat, unfortunately i'd be clicking a few hundred times per method, it would end up the same amount of time compared to just copying the method and keep filling in compilation errors for the references that are missing. – Erik Mar 06 '18 at 14:06
0

It might make sense to pare the AXL WSDL itself and re-compile - as mentioned, it's unlikely you'll ever use anywhere near the whole schema.

You should be able to just edit AXLAPI.wsdl and remove all of the and elements except for the items you are actually useing.

David Staudt
  • 361
  • 2
  • 2
0

Had the same issue, it was almost unusable with the delay. Two things that I have found to get around this with almost instant results.

  1. Don't use the WSDL. Write your own methods to handle SOAP requests. Takes time and can be error prone but results are almost instant.

  2. Use a tool that can handle large text files, like Notpad++ to open your WSDL generated code file and take only what methods out that you need. This is the method I've choose and it works great.

Also, I believe you could just use the executeSQLQuery methods and cut out a good portion of the rest of the code but I've yet to try it. Each method above I have tried without pregenerating the xml serialization. I found the problem to be with the generated C# axl code file size.

coz
  • 1