Error on getPhone

Version 1
    This document was generated from CDN thread

    Created by: Breno Lucena on 17-01-2012 12:20:02 PM
    I´m trying to execute the following code:
     

            private void DoGetPhone()
            {
                try
                {
                    GetPhoneReq getPhoneReq = new GetPhoneReq();
                    getPhoneReq.ItemElementName = ItemChoiceType133.uuid;
                    getPhoneReq.Item = deviceUuid;
     
                    GetPhoneRes getPhoneResp = AxlApiService.getPhone(getPhoneReq);
                }
                catch (Exception ex)
                {
                    throw ex;
                }
            } 

     
    Here follow the response received:
     
    - Method AXLAPIService.getNumDevices can not be reflected.
     
       InnerException - There was an error reflecting 'getNumDevicesResult'.
     
           InnerException - There was an error reflecting type 'getNumDevicesResponse'.
     
                InnerException - There was an error reflecting property 'class'.
     
                    InnerException - The type for XmlAttribute may not be specified for primitive types.
     
    I noticed the code is trying to serialize an invalid @class entity.
    Does anyone knows how to fix it?
     
    I´d like to thank you in advanced for your attention.
     
    Regards. 
     
    Breno.

    Subject: Re: New Message from Breno Lucena in Administration XML (AXL) - Administrat
    Replied by: Sergey Knyazev on 18-01-2012 01:44:29 AM
    what version of AXLAPIService.cs do you have?



    From: Cisco Developer Community Forums <cdicuser@developer.cisco.com>
    To: "cdicuser@developer.cisco.com" <cdicuser@developer.cisco.com>
    Date: 01/17/2012 07:21 PM
    Subject: New Message from Breno Lucena in Administration XML (AXL) -
                Administration XML Questions: Error on getPhone



    Breno Lucena has created a new message in the forum "Administration XML
    Questions":

    --------------------------------------------------------------
    I´m trying to execute the following code:


            private void DoGetPhone()
            {
                try
                {
                    GetPhoneReq getPhoneReq = new GetPhoneReq();
                    getPhoneReq.ItemElementName = ItemChoiceType133.uuid;
                    getPhoneReq.Item = deviceUuid;

                    GetPhoneRes getPhoneResp = AxlApiService.getPhone
    (getPhoneReq);
                }
                catch (Exception ex)
                {
                    throw ex;
                }
            }


    Here follow the response received:

    - Method AXLAPIService.getNumDevices can not be reflected.

       InnerException - There was an error reflecting 'getNumDevicesResult'.

           InnerException - There was an error reflecting type
    'getNumDevicesResponse'.

                InnerException - There was an error reflecting property
    'class'.

                    InnerException - The type for XmlAttribute may not be
    specified for primitive types.

    I noticed the code is trying to serialize an invalid @class entity.
    Does anyone knows how to fix it?

    I´d like to thank you in advanced for your attention.

    Regards.

    Breno.
    --
    To respond to this post, please click the following link:

    <
    http://developer.cisco.com/web/axl/forums/-/message_boards/view_message/5017761
    >

    or simply reply to this email.

    Subject: RE: Re: New Message from Breno Lucena in Administration XML (AXL) - Adminis
    Replied by: Breno Lucena on 18-01-2012 05:53:09 AM
    Hello Sergey,
     
    Thanks for the reply.
     
    I generated the AXLAPIService.cs, based on 8.5 files (AXLAPI.wsdl and AXLSoap.xsd).
     
    After that, I´ve been fixing the issues on it.
    The bugfix mentioned by the api´s documentation doesn´t fix all issues.

     
    Thank you again for your reply.
     
    Regards.
     
    Breno.
     
    what version of AXLAPIService.cs do you have?



    From: Cisco Developer Community Forums <cdicuser@developer.cisco.com>
    To: "cdicuser@developer.cisco.com" <cdicuser@developer.cisco.com>
    Date: 01/17/2012 07:21 PM
    Subject: New Message from Breno Lucena in Administration XML (AXL) -
                Administration XML Questions: Error on getPhone



    Breno Lucena has created a new message in the forum "Administration XML
    Questions":

    --------------------------------------------------------------
    I´m trying to execute the following code:


            private void DoGetPhone()
            {
                try
                {
                    GetPhoneReq getPhoneReq = new GetPhoneReq();
                    getPhoneReq.ItemElementName = ItemChoiceType133.uuid;
                    getPhoneReq.Item = deviceUuid;

                    GetPhoneRes getPhoneResp = AxlApiService.getPhone
    (getPhoneReq);
                }
                catch (Exception ex)
                {
                    throw ex;
                }
            }


    Here follow the response received:

    - Method AXLAPIService.getNumDevices can not be reflected.

       InnerException - There was an error reflecting 'getNumDevicesResult'.

           InnerException - There was an error reflecting type
    'getNumDevicesResponse'.

                InnerException - There was an error reflecting property
    'class'.

                    InnerException - The type for XmlAttribute may not be
    specified for primitive types.

    I noticed the code is trying to serialize an invalid @class entity.
    Does anyone knows how to fix it?

    I´d like to thank you in advanced for your attention.

    Regards.

    Breno.
    --
    To respond to this post, please click the following link:

    <
    http://developer.cisco.com/web/axl/forums/-/message_boards/view_message/5017761
    >

    or simply reply to this email.


    Subject: Re: New Message from Breno Lucena in Administration XML (AXL) - Administrat
    Replied by: Sergey Knyazev on 18-01-2012 06:07:29 AM
    generate AXLAPIService.cs based on 8.0 this enough for 8.5 and 8.6(tested)
    and use this code for example:

                GetPhoneReq req = new GetPhoneReq();
                GetPhoneRes resp = new GetPhoneRes();

                //create line objects for return

                RDirn dirn = new RDirn();
                dirn.pattern = "";
                RPhone rp = new RPhone();
                RPhoneLines rpl = new RPhoneLines();
                RPhoneLine[] rl = new RPhoneLine[1];
                rl[0] = new RPhoneLine();
                rl[0].dirn = dirn;
                rpl.Items = rl;
                rp.lines = rpl;
                //

                req.ItemElementName = ItemChoiceType129.name;
                req.Item =SEP0000aaaabbbb  // phone name
                req.returnedTags = rp;    //returned data

                resp = axl.getPhone(req);
                if (resp.@return.phone.lines.Items != null)
                {
                    foreach (RPhoneLine line in resp.@return.phone.lines.Items)
                    {
                        return (line.dirn.pattern);
                    }
                }






    From: Cisco Developer Community Forums <cdicuser@developer.cisco.com>
    To: "cdicuser@developer.cisco.com" <cdicuser@developer.cisco.com>
    Date: 01/18/2012 12:55 PM
    Subject: New Message from Breno Lucena in Administration XML (AXL) -
                Administration XML Questions: RE: Re: New Message from Breno
                Lucena in Administration XML (AXL) - Adminis



    Breno Lucena has created a new message in the forum "Administration XML
    Questions":

    --------------------------------------------------------------
    Hello Sergey,

    Thanks for the reply.

    I generated the AXLAPIService.cs, based on 8.5 files (AXLAPI.wsdl and
    AXLSoap.xsd).

    After that, I´ve been fixing the issues on it.
    The bugfix mentioned by the api´s documentation doesn´t fix all issues.


    Thank you again for your reply.

    Regards.

    Breno.

    what version of AXLAPIService.cs do you have?



    From: Cisco Developer Community Forums <cdicuser@developer.cisco.com>
    To: "cdicuser@developer.cisco.com" <cdicuser@developer.cisco.com>
    Date: 01/17/2012 07:21 PM
    Subject: New Message from Breno Lucena in Administration XML (AXL) -
    Administration XML Questions: Error on getPhone



    Breno Lucena has created a new message in the forum "Administration XML
    Questions":

    --------------------------------------------------------------
    I´m trying to execute the following code:


            private void DoGetPhone()
            {
                try
                {
                    GetPhoneReq getPhoneReq = new GetPhoneReq();
                    getPhoneReq.ItemElementName = ItemChoiceType133.uuid;
                    getPhoneReq.Item = deviceUuid;

                    GetPhoneRes getPhoneResp = AxlApiService.getPhone
    (getPhoneReq);
                }
                catch (Exception ex)
                {
                    throw ex;
                }
            }


    Here follow the response received:

    - Method AXLAPIService.getNumDevices can not be reflected.

       InnerException - There was an error reflecting 'getNumDevicesResult'.

           InnerException - There was an error reflecting type
    'getNumDevicesResponse'.

                InnerException - There was an error reflecting property
    'class'.

                    InnerException - The type for XmlAttribute may not be
    specified for primitive types.

    I noticed the code is trying to serialize an invalid @class entity.
    Does anyone knows how to fix it?

    I´d like to thank you in advanced for your attention.

    Regards.

    Breno.
    --
    To respond to this post, please click the following link:

    <
    http://developer.cisco.com/web/axl/forums/-/message_boards/view_message/5017761

    >

    or simply reply to this email.

    --
    To respond to this post, please click the following link:

    <
    http://developer.cisco.com/web/axl/forums/-/message_boards/view_message/5023182
    >

    or simply reply to this email.

    Subject: RE: Error on getPhone
    Replied by: Breno Lucena on 18-01-2012 07:26:09 AM
    It really works.

    Now I´m getting: The request failed with HTTP status 401: Unauthorized.

    But it seems to be good, at least the bug has changed.

    Thank you... Sergey.

    Regards.

    Breno Lucena.

    Subject: Re: New Message from Breno Lucena in Administration XML (AXL) - Administrat
    Replied by: Sergey Knyazev on 18-01-2012 07:54:29 AM
    Change  in AXLAPIService
    From:
    public AXLAPIService() {
            this.Url = "https://CCMSERVERNAME:8443/axl/";
        }

    To:
    protected override System.Net.WebRequest GetWebRequest(Uri uri)
        {
            System.Net.HttpWebRequest request = base.GetWebRequest(uri) as
    System.Net.HttpWebRequest;
            request.ProtocolVersion = System.Net.HttpVersion.Version10;
            request.Proxy = null;

            return request;
        }

        public AXLAPIService(string ccmIp, string user, string password)
        {
            ServicePointManager.ServerCertificateValidationCallback += delegate
    (
                object sender,
                X509Certificate certificate,
                X509Chain chain,
                SslPolicyErrors sslPolicyErrors)
            {
                return true;
            };

            this.Url = "https://" + ccmIp + ":8443/axl/";
            this.Credentials = new System.Net.NetworkCredential(user,
    password);
            //this.Proxy = null;





    From: Cisco Developer Community Forums <cdicuser@developer.cisco.com>
    To: "cdicuser@developer.cisco.com" <cdicuser@developer.cisco.com>
    Date: 01/18/2012 02:27 PM
    Subject: New Message from Breno Lucena in Administration XML (AXL) -
                Administration XML Questions: RE: Error on getPhone



    Breno Lucena has created a new message in the forum "Administration XML
    Questions":

    --------------------------------------------------------------
    It really works.

    Now I´m getting: The request failed with HTTP status 401: Unauthorized.

    But it seems to be good, at least the bug has changed.

    Thank you... Sergey.

    Regards.

    Breno Lucena.
    --
    To respond to this post, please click the following link:

    <
    http://developer.cisco.com/web/axl/forums/-/message_boards/view_message/5023310
    >

    or simply reply to this email.

    Subject: RE: Error on getPhone
    Replied by: Breno Lucena on 18-01-2012 08:52:11 AM
    Fixed!

    Thanks a lot!

    Regads.

    Breno Lucena  cold