コード例 #1
0
ファイル: Push.cs プロジェクト: horn-solutions/CPQUtilities
        public static Company Company(Company company, Credentials credentials)
        {
            //<COMPANYPROPERTIES>
            //  <COMPANYCODE>WBI</COMPANYCODE >
            //  <NAME>Webcom, Inc</NAME>
            //  <EMAILADDRESS>webmaster @webcominc.com</EMAILADDRESS>
            //  <ADDRESS1>611 N Broadway</ADDRESS1>
            //  <ADDRESS2 />
            //  <CITY>Milwaukee</CITY>
            //  <STATE>WI</STATE>
            //  <ZIPCODE>53202</ZIPCODE>
            //  <COUNTRY>United States</COUNTRY>
            //  <PHONENUMBER>414-273-4442</PHONENUMBER>
            //  <FAXNUMBER> 414-298-9248 </FAXNUMBER>
            //  <IMAGE>Webcomlogo.gif</IMAGE>
            //</COMPANYPROPERTIES>


            //push Company
            Company retVal = company;

            WsSrv.WsSrv service = new WsSrv.WsSrv();
            service.Timeout = 200 * 1000;
            XmlDocument xDoc     = company.CreateXml();
            XmlNode     response = service.CompanyAdministration(credentials.Login, credentials.Password, "ADDORUPDATE", xDoc);

            Console.WriteLine(response.InnerXml);

            return(retVal);
        }
コード例 #2
0
ファイル: Push.cs プロジェクト: horn-solutions/CPQUtilities
        public static User User(User user, Credentials credentials)
        {
            /*
             * <USERPROPERTIES>
             * <USERNAME>ksmith</USERNAME>
             * <PASSWORD AllowSameAsExisting="1">xdF5460Bf</PASSWORD>
             * <TITLE>Mr.</TITLE>
             * <FIRSTNAME>Kyle</FIRSTNAME>
             * <LASTNAME>Smith</LASTNAME>
             * <TYPE>Sales</TYPE>
             * <EMAILADDRESS>[email protected]</EMAILADDRESS>
             * <ADDRESS1>Summer Street</ADDRESS1>
             * <ADDRESS2 />
             * <ADMINISTRATOR>TRUE</ADMINISTRATOR>
             * <CITY>New Berlin</CITY>
             * <STATE>WI</STATE>
             * <ZIPCODE>53151</ZIPCODE>
             * <COUNTRY>United States</COUNTRY>
             * <PHONENUMBER>262-785-8320</PHONENUMBER>
             * <FAXNUMBER />
             * <COMPANYCODE>Callidus</COMPANYCODE>
             * <MUSTCHANGEPASSWORD>0</MUSTCHANGEPASSWORD>
             * <PASSWORDLOCKED>0</PASSWORDLOCKED>
             * <DEFAULTDICTIONARY></DEFAULTDICTIONARY>
             * <ORDERINGPARENT>jsmith</ORDERINGPARENT>
             * <MANAGINGPARENT>msmith</MANAGINGPARENT>
             * <APPROVINGPARENT>msmith</APPROVINGPARENT>
             * <CrmUserId>CALLIDUS/[email protected]</CrmUserId>
             * <CrmName>CALLIDUS/[email protected]</CrmName>
             * <CrmUserName></CrmUserName>
             * <CrmPassword>crm_123zfgTlm</CrmPassword>
             * </USERPROPERTIES>
             */

            //push user
            User retVal = user;

            WsSrv.WsSrv service = new WsSrv.WsSrv();
            service.Timeout = 200 * 1000;

            XmlDocument xDoc     = user.CreateXml();
            XmlNode     response = service.UserAdministration(credentials.Login, credentials.Password, "ADDORUPDATE", xDoc);

            Console.WriteLine(response.InnerXml);

            return(retVal);
        }
コード例 #3
0
        //public string Login2 { get { return string.Format("{0}@{1}", Username, Domain); } }

        public bool DoYouSeeMe()
        {
            //for use with WsSrv Web Reference
            bool retVal = false;

            WsSrv.WsSrv service = new WsSrv.WsSrv();
            //service.Url = urlList.SelectedItem.ToString();
            service.Timeout = 200 * 1000; //miliseconds

            string      response = service.doUSeeMe(Login, Password);
            XmlDocument xdoc     = new XmlDocument();

            xdoc.LoadXml(response);
            retVal = xdoc.FirstChild.Name.Equals("ICANSEEYOU");


            return(retVal);
        }
コード例 #4
0
ファイル: Push.cs プロジェクト: horn-solutions/CPQUtilities
        public static Product Product(Product product, Credentials credentials) //(string APIusername, string APIpassword, string productName, string productPartNumber, string productDisplayType)
        {
            //default return value
            Product retVal = product;

            //adding a product

            //complete list of WsSrv operations: https://www.webcomcpq.com/wsAPI/wssrv.asmx

            WsSrv.WsSrv service = new WsSrv.WsSrv();
            //wait 200 seconds:
            service.Timeout = 200 * 1000;

            //                XmlDocument xDoc = new XmlDocument();
            //                xDoc.LoadXml(string.Format(@"
            //<Products>
            //    <Product>
            //        <Identificator>PartNumber</Identificator>
            //        <DisplayType>Simple</DisplayType>
            //        <PartNumber>Test {0}</PartNumber>
            //        <ProductType>Accessories</ProductType>
            //        <ProductName>
            //            <USEnglish><![CDATA[{0}]]></USEnglish>
            //        </ProductName>
            //        <StartDate>3/3/15</StartDate>
            //        <EndDate>5/5/18</EndDate>
            //        <Categories>
            //            <USEnglish><![CDATA[Test]]></USEnglish>
            //        </Categories>
            //    </Product>
            //</Products>
            //", productName));

            XmlDocument xDoc = product.CreateXml();

            XmlNode response = service.SimpleProductAdministration(credentials.Login, credentials.Password, "ADDORUPDATE", xDoc);

            Console.WriteLine(response.InnerXml);;

            return(retVal);
        }