rest - Management API - Create VM - InvalidXmlRequest - The request body XML was invalid or not correctly specified -


i getting error while creating virtual machine azure rest management api. please point me wrong posting in below xml

error --- <error xmlns="http://schemas.microsoft.com/windowsazure" xmlns:i="http://www.w3.org/2001/xmlschema-instance"><code>invalidxmlrequest</code><message>the request body's xml invalid or not correctly specified.</message></error>

my post string:

"  <deployment xmlns=\"http://schemas.microsoft.com/windowsazure\" xmlns:i=\"http://www.w3.org/2001/xmlschema-instance\">" +  "    <name>somename</name>" +  "    <deploymentslot>production</deploymentslot>" +  "    <label>somelabel</label>" +  "    <rolelist>" +  "      <role>" +  "        <rolename>somerolename</rolename>" +  "        <roletype>persistentvmrole</roletype>" +  "        <configurationsets>" +  "          <configurationset i:type=\"windowsprovisioningconfigurationset\">" +  "            <configurationsettype>windowsprovisioningconfiguration</configurationsettype>" +  "            <computername>somecompname</computername>" +  "            <adminpassword>admin098</adminpassword>" +  "            <enableautomaticupdates>true</enableautomaticupdates>" +  "            <resetpasswordonfirstlogon>false</resetpasswordonfirstlogon>" +  "          </configurationset>" +  "          <configurationset i:type=\"networkconfigurationset\">" +  "            <configurationsettype>networkconfiguration</configurationsettype>" +  "            <inputendpoints>" +  "              <inputendpoint>" +  "                <localport>3389</localport>" +  "                <name>remotedesktop</name>" +  "                <protocol>tcp</protocol>" +  "              </inputendpoint>" +  "            </inputendpoints>" +  "          </configurationset>" +  "        </configurationsets>" +  "        <osvirtualharddisk>" +  "          <diskname>somediskname-0-20121007173943</diskname>" +  "          <medialink>http://portalvhdsrx7q659n2n5j2.blob.core.windows.net/public/myvhd0008980.vhd</medialink>" +  "          <sourceimagename>msft__win2k8r2sp1-datacenter-201208.01-en.us-30gb.vhd</sourceimagename>" +  "        </osvirtualharddisk>" +  "        <rolesize>small</rolesize>" +  "      </role>" +  "    </rolelist>" +  "  </deployment>" 

hi, added adminusername also. still getting error. datetime of request - 04-11 17:30:03.759

<error xmlns="http://schemas.microsoft.com/windowsazure" xmlns:i="http://www.w3.org/2001/xmlschema-instance"><code>invalidxmlrequest</code><message>the request body's xml invalid or not correctly specified.</message></error> 

post string

<deployment xmlns="http://schemas.microsoft.com/windowsazure" xmlns:i="http://www.w3.org/2001/xmlschema-instance">    <name>somename</name>    <deploymentslot>production</deploymentslot>    <label>somelabel</label>    <rolelist>      <role>        <rolename>somerolename</rolename>        <roletype>persistentvmrole</roletype>        <configurationsets>          <configurationset i:type="windowsprovisioningconfigurationset">            <configurationsettype>windowsprovisioningconfiguration</configurationsettype>            <computername>somecompname</computername>            <adminpassword>admin098</adminpassword>            <adminusername>awesomeadmin</adminusername>            <enableautomaticupdates>true</enableautomaticupdates>            <resetpasswordonfirstlogon>false</resetpasswordonfirstlogon>          </configurationset>          <configurationset i:type="networkconfigurationset">            <configurationsettype>networkconfiguration</configurationsettype>            <inputendpoints>              <inputendpoint>                <localport>3389</localport>                <name>remotedesktop</name>                <protocol>tcp</protocol>              </inputendpoint>            </inputendpoints>          </configurationset>        </configurationsets>        <osvirtualharddisk>          <diskname>somediskname-0-20121007173943</diskname>          <medialink>http://portalvhdsrx7q659n2n5j2.blob.core.windows.net/public/myvhd0008980.vhd</medialink>          <sourceimagename>msft__win2k8r2sp1-datacenter-201208.01-en.us-30gb.vhd</sourceimagename>        </osvirtualharddisk>        <rolesize>small</rolesize>      </role>    </rolelist>  </deployment> 

try adding adminusername node after adminpassword node.

"  <deployment xmlns=\"http://schemas.microsoft.com/windowsazure\" xmlns:i=\"http://www.w3.org/2001/xmlschema-instance\">" +  "    <name>somename</name>" +  "    <deploymentslot>production</deploymentslot>" +  "    <label>somelabel</label>" +  "    <rolelist>" +  "      <role>" +  "        <rolename>somerolename</rolename>" +  "        <roletype>persistentvmrole</roletype>" +  "        <configurationsets>" +  "          <configurationset i:type=\"windowsprovisioningconfigurationset\">" +  "            <configurationsettype>windowsprovisioningconfiguration</configurationsettype>" +  "            <computername>somecompname</computername>" +  "            <adminpassword>admin098</adminpassword>" +  "            <adminusername>awesomeadmin</adminusername>" +  "            <enableautomaticupdates>true</enableautomaticupdates>" +  "            <resetpasswordonfirstlogon>false</resetpasswordonfirstlogon>" +  "          </configurationset>" +  "          <configurationset i:type=\"networkconfigurationset\">" +  "            <configurationsettype>networkconfiguration</configurationsettype>" +  "            <inputendpoints>" +  "              <inputendpoint>" +  "                <localport>3389</localport>" +  "                <name>remotedesktop</name>" +  "                <protocol>tcp</protocol>" +  "              </inputendpoint>" +  "            </inputendpoints>" +  "          </configurationset>" +  "        </configurationsets>" +  "        <osvirtualharddisk>" +  "          <diskname>somediskname-0-20121007173943</diskname>" +  "          <medialink>http://portalvhdsrx7q659n2n5j2.blob.core.windows.net/public/myvhd0008980.vhd</medialink>" +  "          <sourceimagename>msft__win2k8r2sp1-datacenter-201208.01-en.us-30gb.vhd</sourceimagename>" +  "        </osvirtualharddisk>" +  "        <rolesize>small</rolesize>" +  "      </role>" +  "    </rolelist>" +  "  </deployment>" 

Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -