Search This Blog

Showing posts with label C#. Show all posts
Showing posts with label C#. Show all posts

Thursday, November 29, 2012

Difference between http call and webservice


HTTP call is a pure HTTP Request/Reponse using GET and POST. 

Webservice can be implemented via HTTP/JMS/MQ 

As far as the transport protocol is concerned, HTTP is pretty similar to both XML and Web Service. In case of a general HTTP call, XML message is transported over HTTP protocol, and SOAP message is transported over HTTP protocol in case of a web service. 

But, the kind of message that's being transported over this HTTP protocol really matters. XML differs a lot from a SOAP Message. While XML is specific to one transaction and to one particular system, a SOAP Message can be made generic to multiple systems. 

Sunday, April 29, 2012

Weeks of dates range


private string GetWeeks(DateTime date1, DateTime date2)
        {
            string weeks = string.Empty;
            DateTime date = date1;
            int weekNumber = 1;
            while (date <= date2)
            {
                weeks += "Week " + weekNumber.ToString() + "- (Start Date): ";
                weeks += date.ToShortDateString() + " to (End Date) ";
                date = date.AddDays(6);
                if (date > date2)
                    date= date2;
                weeks += date.ToShortDateString();
                date = date.AddDays(1);
                weeks += Environment.NewLine;
                weekNumber++;
            }
            return weeks;
           
        }