title: MVC - Calling an external Web service and displaying it in a view
body: <p>I am new to asp.net MVC. The task I have at hand is to contact a web service call one of its methods and display it in a view. I have started by creating a new MVC2 appln. in VS2010.  Here is my index.aspx(default page) view:</p>
  
  <pre><code>&lt;asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server"&gt;
  &lt;h2&gt;&lt;%: ViewData["Message"] %&gt;&lt;/h2&gt;
  &lt;p&gt;
      &lt;fieldset&gt;
      &lt;legend&gt;Create Soap Request&lt;/legend&gt;
  @using (Ajax.BeginForm("CreateSoapRequestResult","CreateSoapRequest",
                          new AjaxOptions { UpdateTargetId = "divSoapRequestDetails" }))
  {
      &lt;div id="divSoapRequestDetails"&gt;&lt;/div&gt;
      &lt;ol&gt;
          &lt;li&gt;
              @Html.Label("Method")
              @Html.TextBox("txtMethodName")
          &lt;/li&gt;
          &lt;li&gt;
              @Html.Label("Username")
              @Html.TextBox("txtUsername")
          &lt;/li&gt;
          &lt;li&gt;
              @Html.Label("Password")
              @Html.TextBox("txtPassword")
          &lt;/li&gt;
      &lt;/ol&gt;
  &lt;button&gt;Generate Request&lt;/button&gt;
  }   
  &lt;/fieldset&gt;
  &lt;/p&gt;
  &lt;/asp:Content&gt;
  </code></pre>
  
  <p>But I am at wits end trying to figure out how to pass data around. I assume I need to pass this on to a controller(or to a model) which will then create the soap request, call the service method and get the response. Please correct me if I am wrong. I then have to present it in another view(preferably). </p>