Vmware vSphere Management SDK, vmwarevsphere

Source: Internet
Author: User

Vmware vSphere Management SDK, vmwarevsphere

Address: http://www.cnblogs.com/yuefei/p/3600441.html

The original text is quite well written. I have added some details here. To help a little white like me, clearly according to instructions, but still wrong

 

Preparation:

VSphere Management SDK

Microsoft Visual maxcompute 2008

Web Services Enhancements (WSE) 3.0 for Microsoft. NET

. Net framework v2.0 sdk

MicrosoftSqlServerSString

Note:

. Net framework v2.0 sdk is not. net framework v2.0
. Net framework v2.0 sdk to install its own version, such as 64-bit system, install 32. net framework v2.0 sdk is useless to install Web Services Enhancements (WSE) 3.0 for Microsoft. NET select m

 

 

Management SDK description:

VSphere Management SDK provides sample code for. net and java related functions such as vmware Management.

In its 5.5 decompression package

Eam: esx agent management indicates the proxy of the esx VM production environment.

Sms: storage monitoring management storage monitoring

Spbm: storage policy based management storage policy

Ssoclient: client Single Sign-On verification

Vsphere-ws: web service api

 

Some dll files are missing when you open the sample solution.

Microsoft. Web. Services3.dll is a dll file in Microsoft wse3.0 and can be used to produce secure web Services.

Install Web Services Enhancements (WSE) 3.0 for Microsoft. NET and the exclamation point disappears.

 

Solution:

Vim25Service. dll

Vim25Service. XmlSerializers. dll

Of course, the vSphere Management SDK also provides web-based service interfaces. In the .. SDK \ vsphere-ws \ wsdl \ vim25 directory, you can use the wse tool to generate dll files.

For the wse tool installation and configuration, install the runtime, toolkit, and vs tools.

 

Here are two compilation methods: wsewsdl3.exe in the tooltool and vs extension tool.

After the installation is complete, open the dos window of vs and perform the following steps in sequence.

Generate Vim25Service. dll and Vim25Service. XmlSerializers. dll

1. Generate the cs file.

wsdl.exe /n:Vim25Api /o:d:\sdk\dll\VimService.cs d:\sdk\dll\vimService.wsdl d:\sdk\dll\vim.wsdl

2. Compile the cs file (generate Vim25Service. dll ).

csc /t:library /out:d:\sdk\dll\Vim25Service.dll d:\sdk\dll\VimService.cs

3. Generate the serialization file (Vim25Service. XmlSerializers. dll ). This process takes a long time.

sgen /p d:\sdk\dll\Vim25Service.dll

4. It's not over yet.

Open the file VimService. cs compiled by wsdl:

 

 
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.0.30319.1")][System.Diagnostics.DebuggerStepThroughAttribute()][System.ComponentModel.DesignerCategoryAttribute("code")][System.Web.Services.WebServiceBindingAttribute(Name="VimBinding", Namespace="urn:vim25")][System.Xml.Serialization.XmlIncludeAttribute(typeof(ReadEnvironmentVariableInGuestRequestType))][System.Xml.Serialization.XmlIncludeAttribute(typeof(TerminateProcessInGuestRequestType))]
......
public partial class VimService : System.Web.Services.Protocols.SoapHttpClientProtocol{
 

So we comment out all [System. Xml. Serialization. XmlIncludeAttribute (typeof ...,

In this step, you can use all the replacement functions of vs. There are about 6478 items. You must use a tool.

Then we

public partial class VimService : System.Web.Services.Protocols.SoapHttpClientProtocol

 

Add a line as follows

[System. Xml. Serialization. XmlSerializerAssembly (AssemblyName = "VimService25.XmlSerializers")].

 

 

Generate STSService. dll

1. cd to wse tool.

cd C:\Program Files (x86)\Microsoft WSE\v3.0\Tools

2. Generate the cs file. Add all the wsdl files at the end.

WseWsdl3.exe /o:c:\STSService.cs /type:webClient c:\test\STSService.wsdl c:\test\profiled-saml-schema-assertion-2.0.xsd c:\test\profiled-saml-schema-assertion-2.0-extensions.xsd c:\test\profiled-saml-schema-assertion-2.0-types.xsd c:\test\profiled-sstc-saml-delegation.xsd c:\test\profiled-wsse-header.xsd c:\test\profiled-wss-wssecurity-utility-1.0.xsd c:\test\profiled-ws-trust.xsd c:\test\ws-addr.xsd c:\test\ws-trust-1.4-extensions.xsd c:\test\xmldsig-core-schema.xsd

3. Compile the cs file. Microsoft. Web. Services3.dll must be referenced here.

csc /t:library /out:c:\STSService.dll c:\STSService.cs /reference:"C:\Program Files (x86)\Microsoft WSE\v3.0\Microsoft.Web.Services3.dll"

 

Warnings may occur during STSService. dll compilation. This means that you need to install the. net framework v2.0 sdk. Note that it is not. net framework 2.0.

 

After the installation is complete, rereference the production dll file. At this time, pay attention to the use of the project in the sample. net framework 3.5, depending on the version of the dll you compile. You can change the project version or use the corresponding compiling environment.

In addition, there are two client logon methods in the sample. One is called obsolete. In fact, the VMA proxy instance and the other is SSO.

However, SSO does not provide the sso interface in the api provided by the wsdl of the sample. The partial classification method is missing. So comment out the sso verification code.

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.