HI Pete,
I ported the Java web service code example to .NET code. This .NET example works and renders a form.
However - when you create your .NET assembly - be sure to change the URL in your proxy class from
http://localhost:8080/soap/services/FormsServiceto
http://localhost:8080/soap/services/FormsService?blob=base64This ensures that binary data is returned with the BLOB instance.
Good luck and here is the .NET example (call renderPDFForm):
try
{
FormsServiceService forms = new FormsServiceService ();
forms.Credentials = new System.Net.NetworkCredential("administrator", "password");
//Create a PDFFormRenderSpec object
PDFFormRenderSpec pdfFormRenderSpec = new PDFFormRenderSpec();
pdfFormRenderSpec.cacheEnabled = new Boolean();
pdfFormRenderSpec.locale="en_US";
pdfFormRenderSpec.acrobatVersion = AcrobatVersion.auto;
//Specify URLSpec values
URLSpec uriValues = new URLSpec();
uriValues.applicationWebRoot = "";
uriValues.contentRootURI = "C:\\Adobe";
uriValues.targetURL = "";
//Create class holder objects
FormsResult formsResult = new FormsResult();
System.Int64 numPage = 0;
string locale = "";
//Invoke the renderPDFForm method to render
//a PDF form
forms.renderPDFForm(
"Loan.xdp",
null,
pdfFormRenderSpec,
uriValues,
null,
out numPage,
out locale,
out formsResult);
//Create a BLOB object that contains form data
byte[] formData = formsResult.outputContent.binaryData;
//Write the Form to a file
string FILE_NAME = "C:\\Adobe\\RenderedForm.pdf" ;
FileStream fs2 = new FileStream(FILE_NAME, FileMode.OpenOrCreate);
//Create a BinaryWriter object
BinaryWriter w = new BinaryWriter(fs2);
w.Write(formData);
w.Close();
fs2.Close();
}
catch (Exception ee)
{
Console.WriteLine("An unexpected exception was encountered: " + ee.Message + "\n" + ee.StackTrace);
}