VMware {code} Community
dmitrif
Enthusiast
Enthusiast

error (501) not implemented

Hi,

I'm trying to access the WBEM service of the CIMOM on the ESX Server 3i and all my requests end up with this error "(501) not implemented".

What is it?

I use wbemsharp (http://code.google.com/p/wbemtools/wiki/Intro) for my client and the connection is over HTTPS.

Thanks in advance

D.
0 Kudos
6 Replies
DannyUtro
Contributor
Contributor

Hello!

Did you resolved this problem? I get same exception when using wbem-sharp library.

0 Kudos
dmitrif
Enthusiast
Enthusiast

No, I did not

D.
0 Kudos
Anandraj
Contributor
Contributor

HI,

Did u solve the problem.. do u have any other alternative solutions...

Anand.

0 Kudos
Anandraj
Contributor
Contributor

HI,

I'm getting the same exception using wbem sharp, do u have any other alternative solutions...

0 Kudos
jgoddard68
Contributor
Contributor

For reasons unknown, wbem-sharp sets the method to "M-POST", change it to "POST" in src/Net/CimomRequest.cs and your 501 should go away.

0 Kudos
webwarrior
Contributor
Contributor

You are right, and there are a few other things that the old code is referencing which is a bad idea.

I got it to work via http, by changing the httponly setting in the confic file of the cim service on the esx server.

I took out all the name sapces it added in front of stuff using a random number (who knows why they did that? Avoid caching?)

Some headers look like this:

                cimReq.Headers.Add("Content-Language", "en-US");
                cimReq.Headers.Add("Authorization", "Basic cm9vdDpQYXNzd29yZDE="); // Got this by sniffing packets from CIM Navigator, which worked.

               // this code above stopped the unauthorised error.....

                cimReq.Headers.Add("Accept-Language", "en-US");
                cimReq.Headers.Add("Cache-Control", "no-cache");

Some defaults needed turning off in .Net as well, to stop the Expectancy error in Cimomrequests.cs or something:

// Setup the http request
            httpReq.PreAuthenticate = false;
            //httpReq.Connection = "Keep-alive";
            httpReq.ProtocolVersion = HttpVersion.Version11;
            httpReq.Method = "POST";
            httpReq.ContentType = "application/xml;charset=\"UTF-8\"";
            httpReq.Accept = "text/html, text/xml, application/xml";
            ServicePointManager.Expect100Continue = false;
            //httpReq.Expect = "false";
            // I get an "Unknown Extension URI" when I try to use this URL Smiley Sad
            //Headers.Add("Man", "http://www.dmtf.org/standards/documents/WBEM/DSP200.html;ns=" + nameSpaceValue);
            // Add the Http/CIM headers
            //Headers.Add("Man", "http://www.dmtf.org/cim/mapping/http/v1.0;ns=" + nameSpaceValue);
            Headers.Add("CIMProtocolVersion", "1.0");

Got a CIM_Fan object back by adding this bit of code right before the other code of the AuthForm.cs

CimClass Class1 = mainWbemClient.GetClass("CIM_Fan");

This calss is populated with 75K of xml data being returned successfully.

The next piece of code will bomb out, as there are allot of new implementations of the latest schema not implemented yet:

classList = mainWbemClient.EnumerateClassHierarchy();

That piece of code reference some classes that needs allot of rework, which is the bit I am about to start on.

Shaun O'Reilly

0 Kudos