
UNSOLVED
Celerra XMLAPI - Posting XML Requests
I was given a bunch of new storage by our IT people to replace some fairly old storage equipment and I have run into a problem when trying to convert some code to handle our new EMC Celerra storage. The issue fairly lies in trying to implement (using .NET) the XMLAPI provided by EMC to automate the creation of Celerra "File Systems" and an associated "CIFS Share" on an ad-hoc / demand basis. We have an isolated network (no Internet access) for our EMC equipment and the application does a number of tasks. Those with sad faces are where everything is falling down.
(1) Create AD Security Group -
(2) Add AD Users to Security Group -
(3) Create File System on EMC using the XMLAPI -
(4) Create CIFS Share on EMC using the XMLAPI -
(5) Set CIFS Share permissions to remove Everyone and add the newly created AD Security group using ?? -
(6) Create a folder structure on the newly created EMC File System -
(7) Permission NTFS permissions on EMC File System just created using the AD Security group -
(8) Create a DFS target folder to the CIFS share and add it to the DFS Namespace -
I have been able to submit a login request and receive an OK response with a valid cookie; however I am unable to "post" an XML request using the same process (the initial request I am sending is just a confirmation of whether the API URL works); I have formulated proper XML Requests for creating File Systems using the XML API user guide (however these can't be posted in the same manner as below)
I converted some code I found "CelerraAPIVBScriptExample.vbs" to VB.NET as I have to reference this function from my C# .NET application and it is below (anything in <> is organisation specific so I have removed it for the purposes of this post)
...
Const EMC_API_URL as String = "https:// /servlets/CelerraManagementServices "
Const EMC_LOGIN_URL as String = "http:// /Login?user= &password= &Login=Login "
...
Try
Dim strNoOp as String = " http://www.emc.com/schemas/celerra/xml_api ""/>"
Dim httpRequest as Object = CreateObject("Msxml2.ServerXMLHTTP.4.0")
Dim strResponse, strResponseHeaders as String
' Login to EMC Celerra
httpRequest.setOption(2, 13056) 'Ignores all TLS/SSL server certificate errors
httpRequest.Open("POST", EMC_LOGIN_URL, false)
httpRequest.setRequestHeader("Content-Type","application/x-www-form-urlencoded")
httpRequest.Send()
strResponse = httpRequest.responseText
strResponseHeaders = httpRequest.getAllResponseHeaders
...
'Post NoOp request
httpRequest.Open("POST", EMC_API_URL, false)
httpRequest.setRequestHeader("Content-Type", "text/xml")
httpRequest.Send(strNoOp) <------ FAILS here with Exception or invalid parameters
strResponse = httpRequest.responseText
...
Catch ex as Exception
Dim response = MsgBox(ex.Message. MsgBoxStyle.OKOnly, "Error")
End Try
Responses (0)
Solutions (0)
