kacole2
12 years agoNew Contributor
Uber Complex SOAP connection to VMware Site Recovery Manager
Hi everyone,
Over the past few days, I've struggled to try and get SoapUI to connect to my VMware SRM instance. I hate asking for handouts, but i'm realizing this is no easy task and maybe i'm in over my head.
I've reviewed the documentation and it's very little help because there are only C# and Java example snippets - http://www.vmware.com/support/developer ... 50_api.pdf
I was given a Powershell script from a colleague of mine that successfully connects to my VMware Site Recovery Manager instance. Essentially, I need to take this Powershell script and figure out how I can take the pieces and create a successful connection to my VMware Site Recovery Manager. It also grabs all the protection groups and lists them.
I can successfully import the WSDL file (https://srm-vcenter-a:8095/srm-Service?wsdl) and all the request types get populated. To do anything a successful login must be authenticated using SrmLoginLocale. However, there is one specific object that I don't understand and that is the "ManagedObjectReference". The ManagedObjectReference is necessary on almost every single operation and I'm not sure where or how to populate that information. Every time i run a SoapUI request, I get a 500 Internal Server Error.
http://kendrickcoleman.com/free/SRMsoapui.png
In an effort to assist with troubleshooting, I have opened up my VMware SRM instance to the web and opened ports 8095 and 9007. This is a home lab environment, so there's no security or confidential information to expose.
From the documentation:
8095 SOAP vCenter Server and vSphere Client SRM From the vCenter Server proxy to the SRM Server (intrasite only).
9007 TCP SRM External API Client SRM Used by external API clients for task automation.
you can access the wsdls here:
https://srmtrial.no-ip.org:8095/srm-Service?wsdl
https://srmtrial.no-ip.org:8095/srm?wsdl
I created an account for a SRM administrator. you should be able to use the following credentials. username "srmtrial" and password "srmtrial". if you need FQDN, the domain is "KENDRICKCOLEMAN".
Thanks for any and all help
Over the past few days, I've struggled to try and get SoapUI to connect to my VMware SRM instance. I hate asking for handouts, but i'm realizing this is no easy task and maybe i'm in over my head.
I've reviewed the documentation and it's very little help because there are only C# and Java example snippets - http://www.vmware.com/support/developer ... 50_api.pdf
I was given a Powershell script from a colleague of mine that successfully connects to my VMware Site Recovery Manager instance. Essentially, I need to take this Powershell script and figure out how I can take the pieces and create a successful connection to my VMware Site Recovery Manager. It also grabs all the protection groups and lists them.
$Server = "srm-vcenter-a"
$UserName = "administrator"
$Password = "mypw"
[System.Net.ServicePointManager]::ServerCertificateValidationCallback = {$true}
Write-Host "Connecting to SRM"
$webSvc = New-WebServiceProxy ("https://" + $Server + ":8095/srm-Service?wsdl") -Namespace SRM
$srm = New-Object SRM.SrmService
$srm.Url = "Https://" + $Server + ":9007"
$srm.Timeout = 600000
$srm.CookieContainer = New-Object System.Net.CookieContainer
$srmSvcRef = New-Object SRM.ManagedObjectReference
$srmSvcRef.Type = "SrmServiceInstance"
$srmSvcRef.Value = $srmSvcRef.Type
$srmSvcContent = $srm.RetrieveContent($srmSvcRef)
$srm.SrmLoginLocale($srmSvcRef, $UserName, $Password, $null)
$srmObject = New-Object System.Object
$srmObject | Add-Member -Type NoteProperty -value $Server -Name SRMServer
$srmObject | Add-Member -Type NoteProperty -value $srm -Name SRMService
$srmObject | Add-Member -Type NoteProperty -value $srmSvcContent -Name SRMContent
$protectionGroupList = @();
#Get Information about the ProtectionGroups and combine them
ForEach ($protectionGroup in $SrmObject.SRMService.ListProtectionGroups($SrmObject.SRMContent.Protection)) {
Write-Host "Fetching ProtectionGroupInfo"
$protectionGroupInfo = $SrmObject.SRMService.GetInfo($protectionGroup)
Write-Host "Fetching VMs for ProtectionGroup"
$protectedVms = $SrmObject.SRMService.listProtectedVms($protectionGroup)
$customProtectionGroupInfo = New-Object System.Object
$customProtectionGroupInfo | Add-Member -Name ProtectionGroupMoRef -Value $protectionGroup -MemberType NoteProperty -PassThru
$customProtectionGroupInfo | Add-Member -Name ProtectionGroupInfo -Value $protectionGroupInfo -MemberType NoteProperty -PassThru
$customProtectionGroupInfo | Add-Member -Name ProtectedVms -Value $protectedVms -MemberType NoteProperty -PassThru
$protectionGroupList += $customProtectionGroupInfo
}
Write-Host "=== Results ==="
Write-Host "-----"
ForEach ($pg in $protectionGroupList) {
Write-Host "ProtectionGroup Name: " $pg.protectionGroupInfo.name
Write-Host "Description De: " $pg.protectionGroupInfo.description
Write-Host "Replication Type: " $pg.protectionGroupInfo.type
ForEach ($vm in $pg.protectedVms) {
Write-Host " VM MoId: " $vm.vm.value
Write-Host " Protection State: " $vm.state
Write-Host " Peer State: " $vm.peerState
Write-Host " needs configuration: " $vm.needsConfiguration
Write-Host " ----"
}
Write-Host "---"
}
$srm.SrmLogoutLocale($srmSvcRef);
I can successfully import the WSDL file (https://srm-vcenter-a:8095/srm-Service?wsdl) and all the request types get populated. To do anything a successful login must be authenticated using SrmLoginLocale. However, there is one specific object that I don't understand and that is the "ManagedObjectReference". The ManagedObjectReference is necessary on almost every single operation and I'm not sure where or how to populate that information. Every time i run a SoapUI request, I get a 500 Internal Server Error.
http://kendrickcoleman.com/free/SRMsoapui.png
In an effort to assist with troubleshooting, I have opened up my VMware SRM instance to the web and opened ports 8095 and 9007. This is a home lab environment, so there's no security or confidential information to expose.
From the documentation:
8095 SOAP vCenter Server and vSphere Client SRM From the vCenter Server proxy to the SRM Server (intrasite only).
9007 TCP SRM External API Client SRM Used by external API clients for task automation.
you can access the wsdls here:
https://srmtrial.no-ip.org:8095/srm-Service?wsdl
https://srmtrial.no-ip.org:8095/srm?wsdl
I created an account for a SRM administrator. you should be able to use the following credentials. username "srmtrial" and password "srmtrial". if you need FQDN, the domain is "KENDRICKCOLEMAN".
Thanks for any and all help