infopath 2007 submit data via web service to sql 2008

I am trying to submit data from an infopath 2007 form to an sql 2008 database table named "employees".  I have 5 columns in the table which i want populated when the user pushes the submit button on the form.  I made a web service to help with the data transfer which infopath connects to.  the problem i have is that when i push the submit button, i get an error on the form telling me  the following.  After the infopath error message, I have included my web service code. i would appreciate some direction in what i am doing wrong.  thank you.

The query cannot be run for the following DataObject: AddNewEmployee
InfoPath cannot run the specified query.
The SOAP response indicates that an error occurred:

System.Web.Services.Protocols.SoapException: Server was unable to read request. ---> System.InvalidOperationException: There is an error in XML document (1, 424). ---> System.FormatException: Input string was not in a correct format.
   at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)
   at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info)
   at System.Xml.XmlConvert.ToInt32(String s)
   at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReader1.Read2_Employee(Boolean checkType)
   at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationReader1.Read3_AddNewEmployee()
   at Microsoft.Xml.Serialization.GeneratedAssembly.ArrayOfObjectSerializer.Deserialize(XmlSerializationReader reader)
   at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events)
   --- End of inner exception stack trace ---
   at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle, XmlDeserializationEvents events)
   at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader, String encodingStyle)
   at System.Web.Services.Protocols.SoapServerProtocol.ReadParameters()
   --- End of inner exception stack trace ---
   at System.Web.Services.Protocols.SoapServerProtocol.ReadParameters()
   at System.Web.Services.Protocols.WebServiceHandler.CoreProcessRequest()

WEBSERVICE CODE (C#)

 using System;
 using System.Web;
 using System.Web.Services;
 using System.Data;
 using System.Data.SqlClient;

public class Service : System.Web.Services.WebService
{
    public struct Employee
    {
        public int EmployeeNumber;
        public String Title;
        public String FirstName;
        public String LastName;
        public Decimal Salary;
    }

    [WebMethod]
    public int AddNewEmployee(Employee employee)
{
  int rowsAffected = 0;
  using (SqlConnection conn = new SqlConnection("Data Source=(local);Initial Catalog=Online_Content;User ID=user;Password=******"))
  {
    SqlCommand cmd = new SqlCommand("INSERT INTO Employees " +
      "(EmployeeNumber, Title, FirstName, LastName, Salary) " +
      "VALUES(@EmployeeNumber, @Title, @FirstName, @LastName, @Salary)", conn);

    cmd.Parameters.AddWithValue("@EmployeeNumber", employee.EmployeeNumber);
    cmd.Parameters.AddWithValue("@Title", employee.Title);
    cmd.Parameters.AddWithValue("@FirstName", employee.FirstName);
    cmd.Parameters.AddWithValue("@LastName", employee.LastName);
    cmd.Parameters.AddWithValue("@Salary", employee.Salary);

    conn.Open();
    rowsAffected = cmd.ExecuteNonQuery();
  }

  return rowsAffected;
  }
}
bwierwiAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Clay FoxDirector of Business IntegrationCommented:
It is way simpler to get the web services prebuilt.

I would download the free suite from Qdabra, even just to test it and see how they do it.

Personally it is way simpler and easier since then trying to build one yourself that does everything theirs does.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
WCF

From novice to tech pro — start learning today.