Help in Submitting Forms

J

Jei San

In my submit button, first I tried invoking the
webservice directly from the button action. But I
couldn't see the return status. It would always say
successful.

I using Jscript (though I really dunno how) using the
ready script I have to invoke webservices. But it just
doesn't seem to connect to the webservice.

Here's the code for my webservice:

[WebMethod]
public string SubmitForecast( string brand, int month,
string fiscalyr)
{
return "ok"; // previously there were more codes but
} // at this point I just want to connect.

And here's my code for the Jscript invoking the webservice

function XDocument::OnSubmitRequest(eventObj)
{
var submitAdapter = XDocument.DataAdapters
("SubmitForm"); // SubmitForm is the name of the data
//connection isn't it??
submitAdapter.Submit();
var submitDom =
submitAdapter.OutputLocation.ownerDocument;
submitDom.setProperty
("SelectionNamespaces","xmlns:s0='http://tempuri.org'");
var jNode = submitDom.selectSingleNode
("//s0:SubmitForecastResult");

if (jNode != null)
{
// var responseMessage = submitDom.selectSingleNode
("//SubmitForecastResult").text;
var responseMessage = jNode.text;
var responseMsg = jNode.xml;
XDocument.UI.Alert(responseMessage+ ":\n\t" +
responseMsg);
eventObj.ReturnStatus = true;
}
else
{
XDocument.UI.Alert("There was no response from
the Web Service where the form was submitted to.");
eventObj.ReturnStatus=false;
}

}

The result is, I would always get the pop-up that
"There was no response from the Web Service where the
form was submitted to."

But at this point, I am just expecting the popup "OK".
But there's none. Can anyone see where I got it wrong?

I'm just new at InfoPath and all, dunno this might prove
to be very basic.

Jei San
 
M

Matthew Blain \(Serriform\)

What is the type of your data connection (how did you create it)? How did
you (or did you) set the OutputLocation?
Have you looked at the XML of the OutputLocation? What does it look like?
How about GetDOM("youradapter").xml?

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

Guest

The connection is a webservice. I just used the code
based on Lab8 of the Training Manual for InfoPath via
web. I know it worked before during training. But I'm
using it now in my own machine. It doesn't work anymore.

Err...How do I view the OutputLocation? The only output i
saw was that of testing the webservice through IE. upon
compilation of the webservice in VS.NET.

I'll try to display GetDom("SubmitForm").xml...is this
correct?

-----Original Message-----
What is the type of your data connection (how did you create it)? How did
you (or did you) set the OutputLocation?
Have you looked at the XML of the OutputLocation? What does it look like?
How about GetDOM("youradapter").xml?

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

Jei San said:
In my submit button, first I tried invoking the
webservice directly from the button action. But I
couldn't see the return status. It would always say
successful.

I using Jscript (though I really dunno how) using the
ready script I have to invoke webservices. But it just
doesn't seem to connect to the webservice.

Here's the code for my webservice:

[WebMethod]
public string SubmitForecast( string brand, int month,
string fiscalyr)
{
return "ok"; // previously there were more codes but
} // at this point I just want to connect.

And here's my code for the Jscript invoking the webservice

function XDocument::OnSubmitRequest(eventObj)
{
var submitAdapter = XDocument.DataAdapters
("SubmitForm"); // SubmitForm is the name of the data
//connection isn't it??
submitAdapter.Submit();
var submitDom =
submitAdapter.OutputLocation.ownerDocument;
submitDom.setProperty
("SelectionNamespaces","xmlns:s0='http://tempuri.org'");
var jNode = submitDom.selectSingleNode
("//s0:SubmitForecastResult");

if (jNode != null)
{
// var responseMessage = submitDom.selectSingleNode
("//SubmitForecastResult").text;
var responseMessage = jNode.text;
var responseMsg = jNode.xml;
XDocument.UI.Alert(responseMessage+ ":\n\t" +
responseMsg);
eventObj.ReturnStatus = true;
}
else
{
XDocument.UI.Alert("There was no response from
the Web Service where the form was submitted to.");
eventObj.ReturnStatus=false;
}

}

The result is, I would always get the pop-up that
"There was no response from the Web Service where the
form was submitted to."

But at this point, I am just expecting the popup "OK".
But there's none. Can anyone see where I got it wrong?

I'm just new at InfoPath and all, dunno this might prove
to be very basic.

Jei San


.
 
J

Jei San

The connection is a webservice. I just used the code
based on Lab8 of the Training Manual for InfoPath via
web. I know it worked before during training. But I'm
using it now in my own machine. It doesn't work anymore.

Err...How do I view the OutputLocation? The only output i
saw was that of testing the webservice through IE. upon
compilation of the webservice in VS.NET.

I'll try to display GetDom("SubmitForm").xml...is this
correct?

-----Original Message-----
What is the type of your data connection (how did you create it)? How did
you (or did you) set the OutputLocation?
Have you looked at the XML of the OutputLocation? What does it look like?
How about GetDOM("youradapter").xml?

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

Jei San said:
In my submit button, first I tried invoking the
webservice directly from the button action. But I
couldn't see the return status. It would always say
successful.

I using Jscript (though I really dunno how) using the
ready script I have to invoke webservices. But it just
doesn't seem to connect to the webservice.

Here's the code for my webservice:

[WebMethod]
public string SubmitForecast( string brand, int month,
string fiscalyr)
{
return "ok"; // previously there were more codes but
} // at this point I just want to connect.

And here's my code for the Jscript invoking the webservice

function XDocument::OnSubmitRequest(eventObj)
{
var submitAdapter = XDocument.DataAdapters
("SubmitForm"); // SubmitForm is the name of the data
//connection isn't it??
submitAdapter.Submit();
var submitDom =
submitAdapter.OutputLocation.ownerDocument;
submitDom.setProperty
("SelectionNamespaces","xmlns:s0='http://tempuri.org'");
var jNode = submitDom.selectSingleNode
("//s0:SubmitForecastResult");

if (jNode != null)
{
// var responseMessage = submitDom.selectSingleNode
("//SubmitForecastResult").text;
var responseMessage = jNode.text;
var responseMsg = jNode.xml;
XDocument.UI.Alert(responseMessage+ ":\n\t" +
responseMsg);
eventObj.ReturnStatus = true;
}
else
{
XDocument.UI.Alert("There was no response from
the Web Service where the form was submitted to.");
eventObj.ReturnStatus=false;
}

}

The result is, I would always get the pop-up that
"There was no response from the Web Service where the
form was submitted to."

But at this point, I am just expecting the popup "OK".
But there's none. Can anyone see where I got it wrong?

I'm just new at InfoPath and all, dunno this might prove
to be very basic.

Jei San


.
 
M

Matthew Blain \(Serriform\)

Any luck using GetDOM? Or looking at submitDom.xml?


Jei San said:
The connection is a webservice. I just used the code
based on Lab8 of the Training Manual for InfoPath via
web. I know it worked before during training. But I'm
using it now in my own machine. It doesn't work anymore.

Err...How do I view the OutputLocation? The only output i
saw was that of testing the webservice through IE. upon
compilation of the webservice in VS.NET.

I'll try to display GetDom("SubmitForm").xml...is this
correct?

-----Original Message-----
What is the type of your data connection (how did you create it)? How did
you (or did you) set the OutputLocation?
Have you looked at the XML of the OutputLocation? What does it look like?
How about GetDOM("youradapter").xml?

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

Jei San said:
In my submit button, first I tried invoking the
webservice directly from the button action. But I
couldn't see the return status. It would always say
successful.

I using Jscript (though I really dunno how) using the
ready script I have to invoke webservices. But it just
doesn't seem to connect to the webservice.

Here's the code for my webservice:

[WebMethod]
public string SubmitForecast( string brand, int month,
string fiscalyr)
{
return "ok"; // previously there were more codes but
} // at this point I just want to connect.

And here's my code for the Jscript invoking the webservice

function XDocument::OnSubmitRequest(eventObj)
{
var submitAdapter = XDocument.DataAdapters
("SubmitForm"); // SubmitForm is the name of the data
//connection isn't it??
submitAdapter.Submit();
var submitDom =
submitAdapter.OutputLocation.ownerDocument;
submitDom.setProperty
("SelectionNamespaces","xmlns:s0='http://tempuri.org'");
var jNode = submitDom.selectSingleNode
("//s0:SubmitForecastResult");

if (jNode != null)
{
// var responseMessage = submitDom.selectSingleNode
("//SubmitForecastResult").text;
var responseMessage = jNode.text;
var responseMsg = jNode.xml;
XDocument.UI.Alert(responseMessage+ ":\n\t" +
responseMsg);
eventObj.ReturnStatus = true;
}
else
{
XDocument.UI.Alert("There was no response from
the Web Service where the form was submitted to.");
eventObj.ReturnStatus=false;
}

}

The result is, I would always get the pop-up that
"There was no response from the Web Service where the
form was submitted to."

But at this point, I am just expecting the popup "OK".
But there's none. Can anyone see where I got it wrong?

I'm just new at InfoPath and all, dunno this might prove
to be very basic.

Jei San


.
 
Top