cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1068
Views
0
Helpful
1
Replies

CUCM AXL updatePhone CUCM 11.5

John F
Level 1
Level 1

I can read the information I would like but cannot seem to update it.

Here I read successfully.

 

$MyCreds = Import-Clixml -LiteralPath $credfile
$request = @"
    <?xml version="1.0" encoding="UTF-8"?>
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"    xmlns:ns="http://www.cisco.com/AXL/API/11.5">
    <soapenv:Header/>
    <soapenv:Body>
      <ns:getPhone sequence="?">
      <name>SEP40CE243F3258</name>
    </ns:getPhone>
  </soapenv:Body>
</soapenv:Envelope>
"@

$result = Invoke-RestMethod -Method Post -Uri "https://$CUCM`:8443/axl/" -Headers @{'Content-Type'='text/xml';'SOAPAction'='CUCM:DB ver 11.5'} -Body $request -Credential $MyCreds

# Output result
$r = $result.Envelope.Body.getPhoneResponse.return.phone 
$adminuser = $r.SelectSingleNode("//adminUserId")."#text"
$adminpwd = $r.SelectSingleNode("//adminPassword")."#text"
Write-Host $adminuser / $adminpwd

*************************************

and it returns the adminuser/pwd successfully. 

This is the update script.

$MyCreds = Import-Clixml -LiteralPath $credfile
$request = @"
<?xml version="1.0" encoding="UTF-8"?>
  <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"  xmlns:ns="http://www.cisco.com/AXL/API/11.5">
  <soapenv:Header/>
  <soapenv:Body>
    <ns:updatePhone>
      <uuid>{936E5CEC-BE41-8657-900D-36DE91F80E45}</uuid>
      <adminUserId>serviceadmin2</adminUserId>
    </ns:updatePhone>
  </soapenv:Body>
  </soapenv:Envelope>
"@


$result = Invoke-RestMethod -Method Post -Uri "https://$CUCM`:8443/axl/" -Headers @{'Content-Type'='text/xml';'SOAPAction'='CUCM:DB ver 11.5'} -Body $request -Credential $MyCreds

# Output result
$result.Envelope.Body.updatePhoneResponse.return 

 

And I receive a 400.

Thank you

1 Accepted Solution

Accepted Solutions

John F
Level 1
Level 1

It is resolved.  I needed a few more elements embedded.

  <soapenv:Header/>
  <soapenv:Body>
    <ns:updatePhone>
      <uuid>{936E5CEC-BE41-8657-900D-36DE91F80E45}</uuid>
      <vendorConfig>
          <AdminLoginDetails>
             <adminUserId>serviceadmin2</adminUserId>
         </AdminLoginDetails>
       </vendorConfig>

    </ns:updatePhone>
  </soapenv:Body>
  </soapenv:Envelope>

View solution in original post

1 Reply 1

John F
Level 1
Level 1

It is resolved.  I needed a few more elements embedded.

  <soapenv:Header/>
  <soapenv:Body>
    <ns:updatePhone>
      <uuid>{936E5CEC-BE41-8657-900D-36DE91F80E45}</uuid>
      <vendorConfig>
          <AdminLoginDetails>
             <adminUserId>serviceadmin2</adminUserId>
         </AdminLoginDetails>
       </vendorConfig>

    </ns:updatePhone>
  </soapenv:Body>
  </soapenv:Envelope>