Quantcast
Channel: Web API
Viewing all articles
Browse latest Browse all 4850

Consuming An XML Web Service

$
0
0

Hello, everyone.

I work for a small non-profit agency and we need to consume an older XML web service for one of our partners. Since I'm the only one around with any programming background, it's fallen to me to get this working.

I'm completely self taught and very new to both C# and ASP.NET.

This web service has a WSDL file which I've consumed with WCF. Everything went fine and I'm set up with a client.

However, I'm having trouble getting it working. I've put a method called "DownloadFile" in my HomeController and here is the code. Note that I've marked the client attributes with "null" to prevent the username, password and other information from being revealed.

        public ActionResult DownloadFile()
        {
            BasicHttpBinding binding = new BasicHttpBinding();
            binding.MaxReceivedMessageSize = 65536*2;
            var clientSCHED = new nullClient();
            var firstDate = DateTime.Today;
            var firstDateStr = firstDate.ToShortDateString();
            var lastDate = DateTime.Today;
            var lastDateStr = lastDate.ToShortDateString();
            var task1 = clientSCHED.AppointmentDataRawAsync("null", "null", "null",
                firstDateStr, lastDateStr, null, null);

            return DownloadFile(task1);

I know that it's wrong but I'm not certain why it's wrong. The client is supposed to return a list of appointments in XML format. Any assistance on this would be appreciated.


Viewing all articles
Browse latest Browse all 4850

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>