submit a form in managed code -> C#

M

Mishma

Hi there,

I’ve got a form with repeating section, and I’d like to post one different
form in a WSS for each repeating section. I use managed code to submit each
form, but when I click the send button I’ve got a security permission error.
Anyone knows where is the problem ???

The code I use to submit each repeating section is :

// Number of repeating section
IXMLDOMNodeList nbIS = thisXDocument.DOM.selectNodes("/my:SA/my:mesIS");

for (int cpt=1; cpt<(nbIS.length); cpt++)
{
string strURL = "http://myurl/myform" + cpt + ".xml";
MSXML2.XMLHTTP oXmlHttp = new MSXML2.XMLHTTP();

oXmlHttp.open("HEAD", strURL, null, null, null);

oXmlHttp.send(thisXDocument.DOM.selectSingleNode("/my:SA/my:mesIS["+ cpt
+"]").xml);

if(oXmlHttp.status == 404)
{
oXmlHttp.open("PUT", strURL, null, null, null);

oXmlHttp.send(thisXDocument.DOM.selectSingleNode("/my:SA/my:mesIS["+ cpt
+"]").xml);

if (oXmlHttp.status == 200 || oXmlHttp.status
== 201)
{
thisXDocument.UI.Alert("GOOD");
}
}
}

I translate this code from a JScript sample to C# but I don’t know if it’s
good.

Thank U !
 
M

Mishma

SP1 DAVAdapter ??? Can you tell me more about it please because I don't find
anything about that in my web research.

Thank u

Matthew Blain (Serriform) said:
Use the SP1 DAVAdapter, it will make your life much easier!

--Matthew Blain
http://tips.serriform.com/


Mishma said:
Hi there,

I've got a form with repeating section, and I'd like to post one different
form in a WSS for each repeating section. I use managed code to submit each
form, but when I click the send button I've got a security permission error.
Anyone knows where is the problem ???

The code I use to submit each repeating section is :

// Number of repeating section
IXMLDOMNodeList nbIS = thisXDocument.DOM.selectNodes("/my:SA/my:mesIS");

for (int cpt=1; cpt<(nbIS.length); cpt++)
{
string strURL = "http://myurl/myform" + cpt + ".xml";
MSXML2.XMLHTTP oXmlHttp = new MSXML2.XMLHTTP();

oXmlHttp.open("HEAD", strURL, null, null, null);

oXmlHttp.send(thisXDocument.DOM.selectSingleNode("/my:SA/my:mesIS["+ cpt
+"]").xml);

if(oXmlHttp.status == 404)
{
oXmlHttp.open("PUT", strURL, null, null, null);

oXmlHttp.send(thisXDocument.DOM.selectSingleNode("/my:SA/my:mesIS["+ cpt
+"]").xml);

if (oXmlHttp.status == 200 || oXmlHttp.status
== 201)
{
thisXDocument.UI.Alert("GOOD");
}
}
}

I translate this code from a JScript sample to C# but I don't know if it's
good.

Thank U !
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top