LiveCycle PDF presents .NET webservice as XML
I have a LiveCycle designed PDF that I want its submit button to submit XML data in a form to a .NET webservice. I can see how to do this, but I am not quite clear about what the web service is about. What should my signature be in the webservice method to accept XML data?
[WebMethod]
public bool RecieveXML(XmlDocument input)
or
[WebMethod]
public bool RecieveXML(string input)
?
After receiving the XML, I just want to send the XML-XML as an attachment (which I can manage on my own), but is there any way for my bservservice return type to get the PDF to show a success / failure message to the user?
a source to share
You need to return fdf data (with the appropriate set of mime types) that has javascript instructions embedded in it. I have not tried this with webservice, I just used a simple aspx page and used Response.Write
to return data.
The data format should be returned here: Submitting the form to the asp.net server.
As for getting data, this is how I did it (the code is in the page load event):
if (Request.RequestType.ToUpper() == "POST")
{
using (StreamReader rd = new StreamReader(Request.InputStream))
{
string response = string.Empty;
try
{
Process(rd.ReadToEnd());
response = GetFDF(true);
}
catch (Exception)
{
response = GetFDF(false);
}
Response.ContentType = "application/vnd.fdf";
Response.Output.Write(response);
Response.End();
}
}
Since the input is an xml string, you can use XmlSerializer
to deserialize the input on an instance of the class.
a source to share