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
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