Hello,
I created a 2010 InfoPath form and setup a web service to try and write the entire form to SQL. When I click submit it writes the record to SQL, but nothing shows in my JobRequest table XMLForm Field.I set the web service parameters to "entire form (xml document, including...)
Can someone tell me what I'm doing wrong? Thank You.
CREATE TABLE [dbo].[JobRequest](
[JobRequestID] [int] IDENTITY(1,1) NOT NULL,
[RequestDate] [datetime] NULL,
[LastName] [varchar](30) NULL,
[FirstName] [varchar](30) NULL,
[EmailAddress] [varchar](50) NULL,
[SSN] [varchar](50) NULL,
[XMLForm] [xml] NULL,
[CreateDate] [datetime] NULL,
CONSTRAINT [PK_JobRequest] PRIMARY KEY CLUSTERED
(
[JobRequestID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
CREATE PROCEDURE [dbo].[sp_Update_JobRequestXML]
@XMLForm xml
AS
BEGIN
INSERT INTO JobRequest
values
(null, null, null, null, null, @XMLForm, GETDATE())
END
[WebMethod]
public string[] AddJobRequestXML(XmlDocument XMLForm)
{
clsEmployee cEmployee = new clsEmployee();
cEmployee.XMLDoc = XMLForm;
cEmployee.AddJobRequest();
return null;
}
public class clsEmployee
{
SqlParameter[] _paramArr;
public XmlDocument _XMLDoc;
public void AddJobRequestXML()
{
_paramArr = new SqlParameter[1];
_paramArr[0] = new SqlParameter("@XMLForm", SqlDbType.Xml);
_paramArr[0].Value = _XMLDoc.InnerXml;
SqlHelper.ExecuteNonQuery(ConfigurationManager.ConnectionStrings["cfsconn"].ToString(), "sp_Update_JobRequestXML", _paramArr);
}
}