The articel looks useful (potentially), but the ES Preview Release doesn't offer any DLL client libraries such as "ICSharpCode.SharpZipLib.dll" mentioned in the article.
So, as an alternative I've tried generating a .NET class library from the WSDL definition at "http://localhost:8080/soap/services/FormsService?wsdl". This seems to generate a class library ok. But now I'm trying to understand what all the arguments are for the renderForm() and renderPDFForm() methods... My method calls seem to be getting SoapExceptions back so it feels as if I'm nearly there if only I could account for all the arguments correctly.
In case anyone else is reading this and is as lost as me, the docs mentioned above would seem to be located
here. Unzip the 'sdkHelp.zip' file and extract it somewhere local - it produces a load of inter-navigable html help docs.
The Creating a .NET assembly topic is a general description of creating a .NET assembly that consumes a services native SOAP stack. As an example - this topic explains how to upload a form to the repository.
However -- all Forms ES operations have examples that show SOAP invocation:
What I'm after, really, is something a bit like the stuff in sdkHelp/programmer/javadoc/com/adobe/livecycle/formsservice/client/Fo rmsServiceClient.html, but for .NET, and much, much more detailed.
In simple terms, what I've got is an XFA form template created in LiveCycle Designer, and some data that I want to import into it. I want to call the FormsService SOAP API to request a PDF document that's made up of my template and the data.
I'm using the Preview Release of Forms Server ES. This doesn't contain any helpful .NET DLLs so I'm having to create my own web service proxy class using the WSDL definition at "http://localhost:8080/soap/services/FormsService?wsdl".
This produces a class that exposes a handful of methods including "renderForm()" and "renderPDFForm". I'm trying to call these but I'm having to guess what the arguments are.
For instance, in the following example, can somebody tell me exactly what ALL these arguments are and what I need to supply to them in order to render the PDF:
public BLOB renderForm(
out BLOB outputXML,
out long pageCount,
out string locale,
out string actualRendering,
out FormsResult renderFormResult)
At the moment, when I call the above method, I'm getting the following error:
NB: in the above example, I am populating SOME of the arguments...as follows:<br /><br />formQuery <--- I'm just supplying the name of my XFA template<br />formPreference <--- I'm supplying FormPreference.PDFForm<br />inDataDoc <--- I'm supplying a BLOB object with it's binaryData field populated with a byte array representing an XML document containing the data I want to import into my XFA template.<br /><br />contentRootURI <--- I'm supplying the absolute path to the location of the XFA template, as named in the formQuery argument.<br /><br />All other arguments are either empty strings ("") or newly instantiated objects of a type to match that of the argument.<br /><br />Here's a code snip:<br /><br />BLOB renderedForm = null;<br />BLOB dataDoc = new BLOB();<br />string xmlData ="<?xml version=\"1.0\" encoding=\"UTF-8\"?><book>Test</book>";<br />byte byteData = System.Text.UTF8Encoding.UTF8.GetBytes(xmlData);<br />dataDoc.binaryData = byteData;<br /><br />BLOB v = new BLOB();<br />long w = 0;<br />string x = string.Empty;<br />string y = string.Empty;<br />FormsResult z = new FormsResult();<br /><br />renderedForm = fss.renderForm(<br /> "ExampleXFAForm_EmbeddedFonts.pdf",<br /> FormPreference.PDFForm,<br /> dataDoc,<br /> new RenderOptionsSpec(),<br /> "",<br /> "",<br /> "",<br /> "C:\\PETE\\LiveCycle ES Server\\dev\\VS.NET\\Projects\\Trial01",<br /> "",<br /> out v,<br /> out w,<br /> out x,<br /> out y,<br /> out z);<br /><br />Where am I going wrong, and what's the meaning of the 'null pointer exception' I've quoted in my previous post?
IN LiveCycle ES - developers have to create their own proxy assemblies.
2nd - what is happening is that the Preview release is using an old code base that does not match up wiht the docs. That is the cause of your problem. LiveCycle ES has new Form operations that require a lot fewer parameters. Here is the method signature that is used to render a PDF form:
This is going from bad to worse.
I've been in touch with an Adobe representative in the UK about the possibility of using LiveCycle ES in our project solution, and he specifically pointed me in the direction of the preview release as something that would enable me to make an assessment of how feasible it would be for us to use the product.
Now you're telling me that the preview release is not only using an obsolete code base, but also that the documentation which certain colleagues of yours have been advising me to read in order to solve the problems I'm having, is in fact for a different, newer API.
How am I supposed to make a reasoned and intelligent assessment of this product within a reasonable timeframe? It seems almost as if I have to purchase the full version of the product first in order to work out whether I want to purchase it or not! I'm at my wits end with this.
Can anyone help me specifically with the preview release issues I've described above, or advise me how to progress this some other way?
Also, never mind the fact the Preview Release is an old code base, there must be a way of getting it to work as it is, surely? Can someone tell me how? It must be possible to pass stuff in those extra parameters, even if they're "deprecated".
I just want to be able to get a PDF populated with data, and incorporate it into a proof of concept. It's not much to ask, surely?
Here is Java code that uses Java proxy classes that were created using AXIS and the Forms service WSDL. ALthough it is not .NET code, it shows how to render a form by invoking the renderPDFForm operation. You should invoke renderPDFForm, not renderForm.
//Specify file attachments to attach to the form
FileInputStream fileAttachment = new FileInputStream("C:\\rideau1.jpg");
BLOB attachment1 = new BLOB();
int len = fileAttachment.available();
byte fileStream = new byte[len] ;
String fileName = "rideau1.jpg";
//Create a HashMap object to store file attachments
HashMap fileAttachments = new HashMap();
//Create a PDFFormRenderSpec object
PDFFormRenderSpec pdfFormRenderSpec = new PDFFormRenderSpec();
//Specify URI values used by the Forms service
URLSpec uriValues = new URLSpec();
//Create class holder objects
BLOBHolder outRenderPDFFormResultDoc = new BLOBHolder();
FormsResultHolder formsResult = new FormsResultHolder();
BLOBHolder blobHolder = new BLOBHolder();
LongHolder longHolder = new LongHolder();
StringHolder stringHolder = new StringHolder();
//Invoke the renderPDFForm method to render
//an interactive PDF form
//Create a BLOB object that contains form data
BLOB formData = formsResult.value.getOutputContent();
This example will be ported to .NET to show the exact .NET syntax.
Well thank you Scott, I have now managed to install/configure the full trial version of LiveCycle ES and have finally got things working on a very basic level, using your sample code as a starting point.
Currently I have successfully rendered my original LiveCycle xfa template document using the above technique, and have also managed to populate some of the fields in it using some xml data.
The thing I need to now work out is how to populate dropdowns (combo box controls) with values on-the-fly, and to then also include pre-selected values for dropdowns in the xml data I pass to renderPDFForm().
Currently my dropdowns are being rendered as empty, and clearly this is because I haven't provided the list values for them. But where do I specify these and how do I include them in the call to renderPDFForm() ?
I've tried your .Net example, as well as writing my own applications, but I am getting this error:
| [com.adobe.idp.um.webservices.WSSecurityHandler] errorCode:12803 errorCodeHEX:0x3203 message:WSSecurityHandler: cannot convert into document. Exception Message -- ; nested exception is: org.xml.sax.SAXParseException: Character reference "" is an invalid XML character.
I've tried multiple form-templates, even those who ships with LCES, but I still get the same error. I am suspecting this to be a config-issue.
Grateful for all help.