UpdatePhoneReq > error generating the XML document > mandatory fields?

Version 1
    This document was generated from CDN thread

    Created by: Salim Guerid on 21-09-2013 11:42:30 PM
    Hi all,
    I am strugling with an update of phone. 

     1UpdatePhoneReq reqPhone = newUpdatePhoneReq();
     2reqPhone.ItemElementName = ItemChoiceType32.name;               
     3reqPhone.Item = currentIPPhone.name;               
     4reqPhone.description = "my description";
     5reqPhone.devicePoolName = newXFkType() { Value = ipPhonedevicePool};
     6reqPhone.commonDeviceConfigName = newXFkType() { Value = currentIPPhone.site + "-Device Config" };
     7reqPhone.enableExtensionMobility = "True";
     8reqPhone.phoneTemplateName = newXFkType() { Value = "Standard CIPC SCCP" };
     9reqPhone.securityProfileName = newXFkType() { Value = "Cisco IP Communicator - Standard SCCP Non-Secure Profile" };
    10reqPhone.locationName = newXFkType() { Value =  currentIPPhone.site };
    11reqPhone.callingSearchSpaceName = newXFkType() { Value = "Internal-" +  currentIPPhone.site };
    12
    13// -- Are those fields needed? They come from the example
    14reqPhone.lines = newUpdatePhoneReqLines();
    15reqPhone.lines.Items = newXPhoneLine[1];
    16XPhoneLine line = newXPhoneLine() { index = "1", dirn = newXDirn() { pattern = currentIPPhone.dirNumber, routePartitionName = newXFkType() { Value = currentIPPhone.dirNumberPartition } } };
    17reqPhone.lines.Items.SetValue(line, 0);

    The request works and updat the phone with or without the // -- block but the following error is thrown:


    1There was an error generating the XML document.

    More generally is there a way to check which fields are actually mendatory? Reading the definition here http://developer.cisco.com/axl/Files/AXLSoap_UpdatePhoneReq.html#LinkD26 I can not see any minOccurs="1" which were not addressed by my request.

    Your help would be highly appreciated!
    Thanks

    Subject: RE: UpdatePhoneReq > error generating the XML document > mandatory fields?
    Replied by: David Staudt on 23-09-2013 01:42:54 PM
    Specifying the additional fields (e.g. 'foreign key' values) is necessary in order for AXL to keep from updating the values of those fields with null/empty - i.e. erasing their current value.  This is due to a quirk with how .NET compiles the AXL WSDL, and how AXL expects fields to be specified as 'leave as-is' - basically .NET always provides a value - e.g. <securityProfileName/> - and there is no default way to have .NET simply omit the element from the XML request (which is what AXL expects for 'leave as-is' fields.)
    It is possible to manually modify the .NET generated AXL .cs file, so as to add the ability to specify whether an element should be ommitted/present - see here:
    http://msdn.microsoft.com/en-us/library/bb402199.aspx
    Below is a web reference .cs snippet (based on 7.1(3)), which I modified as a test awhile back, modifying just updatePhone reqeuest.  The bold lines were added, I think based on whether the value was XFKType:
      1        public UpdatePhoneReq() {
      2            this.networkLocationField = "Use System Default";
      3            this.mlppIndicationStatusField = "Off";
      4            this.preemptionField = "Default";
      5            this.useTrustedRelayPointField = "Default";
      6            this.retryVideoCallAsAudioField = "true";
      7            this.useDevicePoolCgpnTransformCssField = "true";
      8            this.ringSettingIdleBlfAudibleAlertField = "Default";
      9            this.ringSettingBusyBlfAudibleAlertField = "Default";
     10            this.singleButtonBargeField = "Default";
     11            this.joinAcrossLinesField = "Default";
     12            this.builtInBridgeStatusField = "Default";
     13            this.callInfoPrivacyStatusField = "Default";
     14            this.ignorePresentationIndicatorsField = "false";
     15            this.packetCaptureModeField = "None";
     16            this.packetCaptureDurationField = "0";
     17            this.unattendedPortField = "false";
     18            this.requireDtmfReceptionField = "false";
     19            this.rfc2833DisabledField = "false";
     20            this.certificateOperationField = "No Pending Operation";
     21            this.authenticationModeField = "By Null String";
     22            this.keySizeField = "1024";
     23            this.deviceMobilityModeField = "Default";
     24            this.remoteDeviceField = "false";
     25            this.dndOptionField = "Ringer Off";
     26            this.isActiveField = "true";
     27            this.phoneSuiteField = "Default";
     28            this.phoneServiceDisplayField = "Default";
     29            this.isProtectedField = "false";
     30            this.mtpPreferedCodecField = "711ulaw";
     31            this.outboundCallRolloverField = "No Rollover";
     32            this.hotlineDeviceField = "false";
     33            this.alwaysUsePrimeLineField = "Default";
     34            this.alwaysUsePrimeLineForVoiceMessageField = "Default";
     35            this.deviceTrustModeField = "Not Trusted";
     36        }
     37        /// <remarks/>
     38        [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
     39        public string newName {
     40            get {
     41                return this.newNameField;
     42            }
     43            set {
     44                this.newNameField = value;
     45            }
     46        }
     47        /// <remarks/>
     48        [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
     49        public string description {
     50            get {
     51                return this.descriptionField;
     52            }
     53            set {
     54                this.descriptionField = value;
     55            }
     56        }
     57        /// <remarks/>
     58        [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified, IsNullable=true)]
     59        public XFkType callingSearchSpaceName {
     60            get {
     61                return this.callingSearchSpaceNameField;
     62            }
     63            set {
     64                this.callingSearchSpaceNameField = value;
     65            }
     66        }
     67[b]        public bool callingSearchSpaceNameSpecified;
     68        public bool commonDeviceConfigNameSpecified;
     69        public bool mediaResourceListNameSpecified;
     70        public bool networkHoldMohAudioSourceIdSpecified;
     71        public bool userHoldMohAudioSourceIdSpecified;
     72        public bool automatedAlternateRoutingCssNameSpecified;
     73        public bool aarNeighborhoodNameSpecified;
     74        public bool loadInformationSpecified;
     75        public bool versionStampSpecified;
     76        public bool mlppDomainIdSpecified;
     77        public bool sipProfileNameSpecified;
     78        public bool cgpnTransformationCssNameSpecified;
     79        public bool geoLocationNameSpecified;
     80        public bool geoLocationFilterNameSpecified;
     81        public bool primaryPhoneNameSpecified;
     82        public bool userlocaleSpecified;
     83        public bool networkLocaleSpecified;
     84        public bool idleTimeoutSpecified;
     85        public bool softkeyTemplateNameSpecified;
     86        public bool defaultProfileNameSpecified;
     87        public bool ownerUserNameSpecified;
     88        public bool subscribeCallingSearchSpaceNameSpecified;
     89        public bool rerouteCallingSearchSpaceNameSpecified;
     90        public bool dndRingSettingSpecified;
     91        public bool mobilityUserIdNameSpecified;
     92        public bool mobileSmartClientProfileNameSpecified;
     93        public bool dialRulesNameSpecified;
     94        public bool featureControlPolicySpecified;[/b]
     95        /// <remarks/>
     96        [System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]
     97        public XFkType devicePoolName {
     98            get {
     99                return this.devicePoolNameField;
    100            }
    101            set {
    102                this.devicePoolNameField = value;
    103            }
    104        }
    105...
    This allows you to indicate whether the element should be present in the XML request (xxxSpecified=true) or ommitted (xxxSpecified=false).  If xxxSecified=false then any actual value of the field will be ignored (the element will still be ommitted  Note, I believe the default value for the xxxSpecified fields is 'false', so its optional to actually include the lines as below, if you wish them to be ommitted - i.e. retain their existing/current value.  You should only need to add xxxSpecified=true, if you wish to specify a new/updated value for a field.
     1using System;
     2using System.Collections.Generic;
     3using System.Linq;
     4using System.Text;
     5using System.Net;
     6using System.Security;
     7using System.Security.Cryptography.X509Certificates;
     8using ConsoleApplication1.WebReference;
     9
    10namespace ConsoleApplication1
    11{
    12    class Program
    13    {
    14        static void Main(string[] args)
    15        {
    16            ServicePointManager.Expect100Continue = false;
    17            ServicePointManager.ServerCertificateValidationCallback = ((sender, certificate, chain, sslPolicyErrors) => true);
    18            
    19            AXLAPIService axl = new AXLAPIService();
    20            axl.Credentials = new NetworkCredential("Administrator", "cisco!123");
    21            axl.SoapVersion = System.Web.Services.Protocols.SoapProtocolVersion.Soap11;
    22            axl.RequestEncoding = System.Text.Encoding.UTF8;
    23            axl.Url = "https://10.88.131.143:8443/axl/";
    24
    25            UpdatePhoneReq request = new UpdatePhoneReq();
    26            request.ItemElementName = ConsoleApplication1.WebReference.ItemChoiceType32.name;
    27            request.Item = "SEP0024D7C4D69C";
    28            request.description = "new description1";
    29[b]            request.callingSearchSpaceNameSpecified = false;
    30            request.commonDeviceConfigNameSpecified = false;
    31            request.mediaResourceListNameSpecified = false;
    32            request.networkHoldMohAudioSourceIdSpecified = false;
    33            request.userHoldMohAudioSourceIdSpecified = false;
    34            request.automatedAlternateRoutingCssNameSpecified = false;
    35            request.aarNeighborhoodNameSpecified = false;
    36            request.loadInformationSpecified = false;
    37            request.versionStampSpecified = false;
    38            request.mlppDomainIdSpecified = false;
    39            request.sipProfileNameSpecified = false;
    40            request.cgpnTransformationCssNameSpecified = false;
    41            request.geoLocationNameSpecified = false;
    42            request.geoLocationFilterNameSpecified = false;
    43            request.primaryPhoneNameSpecified = false;
    44            request.userlocaleSpecified = false;
    45            request.networkLocaleSpecified = false;
    46            request.idleTimeoutSpecified = false;
    47            request.softkeyTemplateNameSpecified = false;
    48            request.defaultProfileNameSpecified = false;
    49            request.subscribeCallingSearchSpaceNameSpecified = false;
    50            request.rerouteCallingSearchSpaceNameSpecified = false;
    51            request.dndRingSettingSpecified = false;
    52            request.mobilityUserIdNameSpecified = false;
    53            request.mobileSmartClientProfileNameSpecified = false;
    54            request.dialRulesNameSpecified = false;
    55            request.featureControlPolicySpecified = false;
    56[/b]
    57            GlobalProxySelection.Select = new WebProxy("127.0.0.1", 8888);
    58            try
    59            {
    60                ConsoleApplication1.WebReference.StandardResponse response = axl.updatePhone(request);
    61
    62                System.Console.WriteLine(response);
    63            }
    64            catch (Exception ex)
    65            {
    66                System.Console.WriteLine(ex.Message);
    67            }
    68            System.Console.Read();
    69        }
    70    }
    71}


    Subject: RE: UpdatePhoneReq > error generating the XML document > mandatory fields?
    Replied by: Salim Guerid on 24-09-2013 12:41:11 AM
    Hi David,
    Thanks for your highly appreciated answer. Sounds like you have been through thsi issue in the past. How did you selected the xxxSelected fields? I tried to take all of them (CCM 8.6) but still got the same error.
      1public UpdatePhoneReq()
      2{
      3this.networkLocationField = "Use System Default";
      4this.mlppIndicationStatusField = "Off";
      5this.preemptionField = "Default";
      6this.useTrustedRelayPointField = "Default";
      7this.retryVideoCallAsAudioField = "true";
      8this.useDevicePoolCgpnTransformCssField = "true";
      9this.ringSettingIdleBlfAudibleAlertField = "Default";
     10this.ringSettingBusyBlfAudibleAlertField = "Default";
     11this.singleButtonBargeField = "Default";
     12this.joinAcrossLinesField = "Default";
     13this.builtInBridgeStatusField = "Default";
     14this.callInfoPrivacyStatusField = "Default";
     15this.ignorePresentationIndicatorsField = "false";
     16this.packetCaptureModeField = "None";
     17this.packetCaptureDurationField = "0";
     18this.unattendedPortField = "false";
     19this.requireDtmfReceptionField = "false";
     20this.rfc2833DisabledField = "false";
     21this.certificateOperationField = "No Pending Operation";
     22this.authenticationModeField = "By Null String";
     23this.keySizeField = "1024";
     24this.deviceMobilityModeField = "Default";
     25this.remoteDeviceField = "false";
     26this.dndOptionField = "Ringer Off";
     27this.isActiveField = "true";
     28this.phoneSuiteField = "Default";
     29this.phoneServiceDisplayField = "Default";
     30this.isProtectedField = "false";
     31this.mtpPreferedCodecField = "711ulaw";
     32this.outboundCallRolloverField = "No Rollover";
     33this.hotlineDeviceField = "false";
     34this.alwaysUsePrimeLineField = "Default";
     35this.alwaysUsePrimeLineForVoiceMessageField = "Default";
     36this.deviceTrustModeField = "Not Trusted";
     37}
     38
     39// Custome part to address XML faulty format
     40public bool newNameSpecified;
     41public bool descriptionSpecified;
     42public bool callingSearchSpaceNameSpecified;
     43public bool devicePoolNameSpecified;
     44public bool commonDeviceConfigNameSpecified;
     45public bool commonPhoneConfigNameSpecified;
     46public bool networkLocationSpecified;
     47public bool locationNameSpecified;
     48public bool mediaResourceListNameSpecified;
     49public bool networkHoldMohAudioSourceIdSpecified;
     50public bool userHoldMohAudioSourceIdSpecified;
     51public bool automatedAlternateRoutingCssNameSpecified;
     52public bool aarNeighborhoodNameSpecified;
     53public bool loadInformationSpecified;
     54public bool vendorConfigSpecified;
     55public bool versionStampSpecified;
     56public bool traceFlagSpecified;
     57public bool mlppDomainIdSpecified;
     58public bool mlppIndicationStatusSpecified;
     59public bool preemptionSpecified;
     60public bool useTrustedRelayPointSpecified;
     61public bool retryVideoCallAsAudioSpecified;
     62public bool securityProfileNameSpecified;
     63public bool sipProfileNameSpecified;
     64public bool cgpnTransformationCssNameSpecified;
     65public bool useDevicePoolCgpnTransformCssSpecified;
     66public bool geoLocationNameSpecified;
     67public bool geoLocationFilterNameSpecified;
     68public bool sendGeoLocationSpecified;
     69public bool linesSpecified;
     70public bool phoneTemplateNameSpecified;
     71public bool speeddialsSpecified;
     72public bool busyLampsSpecified;
     73public bool primaryPhoneNameSpecified;
     74public bool ringSettingIdleBlfAudibleAlertSpecified;
     75public bool ringSettingBusyBlfAudibleAlertSpecified;
     76public bool blfDirectedCallParksSpecified;
     77public bool addOnModulesSpecified;
     78public bool userlocaleSpecified;
     79public bool networkLocaleSpecified;
     80public bool idleTimeoutSpecified;
     81public bool authenticationUrlSpecified;
     82public bool directoryUrlSpecified;
     83public bool idleUrlSpecified;
     84public bool informationUrlSpecified;
     85public bool messagesUrlSpecified;
     86public bool proxyServerUrlSpecified;
     87public bool servicesUrlSpecified;
     88public bool servicesSpecified;
     89public bool softkeyTemplateNameSpecified;
     90public bool defaultProfileNameSpecified;
     91public bool enableExtensionMobilitySpecified;
     92public bool singleButtonBargeSpecified;
     93public bool joinAcrossLinesSpecified;
     94public bool builtInBridgeStatusSpecified;
     95public bool callInfoPrivacyStatusSpecified;
     96public bool hlogStatusSpecified;
     97public bool ownerUserNameSpecified;
     98public bool ignorePresentationIndicatorsSpecified;
     99public bool packetCaptureModeSpecified;
    100public bool packetCaptureDurationSpecified;
    101public bool subscribeCallingSearchSpaceNameSpecified;
    102public bool rerouteCallingSearchSpaceNameSpecified;
    103public bool allowCtiControlFlagSpecified;
    104public bool presenceGroupNameSpecified;
    105public bool unattendedPortSpecified;
    106public bool requireDtmfReceptionSpecified;
    107public bool rfc2833DisabledSpecified;
    108public bool certificateOperationSpecified;
    109public bool authenticationModeSpecified;
    110public bool keySizeSpecified;
    111public bool authenticationStringSpecified;
    112public bool upgradeFinishTimeSpecified;
    113public bool deviceMobilityModeSpecified;
    114public bool remoteDeviceSpecified;
    115public bool dndOptionSpecified;
    116public bool dndRingSettingSpecified;
    117public bool dndStatusSpecified;
    118public bool isActiveSpecified;
    119public bool mobilityUserIdNameSpecified;
    120public bool phoneSuiteSpecified;
    121public bool phoneServiceDisplaySpecified;
    122public bool isProtectedSpecified;
    123public bool mobileSmartClientProfileNameSpecified;
    124public bool mtpRequiredSpecified;
    125public bool mtpPreferedCodecSpecified;
    126public bool dialRulesNameSpecified;
    127public bool sshUserIdSpecified;
    128public bool sshPwdSpecified;
    129public bool digestUserSpecified;
    130public bool outboundCallRolloverSpecified;
    131public bool hotlineDeviceSpecified;
    132public bool secureInformationUrlSpecified;
    133public bool secureDirectoryUrlSpecified;
    134public bool secureMessageUrlSpecified;
    135public bool secureServicesUrlSpecified;
    136public bool secureAuthenticationUrlSpecified;
    137public bool secureIdleUrlSpecified;
    138public bool alwaysUsePrimeLineSpecified;
    139public bool alwaysUsePrimeLineForVoiceMessageSpecified;
    140public bool featureControlPolicySpecified;
    141public bool deviceTrustModeSpecified;
    142
    143/// <remarks/>
    144[System.Xml.Serialization.XmlElementAttribute(Form = System.Xml.Schema.XmlSchemaForm.Unqualified)]
    145public string newName
    146{
    147get
    148{
    149return this.newNameField;
    150}
    151set
    152{
    153this.newNameField = value;
    154}
    155}
    And then in my code I tried with or without setting the value to false:

      1reqPhone.ItemElementName = ItemChoiceType32.name;
      2reqPhone.Item = currentIPPhone.name;
      3reqPhone.descriptionSpecified = true;
      4reqPhone.description = currentIPPhone.site + " IP Phone " + currentIPPhone.model;
      5reqPhone.devicePoolNameSpecified = true;
      6reqPhone.devicePoolName = new XFkType() { Value = ipPhonedevicePool};
      7reqPhone.commonDeviceConfigNameSpecified = true;
      8reqPhone.commonDeviceConfigName = new XFkType() { Value = currentIPPhone.site + "-Device Config" };
      9reqPhone.enableExtensionMobilitySpecified = true;
     10reqPhone.enableExtensionMobility = "True";
     11reqPhone.phoneTemplateNameSpecified = true;
     12reqPhone.phoneTemplateName = new XFkType() { Value = "Standard CIPC SCCP" };
     13reqPhone.securityProfileNameSpecified = true;
     14reqPhone.securityProfileName = new XFkType() { Value = "Cisco IP Communicator - Standard SCCP Non-Secure Profile" };
     15reqPhone.locationNameSpecified = true;
     16reqPhone.locationName = new XFkType() { Value = currentIPPhone.site };
     17reqPhone.callingSearchSpaceNameSpecified = true;
     18reqPhone.callingSearchSpaceName = new XFkType() { Value = "Internal-" + currentIPPhone.site };
     19
     20
     21reqPhone.newNameSpecified = false;
     22//reqPhone.descriptionSpecified = false;
     23//reqPhone.callingSearchSpaceNameSpecified = false;
     24//reqPhone.devicePoolNameSpecified = false;
     25//reqPhone.commonDeviceConfigNameSpecified = false;
     26reqPhone.commonPhoneConfigNameSpecified = false;
     27reqPhone.networkLocationSpecified = false;
     28//reqPhone.locationNameSpecified = false;
     29reqPhone.mediaResourceListNameSpecified = false;
     30reqPhone.networkHoldMohAudioSourceIdSpecified = false;
     31reqPhone.userHoldMohAudioSourceIdSpecified = false;
     32reqPhone.automatedAlternateRoutingCssNameSpecified = false;
     33reqPhone.aarNeighborhoodNameSpecified = false;
     34reqPhone.loadInformationSpecified = false;
     35reqPhone.vendorConfigSpecified = false;
     36reqPhone.versionStampSpecified = false;
     37reqPhone.traceFlagSpecified = false;
     38reqPhone.mlppDomainIdSpecified = false;
     39reqPhone.mlppIndicationStatusSpecified = false;
     40reqPhone.preemptionSpecified = false;
     41reqPhone.useTrustedRelayPointSpecified = false;
     42reqPhone.retryVideoCallAsAudioSpecified = false;
     43reqPhone.securityProfileNameSpecified = false;
     44reqPhone.sipProfileNameSpecified = false;
     45reqPhone.cgpnTransformationCssNameSpecified = false;
     46reqPhone.useDevicePoolCgpnTransformCssSpecified = false;
     47reqPhone.geoLocationNameSpecified = false;
     48reqPhone.geoLocationFilterNameSpecified = false;
     49reqPhone.sendGeoLocationSpecified = false;
     50reqPhone.linesSpecified = false;
     51reqPhone.phoneTemplateNameSpecified = false;
     52reqPhone.speeddialsSpecified = false;
     53reqPhone.busyLampsSpecified = false;
     54reqPhone.primaryPhoneNameSpecified = false;
     55reqPhone.ringSettingIdleBlfAudibleAlertSpecified = false;
     56reqPhone.ringSettingBusyBlfAudibleAlertSpecified = false;
     57reqPhone.blfDirectedCallParksSpecified = false;
     58reqPhone.addOnModulesSpecified = false;
     59reqPhone.userlocaleSpecified = false;
     60reqPhone.networkLocaleSpecified = false;
     61reqPhone.idleTimeoutSpecified = false;
     62reqPhone.authenticationUrlSpecified = false;
     63reqPhone.directoryUrlSpecified = false;
     64reqPhone.idleUrlSpecified = false;
     65reqPhone.informationUrlSpecified = false;
     66reqPhone.messagesUrlSpecified = false;
     67reqPhone.proxyServerUrlSpecified = false;
     68reqPhone.servicesUrlSpecified = false;
     69reqPhone.servicesSpecified = false;
     70reqPhone.softkeyTemplateNameSpecified = false;
     71reqPhone.defaultProfileNameSpecified = false;
     72reqPhone.enableExtensionMobilitySpecified = false;
     73reqPhone.singleButtonBargeSpecified = false;
     74reqPhone.joinAcrossLinesSpecified = false;
     75reqPhone.builtInBridgeStatusSpecified = false;
     76reqPhone.callInfoPrivacyStatusSpecified = false;
     77reqPhone.hlogStatusSpecified = false;
     78reqPhone.ownerUserNameSpecified = false;
     79reqPhone.ignorePresentationIndicatorsSpecified = false;
     80reqPhone.packetCaptureModeSpecified = false;
     81reqPhone.packetCaptureDurationSpecified = false;
     82reqPhone.subscribeCallingSearchSpaceNameSpecified = false;
     83reqPhone.rerouteCallingSearchSpaceNameSpecified = false;
     84reqPhone.allowCtiControlFlagSpecified = false;
     85reqPhone.presenceGroupNameSpecified = false;
     86reqPhone.unattendedPortSpecified = false;
     87reqPhone.requireDtmfReceptionSpecified = false;
     88reqPhone.rfc2833DisabledSpecified = false;
     89reqPhone.certificateOperationSpecified = false;
     90reqPhone.authenticationModeSpecified = false;
     91reqPhone.keySizeSpecified = false;
     92reqPhone.authenticationStringSpecified = false;
     93reqPhone.upgradeFinishTimeSpecified = false;
     94reqPhone.deviceMobilityModeSpecified = false;
     95reqPhone.remoteDeviceSpecified = false;
     96reqPhone.dndOptionSpecified = false;
     97reqPhone.dndRingSettingSpecified = false;
     98reqPhone.dndStatusSpecified = false;
     99reqPhone.isActiveSpecified = false;
    100reqPhone.mobilityUserIdNameSpecified = false;
    101reqPhone.phoneSuiteSpecified = false;
    102reqPhone.phoneServiceDisplaySpecified = false;
    103reqPhone.isProtectedSpecified = false;
    104reqPhone.mobileSmartClientProfileNameSpecified = false;
    105reqPhone.mtpRequiredSpecified = false;
    106reqPhone.mtpPreferedCodecSpecified = false;
    107reqPhone.dialRulesNameSpecified = false;
    108reqPhone.sshUserIdSpecified = false;
    109reqPhone.sshPwdSpecified = false;
    110reqPhone.digestUserSpecified = false;
    111reqPhone.outboundCallRolloverSpecified = false;
    112reqPhone.hotlineDeviceSpecified = false;
    113reqPhone.secureInformationUrlSpecified = false;
    114reqPhone.secureDirectoryUrlSpecified = false;
    115reqPhone.secureMessageUrlSpecified = false;
    116reqPhone.secureServicesUrlSpecified = false;
    117reqPhone.secureAuthenticationUrlSpecified = false;
    118reqPhone.secureIdleUrlSpecified = false;
    119reqPhone.alwaysUsePrimeLineSpecified = false;
    120reqPhone.alwaysUsePrimeLineForVoiceMessageSpecified = false;
    121reqPhone.featureControlPolicySpecified = false;
    122reqPhone.deviceTrustModeSpecified = false;
    Any additional hints?
    Thanks for your help so far.

    Subject: RE: UpdatePhoneReq > error generating the XML document > mandatory fields?
    Replied by: David Staudt on 25-09-2013 03:23:34 PM
    It might be helpful if you can provide the actual XML request generated and AXL response.  The SOAPMonitor tool (see AXL guide) may be helpful, or a proxy (Fiddler2), or inspection of Detailed level AXL service logs...
    It is certainly unnecessarty to create the xxxSpecified method for every element/value, my recollection is only the XFKType elements needed this treatment.

    Subject: RE: UpdatePhoneReq > error generating the XML document > mandatory fields?
    Replied by: Salim Guerid on 26-09-2013 03:32:40 PM
    Hi David,
    For a strange reason, I am not able to see any request from the AXLAPI service using the SOAPMonitor. RIS requests are well captured.
    Ok I have update the uppdatephonereq with the bool value for the XFKType only but still no luck.

     1        public bool callingSearchSpaceNameFieldSpecified;
     2        public bool devicePoolNameFieldSpecified;
     3        public bool commonDeviceConfigNameFieldSpecified;
     4        public bool commonPhoneConfigNameFieldSpecified;
     5        public bool locationNameFieldSpecified;
     6        public bool mediaResourceListNameFieldSpecified;
     7        public bool automatedAlternateRoutingCssNameFieldSpecified;
     8        public bool aarNeighborhoodNameFieldSpecified;
     9        public bool securityProfileNameFieldSpecified;
    10        public bool sipProfileNameFieldSpecified;
    11        public bool cgpnTransformationCssNameFieldSpecified;
    12        public bool geoLocationNameFieldSpecified;
    13        public bool geoLocationFilterNameFieldSpecified;
    14        public bool phoneTemplateNameFieldSpecified;
    15        public bool primaryPhoneNameFieldSpecified;
    16        public bool softkeyTemplateNameFieldSpecified;
    17        public bool defaultProfileNameFieldSpecified;
    18        public bool ownerUserNameFieldSpecified;
    19        public bool subscribeCallingSearchSpaceNameFieldSpecified;
    20        public bool rerouteCallingSearchSpaceNameFieldSpecified;
    21        public bool presenceGroupNameFieldSpecified;
    22        public bool mobilityUserIdNameFieldSpecified;
    23        public bool mobileSmartClientProfileNameFieldSpecified;
    24        public bool dialRulesNameFieldSpecified;
    25        public bool featureControlPolicyFieldSpecified;
    Updated the method with:

     1                UpdatePhoneReq reqPhone = new UpdatePhoneReq();
     2
     3                reqPhone.ItemElementName = ItemChoiceType32.name;
     4                reqPhone.Item = currentIPPhone.name;
     5                reqPhone.description = currentIPPhone.site + " IP Phone " + currentIPPhone.model;
     6                reqPhone.devicePoolName = new XFkType() { Value = ipPhonedevicePool};
     7                reqPhone.commonDeviceConfigName = new XFkType() { Value = currentIPPhone.site + "-Device Config" };
     8                reqPhone.enableExtensionMobility = "true";
     9                reqPhone.phoneTemplateName = new XFkType() { Value = "Standard CIPC SCCP" };
    10                reqPhone.securityProfileName = new XFkType() { Value = "Cisco IP Communicator - Standard SCCP Non-Secure Profile" };
    11                reqPhone.locationName = new XFkType() { Value =  currentIPPhone.site };
    12                reqPhone.callingSearchSpaceName = new XFkType() { Value = "Internal-" +  currentIPPhone.site };
    13
    14                reqPhone.callingSearchSpaceNameFieldSpecified = true;
    15                reqPhone.devicePoolNameFieldSpecified = true;
    16                reqPhone.commonDeviceConfigNameFieldSpecified = true;
    17                reqPhone.commonPhoneConfigNameFieldSpecified = true;
    18                reqPhone.locationNameFieldSpecified = true;
    19                reqPhone.mediaResourceListNameFieldSpecified = false;
    20                reqPhone.automatedAlternateRoutingCssNameFieldSpecified = false;
    21                reqPhone.aarNeighborhoodNameFieldSpecified = false;
    22                reqPhone.securityProfileNameFieldSpecified = true;
    23                reqPhone.sipProfileNameFieldSpecified = false;
    24                reqPhone.cgpnTransformationCssNameFieldSpecified = false;
    25                reqPhone.geoLocationNameFieldSpecified = false;
    26                reqPhone.geoLocationFilterNameFieldSpecified = false;
    27                reqPhone.phoneTemplateNameFieldSpecified = true;
    28                reqPhone.primaryPhoneNameFieldSpecified = false;
    29                reqPhone.softkeyTemplateNameFieldSpecified = false;
    30                reqPhone.defaultProfileNameFieldSpecified = false;
    31                reqPhone.ownerUserNameFieldSpecified = false;
    32                reqPhone.subscribeCallingSearchSpaceNameFieldSpecified = false;
    33                reqPhone.rerouteCallingSearchSpaceNameFieldSpecified = false;
    34                reqPhone.presenceGroupNameFieldSpecified = false;
    35                reqPhone.mobilityUserIdNameFieldSpecified = false;
    36                reqPhone.mobileSmartClientProfileNameFieldSpecified = false;
    37                reqPhone.dialRulesNameFieldSpecified = false;
    38                reqPhone.featureControlPolicyFieldSpecified = false;
    39                
    40                StandardResponse res = AXLAPIServiceSingleton.getInstance().updatePhone(reqPhone);

    Thanks to fidller2:

     1<?xml version="1.0" encoding="UTF-8"?>
     2<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
     3   <soap:Body>
     4      <updatePhone xmlns="http://www.cisco.com/AXL/API/8.5">
     5         <name xmlns="">SEPFE0000000000</name>
     6         <callingSearchSpaceNameFieldSpecified>true</callingSearchSpaceNameFieldSpecified>
     7         <devicePoolNameFieldSpecified>true</devicePoolNameFieldSpecified>
     8         <commonDeviceConfigNameFieldSpecified>true</commonDeviceConfigNameFieldSpecified>
     9         <commonPhoneConfigNameFieldSpecified>true</commonPhoneConfigNameFieldSpecified>
    10         <locationNameFieldSpecified>true</locationNameFieldSpecified>
    11         <mediaResourceListNameFieldSpecified>false</mediaResourceListNameFieldSpecified>
    12         <automatedAlternateRoutingCssNameFieldSpecified>false</automatedAlternateRoutingCssNameFieldSpecified>
    13         <aarNeighborhoodNameFieldSpecified>false</aarNeighborhoodNameFieldSpecified>
    14         <securityProfileNameFieldSpecified>true</securityProfileNameFieldSpecified>
    15         <sipProfileNameFieldSpecified>false</sipProfileNameFieldSpecified>
    16         <cgpnTransformationCssNameFieldSpecified>false</cgpnTransformationCssNameFieldSpecified>
    17         <geoLocationNameFieldSpecified>false</geoLocationNameFieldSpecified>
    18         <geoLocationFilterNameFieldSpecified>false</geoLocationFilterNameFieldSpecified>
    19         <phoneTemplateNameFieldSpecified>true</phoneTemplateNameFieldSpecified>
    20         <primaryPhoneNameFieldSpecified>false</primaryPhoneNameFieldSpecified>
    21         <softkeyTemplateNameFieldSpecified>false</softkeyTemplateNameFieldSpecified>
    22         <defaultProfileNameFieldSpecified>false</defaultProfileNameFieldSpecified>
    23         <ownerUserNameFieldSpecified>false</ownerUserNameFieldSpecified>
    24         <subscribeCallingSearchSpaceNameFieldSpecified>false</subscribeCallingSearchSpaceNameFieldSpecified>
    25         <rerouteCallingSearchSpaceNameFieldSpecified>false</rerouteCallingSearchSpaceNameFieldSpecified>
    26         <presenceGroupNameFieldSpecified>false</presenceGroupNameFieldSpecified>
    27         <mobilityUserIdNameFieldSpecified>false</mobilityUserIdNameFieldSpecified>
    28         <mobileSmartClientProfileNameFieldSpecified>false</mobileSmartClientProfileNameFieldSpecified>
    29         <dialRulesNameFieldSpecified>false</dialRulesNameFieldSpecified>
    30         <featureControlPolicyFieldSpecified>false</featureControlPolicyFieldSpecified>
    31         <description xmlns="">CH3 IP Phone Cisco IP Communicator</description>
    32         <callingSearchSpaceName xmlns="">Internal-CH3</callingSearchSpaceName>
    33         <devicePoolName xmlns="">CH3</devicePoolName>
    34         <commonDeviceConfigName xmlns="">CH3-Device Config</commonDeviceConfigName>
    35         <locationName xmlns="">CH3</locationName>
    36         <mediaResourceListName xmlns="" xsi:nil="true" />
    37         <networkHoldMohAudioSourceId xmlns="" xsi:nil="true" />
    38         <userHoldMohAudioSourceId xmlns="" xsi:nil="true" />
    39         <automatedAlternateRoutingCssName xmlns="" xsi:nil="true" />
    40         <aarNeighborhoodName xmlns="" xsi:nil="true" />
    41         <loadInformation xmlns="" xsi:nil="true" />
    42         <versionStamp xmlns="" xsi:nil="true" />
    43         <mlppDomainId xmlns="" xsi:nil="true" />
    44         <securityProfileName xmlns="">Cisco IP Communicator - Standard SCCP Non-Secure Profile</securityProfileName>
    45         <sipProfileName xmlns="" xsi:nil="true" />
    46         <cgpnTransformationCssName xmlns="" xsi:nil="true" />
    47         <geoLocationName xmlns="" xsi:nil="true" />
    48         <geoLocationFilterName xmlns="" xsi:nil="true" />
    49         <phoneTemplateName xmlns="">Standard CIPC SCCP</phoneTemplateName>
    50         <primaryPhoneName xmlns="" xsi:nil="true" />
    51         <userlocale xmlns="" xsi:nil="true" />
    52         <networkLocale xmlns="" xsi:nil="true" />
    53         <idleTimeout xmlns="" xsi:nil="true" />
    54         <softkeyTemplateName xmlns="" xsi:nil="true" />
    55         <defaultProfileName xmlns="" xsi:nil="true" />
    56         <enableExtensionMobility xmlns="">true</enableExtensionMobility>
    57         <ownerUserName xmlns="" xsi:nil="true" />
    58         <subscribeCallingSearchSpaceName xmlns="" xsi:nil="true" />
    59         <rerouteCallingSearchSpaceName xmlns="" xsi:nil="true" />
    60         <dndRingSetting xmlns="" xsi:nil="true" />
    61         <mobilityUserIdName xmlns="" xsi:nil="true" />
    62         <mobileSmartClientProfileName xmlns="" xsi:nil="true" />
    63         <dialRulesName xmlns="" xsi:nil="true" />
    64         <featureControlPolicy xmlns="" xsi:nil="true" />
    65      </updatePhone>
    66   </soap:Body>
    67</soap:Envelope>


    Subject: RE: UpdatePhoneReq > error generating the XML document > mandatory fields?
    Replied by: Salim Guerid on 02-10-2013 11:53:23 PM
    Hi David,
    Have you got any idea further guess on the error? I have noticed that I still get a positive response from the CCM which processes my requests :
     
    1<?xml version="1.0" encoding="UTF-8"?>
    2<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
    3   <soapenv:Body>
    4      <ns:updatePhoneResponse xmlns:ns="http://www.cisco.com/AXL/API/8.5">
    5         <return>{4A27FC47-9F8C-AD15-61C8-A0EB2C38886B}</return>
    6      </ns:updatePhoneResponse>
    7   </soapenv:Body>
    8</soapenv:Envelope>


    Subject: RE: UpdatePhoneReq > error generating the XML document > mandatory fields?
    Replied by: David Staudt on 03-10-2013 02:54:37 PM
    Two things I noticed:

    In order to prevent the xxxSpecified from getting serialized into the actual Request, you can 'decorate' it this way:
    1[System.Xml.Serialization.XmlIgnore()]
    2public bool requestNameSpecified;
    Also, it looks like you are creating the 'specified' field using the pattern xxxFieldSpecified, rather than xxxSpecified:
    1public bool mediaResourceListNameFieldSpecified;
    should be:
    1[System.Xml.Serialization.XmlIgnore()]
    2public bool mediaResourceListNameSpecified;


    Subject: RE: UpdatePhoneReq > error generating the XML document > mandatory fields?
    Replied by: Salim Guerid on 04-10-2013 11:44:28 PM
    Hi David,
    Works like a charm! Thanks for your precious help which was highly appreciated :-)

    Sounds like the only statement needed is actually:
    1[System.Xml.Serialization.XmlIgnore()]