Creating a Proteus API Module for .NET and Powershell (Courtesy BlueCat Networks)



Prerequisites:
You will need the following tools installed to continue:
1. Web Services Description Language Tool (Wsdl.exe) from Microsoft. WSDL.exe is included in the .NET 2.0 SDK. (be sure to select your target .NET framework version) 

1. Creating a Proteus .NET proxy class and library.
To create the proxy class:
1. Run WSDL.exe from the .NET SDK to generate the proxy class source code file: 

wsdl.exe http://[ProteusIPOrHostName]/Services/API?wsdl /out:ProteusAPI.cs

To compile the proxy class to a library for use with PowerShell or .NET Projects.
1. Open the ProteusAPI.cs file in a text editor and locate the ProteusAPI() method. Modify the method definition to appear exactly as shown below and then save the file. 

public ProteusAPI()
this.CookieContainer = new System.Net.CookieContainer();
}
2. Compile the C# class to a DLL using the command line compiler or Visual Studio. 
If the compiler is not available in your system’s path environment variable it can be found here: 

C:\Windows\Microsoft.NET\Framework[64]\[.NETVersionNumber]\csc.exe. 

Command line compiler syntax is as follows: 

csc /t:library /out:ProteusAPI.dll ProteusAPI.cs 

(substitute double-quoted full paths to the ProteusAPI.cs file and the output ProteusAPI.DLL file if the input file isn’t in the command line prompt’s current directory)

3. OPTIONAL: Install the library into your workstation’s Global Assembly Cache: http://msdn.microsoft.com/en-us/library/2bc0cxhc.aspx

2. Using the Proteus proxy library
NOTE: The BlueCat Proteus Perl and Java API modules are compiled modules with specific helper methods that are not present in the Proteus SOAP API. Because the Proteus .NET library is generated directly from the Web Services Description Language (WSDL) file, it does not contain the helper methods described in the Perl and Java examples within the ‘API Sessions’, ’Java API Examples’, and ’Perl API Examples’ sections of the Proteus API Guide. The API Object Methods, API Constants, and API Method Reference sections of the Proteus API Guide are the sections you want to focus on for using the .NET module.
  • The ProteusAPI.cs file can now be added as a utility class to any Visual Studio C# project.
  • The ProteusAPI.dll can be added as a Reference to any Visual Studio project.
  • The ProteusAPI.dll can be used from PowerShell scripts. (see example below)

3. Using the Proteus proxy library with Microsoft Powershell
Once the Proteus.dll module has been compiled it can be used directly within Microsoft PowerShell scripts with full access to the Proteus Web Services API. The API Object Methods, API Constants, and API Method Reference sections of the Proteus API Guide are the sections you want to focus on for .NET and PowerShell.

PowerShell Example:

/* Replace [APIUserID] below with your Proteus API account username */ 
$proteusAPI_ID = '[APIUserID]' 
/* Replace [APIUserPassword] below with your Proteus API account password */ 
$proteusAPI_PWD = '[APIUserPassword]' 
/* Replace [PathToProteusAPI.dll] below with the single quoted path to your ProteusAPI.dll module, e.g. 'C:\ProteusAPI.dll' */ 
$proteusdll = [System.Reflection.Assembly]::LoadFile([PathToProteusAPI.dll]) 
/* Instantiate a new ProteusAPI Object */ 
$p1 = New-Object ProteusAPI 
/* Set the new ProteusAPI Object’s ‘url’ property to your Proteus IP or hostname and path to the web service endpoint */ 
$p1.url = "http://[ProteusIPOrHostName]/Services/API" 
/* Call the login() method passing the API username and password as defined above or as strings, e.g. $p1.login('username', 'password ') */ 
$p1.login($proteusAPI_ID, $proteusAPI_PWD) 
/* Call the Proteus API method(s) you wish to use, such as the addMACAddress() example below. */ 
$newMACProteusObjectId = $p1.addMACAddress('1','00-00-00-11-11-11', '') 
/* Do any further processing … */ 
/* Make sure to call the logout() method to close the session when finished. */ 
$p1.logout()

Creating a Proteus API Module for .NET and Powershell (Courtesy BlueCat Networks) Creating a Proteus API Module for .NET and Powershell (Courtesy BlueCat Networks) Reviewed by Shawn on 7:51 AM Rating: 5

106 comments:

  1. Hi admin, i went through article. As we all know, .net is most popular programming language and it offer huge career prospects for talented professionals. It’s totally awesome, keep on updating your blog with such awesome information.
    Regards,
    DOT NET Training in Chennai|Best DOT NET Training institute in Chennai

    ReplyDelete
    Replies
    1. This comment has been removed by a blog administrator.

      Delete
  2. have one thats fully built and we can just download?

    ReplyDelete
  3. This is excellent information. It is amazing and wonderful to visit your site.Thanks for sharing this information and it is very useful to me...
    MSC Project Center in Chennai | MSC Project Center in Velachery

    ReplyDelete
  4. I have to voice my passion for your kindness giving support to those people that should have guidance on this important matter.
    Docker-training-in-chennai

    ReplyDelete
  5. Thanks a lot very much for the high quality and results-oriented help. I won’t think twice to endorse your blog post to anybody who wants and needs support about this area.
    java training in chennai

    ReplyDelete
  6. Needed to compose you a very little word to thank you yet again regarding the nice suggestions you’ve contributed here.

    Hadoop training in bangalore

    ReplyDelete
  7. Those guidelines additionally worked to become a good way to recognize that other people online have the identical fervor like mine to grasp great deal more around this condition.


    DevOps Training in Bangalore

    ReplyDelete
  8. Very interesting content which helps me to get the indepth knowledge about the technology. To know more details about the course visit this website.
    Loadrunner Training in Chennai
    Hadoop Training in Chennai
    Android Training in Chennai
    Digital Marketing Course in Chennai
    JAVA Training in Chennai
    Best JAVA Training in Chennai

    ReplyDelete
  9. Such an excellent and interesting blog, do post like this more with more information, this was very useful, Thank you.
    Aviation Academy in Chennai
    Aviation Courses in Chennai
    best aviation academy in chennai
    aviation training in chennai

    ReplyDelete
  10. You can find the best casino here all online casinos are good Big win is waiting for you.

    ReplyDelete
  11. Подскажите где найти блок питания для светодиодной ленты, нашел в компании Ekodio вроде хорошие, буду тестить.

    ReplyDelete
  12. Nice blog. Thank you for sharing. The information you shared is very effective for learners I have got some important suggestions from it…
    No.1 Software Testing Training institute in Chennai|No.1 Software Testing Training institute in Pallikaranai

    ReplyDelete
  13. Informative article you shared. Thanks for sharing such nice article, keep on updating such good articles.
    Best Python Training Institute in Chennai |Best Python Training Institute in Pallikaranai

    ReplyDelete
  14. This is great and really informative.. I’ll keep following your web and your article, thanks for sharing
    Best Software Testing Training in Chennai | Best Software Testing Training in Velachery

    ReplyDelete
  15. This is great and really informative.. I’ll keep following your web and your article, thanks for sharing..
    Best dotnet Training Institute in Chennai |Best dotnet Training Institute in Velachery

    ReplyDelete
  16. Nice post... Really you are done a wonderful job. Thanks for sharing such wonderful information with us. Please keep on updating...
    Best Hardware and Networking Training Institute in Chennai |Best Hardware and Networking Training Institute in Kanchipuram

    ReplyDelete
  17. Nice and Informative article you shared. Thanks for sharing such nice article, keep on updating such good articles.
    Best Dotnet training Institute in Chennai | Best Dotnet training Institute in Velachery

    ReplyDelete
  18. Nice and Informative article you shared. Thanks for sharing such nice article, keep on updating such good articles.
    Best Dotnet training Institute in Chennai | Best Dotnet training Institute in Velachery

    ReplyDelete
  19. Excellent information with unique content and it is very useful to know about the
    information based on blogs...
    Best Tally training Institute in Chennai | Best Tally training Institute in Velachery

    ReplyDelete
  20. Thanks for sharing such an informative article. Hopefully you will continuously share such article.
    Best Python Training Institute in Chennai | Best Python Training Institute in Velachery

    ReplyDelete
  21. Thanks for sharing such an informative article. Hopefully you will continuously share such article.
    Tally Training Institute in Chennai | Tally course in Pallikaranai

    ReplyDelete
  22. The strategy you have posted on this technology helped me to get into the next level and had lot of information in it…
    Best Tally Training Institute in Chennai |Best Tally Training Institute in Pallikaranai

    ReplyDelete

  23. The information you have here is really useful to make my knowledge good. It is truly supportive for us and I have accumulated some essential data from this blog.
    Best Linux Training Institute in Chennai | Best Linux Training Institute in Guindy

    ReplyDelete
  24. Post is very informative… It helped me with great information so I really believe you will do much better in the future.
    Best Software Testing Training Institute in Chennai | Best Software Testing Training Institute in Velachery

    ReplyDelete
  25. Post is very informative… It helped me with great information so I really believe you will do much better in the future.
    Best Java Training Institute in Chennai|Best Java Training Institute in Taramani

    ReplyDelete
  26. Pretty article! I found some useful information in your blog, it was awesome to read, thanks for sharing this great content to my vision, keep sharing.
    Best Software Testing Training Institute in Chennai | Best Software Testing Training Institute in Velachery

    ReplyDelete
  27. Good Post! Thank you so much for sharing this pretty post, it was so good to read and useful to improve my knowledge as updated one, keep blogging…
    Graphics Designing & Multimedia Training Institute in Chennai | Graphics Designing & Multimedia Training Institute in Velachery

    ReplyDelete
  28. This is really impressive post, I am inspired with your post, do post more blogs like this, I am waiting for your blogs.
    Best Tally Training Institute in Chennai|Best Tally Training Institute in Velachery

    ReplyDelete
  29. Nice and good article. It is very useful for me to learn and understand easily. Thanks for sharing your valuable information and time. Please keep updating...
    Best Microsoft .net Training Institute in Chennai | Best Microsoft .net Training Institute in Velachery

    ReplyDelete
  30. Nice blog. Thank you for sharing. The information you shared is very effective for learners I have got some important suggestions from it…
    Best Tally Training Institute in Chennai | Best Tally Training Institute in Pallikaranai

    ReplyDelete
  31. Excellent information with unique content and it is very useful to know about the information based on blogs...
    Best Dotnet Training Institute in Chennai |Best Dotnet Training Institute in Guindy

    ReplyDelete
  32. Your info is really amazing with impressive content..Excellent blog with informative concept. Really I feel happy to see this useful blog, Thanks for sharing such a nice blog..
    If you are looking for any Data science Related information please visit our website Data science courses in Pune page!

    ReplyDelete
  33. Very nice post here and thanks for it .I always like and such a super blog of these post.Excellent and very cool idea and great blog of different kinds of the valuable information's.
    Best Tally Erp 9.0 Course Training Institute in kanchipuram|

    ReplyDelete
  34. Interesting post!!! Thanks for posting such a useful information. I wish to read your upcoming post to enhance my skill set and keep blogging.
    Best Tally Erp 9.0 Course Training Institute in kanchipuram|

    ReplyDelete
  35. Thanks for your informative blog.Your post helped me to understand the future and career prospects. Keep on updating your blog with such awesome blog.
    No:1 IT Project Center in Kanchipuram



    ReplyDelete
  36. Really it was an awesome blog...very interesting to read..You have provided an nice information....Thanks for sharing..
    Best Hardware & Networking Course Training Institute in kanchipuram|

    ReplyDelete
  37. Thanks for sharing in this blog...its very useful for us...keep on going...
    Best MS Office Course Training Institute in kanchipuram|

    ReplyDelete
  38. Nice blog. Thank you for sharing. The information you shared is very effective for

    learners I have got some important suggestions from it.
    No:1 CCNA Training Academy in

    Kanchipuram


    ReplyDelete
  39. Awesome post. Really you are shared very informative information... Thank you for sharing. Keep on updating...
    Best AWS (Advanced Amazon Web Services) Course Training Institute in kanchipuram|

    ReplyDelete
  40. I think this is the best article today. Thanks for taking your own time to discuss this

    topic, I feel happy about that curiosity has increased to learn more about this topic.

    Keep sharing your information regularly for my future reference.No:1 CCNP Training Academy in

    Kanchipuram



    ReplyDelete
  41. I am reading your post from the beginning, it was so interesting to read & I feel thanks to you for posting such a good blog, keep updates regularly.
    Best Cloud Computing Course Training Institute in kanchipuram|

    ReplyDelete
  42. Nice..You have clearly explained about the conept..Its very useful for me to
    undertand..Keep on sharing..

    No:1Tally Training Academy in Kanchipuram







    ReplyDelete
  43. Marvelous and fascinating information.Thanks for this greatful blog. keep your blog updated.
    Best Hardware & Networking Course Training Institute in kanchipuram|

    ReplyDelete
  44. Nice..You have clearly explained about the conept..Its very useful for me to
    undertand..Keep on sharing..

    No:1 Embedded system Training Academy in Kanchipuram







    ReplyDelete
  45. I’m sincerely suggesting your blog.nice and really helpful information to everyone... thanks for sharing
    Best Python Course Training Institute in kanchipuram|

    ReplyDelete
  46. great and nice blog thanks sharing..I just want to say that all the information you have given here is awesome...Thank you very much for this one.
    No:1 Best EEE Project Center in kanchipuram|

    ReplyDelete
  47. really you have posted an informative blog. it will be really helpful to many peoples. thank you for sharing this blog. so keep on sharing such kind of useful blogs.
    No:1 Best NS2 (Network Simulator) Project Center in kanchipuram|

    ReplyDelete
  48. very usefull informatation.and iam expecting more posts like this please keep updating us....
    No:1 Best Android Project Center in kanchipuram|

    ReplyDelete
  49. This is excellent information. It is amazing and wonderful to visit your site.Thanks
    for sharing this information, this is useful to me…

    No:1Robotics project Center in Kanchipuram









    ReplyDelete
  50. You post explain everything in detail and it was very interesting to read.Thank you for Sharing.
    No:1 Best Dotnet Project Center in kanchipuram|

    ReplyDelete
  51. After I see your blog it was so impressive and informative content. thanks for sharing such a lovely blog.
    No:1 Best MBA (Master of Business Administration) Project Center in kanchipuram|

    ReplyDelete
  52. It is really a great and useful piece of information. I am glad that you shared this helpful info with us. Please keep us up to date like this. Thank you for sharing.
    No:1
    VLSI Project Center in kanchipuram

    ReplyDelete
  53. This was a worthy blog. I enjoyed reading this blog and got an idea about it. Keep sharing more like this.
    No:1 Best Selenium Automation Training Center in kanchipuram|

    ReplyDelete
  54. this is really too useful and have more ideas from yours. keep sharing many
    techniques.

    No:1TCA training Center in Kanchipuram









    ReplyDelete
  55. After reading your blog, I was quite interested to learn more about this information. Thanks for sharing.
    No:1 Best PGDCA Training Center in kanchipuram|

    ReplyDelete
  56. Wow it is really wonderful and awesome thus it is very much useful for me to understand many information and helped me a lot. it is really explainable very well and i got more information from your blog.
    No:1 Best Tally Training Center in kanchipuram|

    ReplyDelete
  57. this is really too useful and have more ideas from yours. keep sharing many
    techniques.

    No:1 CCNA training Center in Kanchipuram









    ReplyDelete

  58. Nice post... Really you are done a wonderful job. Thanks for sharing such wonderful information with us. Please keep on updating...No:1 CCNA Exam Center In Chennai|

    ReplyDelete
  59. This is excellent information. It is amazing and wonderful to visit your site.Thanks for sharing this information, this is useful to me…
    No:1 Best Tally Training Center in kanchipuram|

    ReplyDelete

  60. Thanks for sharing these niche piece of coding to our knowledge. Here, I had a solution for my inconclusive problems & it’s really helps me a lot keep updates…No:1 CCNP Exam Center in Chennai|

    ReplyDelete
  61. The best thing is that your blog really informative thanks for your great information!No:1 ISTQB Exam Center in Chennai|

    ReplyDelete

  62. I am reading your post from the beginning, it was so interesting to read & I feel thanks to you for posting such a good blog, keep updates regularly. No: 1 ITIL Exam Center in Chennai|

    ReplyDelete
  63. I am reading your post from the beginning, it was so interesting to read & I feel thanks to you for posting such a good blog, keep updates regularly.No: 1 PMP Exam Center in Chennai|

    ReplyDelete
  64. It is really a great and useful piece of information. I am glad that you shared this helpful info with us. Please keep us up to date like this. Thank you for sharing.
    IT Project Center in Chennai

    ReplyDelete
  65. It is really a great and useful piece of information. I am glad that you shared this helpful info with us. Please keep us up to date like this. Thank you for sharing.
    IT Project Center in Chennai

    ReplyDelete

  66. Good one, it is very useful for me to learn and understand, thanks for sharing your information and ideas.. keep rocks..No: 1 AWS Exam Center in Chennai|

    ReplyDelete
  67. It is really a great and useful piece of information. I am glad that you shared this helpful info with us. Please keep us up to date like this. Thank you for sharing.
    IT Project Center in Chennai

    ReplyDelete
  68. I am really happy with your blog because your blog is very unique and powerful for new reader.No: 1 Microsoft Exam Center in Chennai|

    ReplyDelete
  69. I have completely read your post and the content is crisp and clear.Thank you for posting such an informative article, I have decided to follow your blog so that I can myself updated.
    Robotics Project Center in Chennai

    ReplyDelete

  70. I am reading your post from the beginning, it was so interesting to read & I feel thanks to you for posting such a good blog, keep updates regularly. 
No: 1 AZURE Exam Center in Chennai|

    ReplyDelete
  71. It is really a great and useful piece of information. I am glad that you shared this helpful info

    with us. Please keep us up to date like this. Thank you for sharing.
    ISTQB

    Exam Center in Chennai

    ReplyDelete
  72. This information is impressive..I am inspired with your

    post writing style & how continuously you describe this

    topic. After reading your post, thanks for taking the time

    to discuss this, I feel happy about it and I love learning

    more about this topic
    AWS Certification in

    Chennai

    ReplyDelete
  73. This information is impressive..I am inspired with your post writing style & how continuously you describe this topic. After reading your post, thanks for taking the time to discuss this, I feel happy about it and I love learning more about this topic
    AWS Certification in Chennai

    ReplyDelete
  74. Thanks for posting this useful content, Good to know about new things here, Keep updating your blog...No: 1 Blue Prium Certification in Chennai|

    ReplyDelete
  75. Thanks for posting this useful content, Good to know about new things here, Keep updating your blog...No: 1 Blue Prium Certification in Chennai|

    ReplyDelete
  76. This information is impressive..I am inspired with your post writing style & how continuously you describe this topic. After reading your post, thanks for taking the time to discuss this, I feel happy about it and I love learning more about this topic
    AWS Certification in Chennai

    ReplyDelete
  77. Hi, am a big follower of your blog. The best thing is that your blog really informative thanks for your great information!No: 1 NS 2 Project Center in Chennai|

    ReplyDelete
  78. Its really an Excellent post. I just stumbled upon your blog and wanted to say that I

    have really enjoyed reading your blog. Thanks for sharing.
    No:1PHP Project Center in chennai










    ReplyDelete
  79. This information is impressive..I am inspired with your post writing style & how continuously you describe this topic. After reading your post, thanks for taking the time to discuss this, I feel happy about it and I love learning more about this topic
    AWS Certification in Chennai

    ReplyDelete
  80. Nice blog. Thank you for sharing. The information you shared is very effective for learners I have got some important suggestions from it.No: 1 JAVA Application Center in Chennai|

    ReplyDelete
  81. Great and useful article.Thanks for taking time to share this post
    Android Project Center in Chennai

    ReplyDelete
  82. These provided information was really so nice,thanks for giving that post and the more skills to develop after refer that post. Your bolg really impressed for me,because of all information so nice.No: 1 NS 2 Project Center in Chennai|

    ReplyDelete
  83. Great and useful article.Thanks for taking time to share this post
    Android Project Center in Chennai

    ReplyDelete
  84. I found a lot of interesting information here. A really good post. keep updating.No: 1 MBA Project Center in Chennai|

    ReplyDelete
  85. I have read your blog. Good and more

    informationuseful for me, Thanks for sharing this

    information keep it up....

    No.1 Python Project Center in Chennai







    ReplyDelete
  86. Quite Interesting post!!! Thanks for posting such a useful post. I wish to read your upcoming post to enhance my skill set, keep blogging.No: 1 BBA Project Center in Chennai|

    ReplyDelete
  87. I am very happy after find this post and really helpful. Thanks for sharing this Informative content. Well explained. Got to learn new things from your Blog. your site really helps me for searching the new and great stuff.
    ECE Project Center in Chennai

    ReplyDelete
  88. Excellent post!!!. The strategy you have posted on this technology helped me to get into the next level and had lot of information in it.
    Embedded Training Center in Kanchipuram

    ReplyDelete
  89. Excellent post!!!. The strategy you have posted on this technology helped me to get into the next level and had lot of information in it.
    Embedded Training Center in Kanchipuram

    ReplyDelete
  90. Excellent post!!!. The strategy you have posted on this technology helped me to get into the next level and had lot of information in it.
    Embedded Training Center in Kanchipuram

    ReplyDelete
  91. Nice Post! It is really interesting to read from the beginning & I would like to share your blog to my circles, keep your blog as updated.
    No.1 CCNA Training Center In Kanchipuram

    ReplyDelete
  92. I found a lot of interesting information here. A really good post. keep updating.
    MBA Project Center in Kanchipuram

    ReplyDelete
  93. Great post. Wonderful information and really very much useful. Thanks for sharing and keep updating.No: 1 MBA Project Center in Chennai|

    ReplyDelete
  94. Very nice blog. It is very useful for me. I read your blog completely. I gather lot of information in this post. Thanks for sharing. No: 1 BBA Project Center in Chennai |

    ReplyDelete
  95. Wonderful post with great piece of information. I'm learning a lot from your blog. Keep sharing. No: 1 CCNA Training Center in Kanchipuram|

    ReplyDelete
  96. Thanks for giving great kind of information. Thanks for your excellent blog, nice work keep it up thanks for sharing the knowledge. No: 1 Graphic Designing Course in Kanchipuram|

    ReplyDelete
  97. This was a worthy blog. I enjoyed reading this blog and got an idea about it. Keep sharing more like this.
    JAVA Training Center in Kanchipuram

    ReplyDelete
  98. Nice Post! It is really interesting to read from the beginning & I would like to share your blog to my circles, keep your blog as updated.
    No.1 Android Training Institute In Kanchipuram








    ReplyDelete

Powered by Blogger.