コード例 #1
0
ファイル: RemotingClient.cs プロジェクト: steev90/opendental
        internal static string SendAndReceive(DataTransferObject dto)
        {
            string dtoString = dto.Serialize();

            OpenDentalServer.ServiceMain service = new OpenDentBusiness.OpenDentalServer.ServiceMain();
            service.Url = ServerURI;
            if (MidTierProxyAddress != null && MidTierProxyAddress != "")
            {
                IWebProxy    proxy = new WebProxy(MidTierProxyAddress);
                ICredentials cred  = new NetworkCredential(MidTierProxyUserName, MidTierProxyPassword);
                proxy.Credentials = cred;
                service.Proxy     = proxy;
            }
            //The default useragent is
            //Mozilla/4.0 (compatible; MSIE 6.0; MS Web Services Client Protocol 4.0.30319.296)
            //But DHS firewall doesn't allow that.  MSIE 6.0 is probably too old, and their firewall also looks for IE8Mercury.
            service.UserAgent = "Mozilla/4.0 (compatible; MSIE 7.0; MS Web Services Client Protocol 4.0.30319.296; IE8Mercury)";
            string result = service.ProcessRequest(dtoString);

            //The web service (xml) serializer/deserializer is removing the '\r' portion of our newlines during the data transfer.
            //Replacing the string is not the best solution but it works for now. The replacing happens inside ProcessRequest() (server side) and here (client side).
            //It's done server side for usage purposes within the methods being called (exampe: inserting into db) and then on the client side for displaying purposes.
            if (result != null)
            {
                result = result.Replace("\n", "\r\n");
            }
            return(result);
        }
コード例 #2
0
ファイル: RemotingClient.cs プロジェクト: nampn/ODental
        internal static string SendAndReceive(DataTransferObject dto)
        {
            string dtoString = dto.Serialize();

            OpenDentalServer.ServiceMain service = new OpenDentBusiness.OpenDentalServer.ServiceMain();
            service.Url = ServerURI;
            string result = service.ProcessRequest(dtoString);

            //The web service (xml) serializer/deserializer is removing the '\r' portion of our newlines during the data transfer.
            //Replacing the string is not the best solution but it works for now. The replacing happens inside ProcessRequest() (server side) and here (client side).
            //It's done server side for usage purposes within the methods being called (exampe: inserting into db) and then on the client side for displaying purposes.
            if (result != null)
            {
                result = result.Replace("\n", "\r\n");
            }
            return(result);
        }