<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
    <title>Brad White</title>
    <link rel="alternate" type="text/html" href="http://blogs.4point.com/brad.white/" />
    <link rel="self" type="application/atom+xml" href="http://blogs.4point.com/brad.white/atom.xml" />
    <id>tag:blogs.4point.com,2008-10-17:/brad.white//4</id>
    <updated>2009-03-11T14:45:43Z</updated>
    
    <generator uri="http://www.sixapart.com/movabletype/">Movable Type 4.21-en</generator>

<entry>
    <title>How To Install LiveCycle 8.2.2 with MSSQL 2005</title>
    <link rel="alternate" type="text/html" href="http://blogs.4point.com/brad.white/2009/03/how-to-install-livecycle-822-with-mssql-2005.html" />
    <id>tag:blogs.4point.com,2009:/brad.white//4.69</id>

    <published>2009-03-11T13:31:46Z</published>
    <updated>2009-03-11T14:45:43Z</updated>

    <summary><![CDATA[I thought I would share this article that I had on our internal wiki that was originally created by myself and updated by a colleague of mine. It's proven to be quite useful. &nbsp; This article is designed to aid...]]></summary>
    <author>
        <name>Brad White</name>
        
    </author>
    
        <category term="LiveCycle" scheme="http://www.sixapart.com/ns/types#category" />
    
    
    <content type="html" xml:lang="en" xml:base="http://blogs.4point.com/brad.white/">
        <![CDATA[<p>I thought I would share this article that I had on our internal wiki that was originally created by myself and updated by a colleague of mine. It's proven to be quite useful.</p>
<div>&nbsp;</div>
<div>This article is designed to aid in the manual installation of LiveCycle 8.2.2 with MSSQL 2005. Attached is a zip file with all the files that I reference that should be easily dropped.</div>
<div>&nbsp;</div>
<div>This article was intended to create development environments.</div>
<div>&nbsp;</div>
<div>&nbsp;<a href="http://blogs.4point.com/brad.white/2009/03/11/JBossService_64-bit.zip">JBossService_64-bit.zip</a></div>
<div>
<span class="mt-enclosure mt-enclosure-file" style="DISPLAY: inline"><a href="http://blogs.4point.com/brad.white/2009/03/11/LiveCycle-JBoss-MSSQL%20-Install.zip">LiveCycle-JBoss-MSSQL -Install.zip</a></span></div>
<div><br /></div>]]>
        <![CDATA[<div>
<ol>
<li>Install JVM
<ol>
<li>Install JDK 1.5.0.12.</li>
<li>Create JAVA_HOME environment variable under "My Computer | Properties | Advanced" and point to your JDK installation folder.</li></ol></li>
<li>Install Database
<ol>
<li>Install MSSQL 2005. The only thing you need to install is "Server" and "Client/Workstation" components.</li>
<li>Create a database called "lc_es".</li>
<li>Run the 6 attached scripts (*.sql) in order against the "lc_es" database. These scripts will prepare your database for Configuration Manager. These scripts will create a user called "lc_db_usr" with a password "password". NOTE: some SQL installs don't let you use "password" as a password so you will have to search and replace this password in all the files from step 6 below and the files in this step.</li></ol></li>
<li>Install LiveCycle 8.2.2&nbsp;
<ol>
<li>Unpack the LiveCycle install files to "C:\Installs".</li>
<li>Install LiveCycle 8.2.2 using "Manual". Stop before you run configuration manager (LCM). Let the install hang here.</li></ol></li>
<li>Install JBoss
<ol>
<li>Copy "C:\Installs\Adobe_LC_ES_JBOSS_WIN_8.2\third_party\jboss\" folder to the "C:\Adobe\LiveCycle8.2\" folder.</li>
<li>For JBoss 4.2.0 on 64-bit Windows 2003 copy "C:\Installs\Adobe_LC_ES_JBOSS_WIN_8.2\third_party\jboss_4.2.0" to "C:\Adobe\LiveCycle8.2\" and rename "jboss_4.2.0" to "jboss"</li>
<li>Copy attached "JBossService.exe" to the "C:\Adobe\LiveCycle8.2\jboss\" folder.</li>
<li>For JBoss 4.2.0 on 64-bit Windows 2003 you will need to use the 64-bit version of "JBossService.exe" which is also attached here.</li>
<li>Run "InstallJBossService.bat" to install JBoss as a Windows Service.</li>
<li>For JBoss 4.2.0 on 64-bit Windows 2003 you will need to copy "C:\Installs\Adobe_LC_ES_JBOSS_WIN_8.2\third_party\jboss\InstallJBossService.bat" to the "C:\Adobe\LiveCycle8.2\jboss\" folder.</li>
<li>For JBoss 4.2.0 on 64-bit Windows 2003 you will need to add "-b &lt;your jboss server ip address&gt;" to the parameters in "InstallJBossService.bat" before you run it. Find "-c all" and add it immediately after this. If the IP address changes you will likely have uninstall the Windows Service, change the IP address in "InstallJBossService.bat" and rerun it.</li>
<li>To uninstall change "-install JBoss for Adobe LiveCycle ES" to "-uninstall JBoss for Adobe LiveCycle ES" and remove all the parameters after that.</li></ol></li>
<li>Deploy LiveCycle
<ol>
<li>Run LCM past the step where it configures the LiveCycle components for deployement and then STOP there (at the LiveCycle ES Database Initialization screen).</li>
<li>Copy files from the EAR files from the "C:\Adobe\LiveCycle8.2\configurationManager\export\" folder to the "C:\Adobe\LiveCycle8.2\jboss\server\all\deploy\" folder.</li></ol></li>
<li>Configure JDBC Datasource for LC and JMS
<ol>
<li>Copy attached "sqljdbc.jar" to the "C:\Adobe\LiveCycle8.2\jboss\server\all\lib\" folder.</li>
<li>Copy attached "jbossmq.jar" to the "C:\Adobe\LiveCycle8.2\jboss\server\all\lib\" folder.</li>
<li>For JBoss 4.2.0 on 64-bit Windows 2003 ignore this step.</li>
<li>Copy attached "mssql-ds.xml" and "adobe-ds.xml" to the "C:\Adobe\LiveCycle8.2\jboss\server\all\deploy" folder (replace existing file).</li>
<li>Delete the file "C:\Adobe\LiveCycle8.2\jboss\server\all\deploy\mysql-ds.xml".</li>
<li>Copy "standardjbosscmp-jdbc.xml", "login-config.xml", "standardjaws.xml" to the "C:\Adobe\LiveCycle8.2\jboss\server\all\conf\" folder (replace existing files).</li>
<li>For JBoss 4.2.0 on 64-bit Windows 2003 copy ONLY "standardjbosscmp-jdbc.xml" and "login-config.xml" to the "C:\Adobe\LiveCycle8.2\jboss\server\all\conf\" folder (replace existing files).</li>
<li>Copy "mssql-jdbc2-service.xml" and "mssql-jdbc-state-service.xml" to the "C:\Adobe\LiveCycle8.2\jboss\server\all\deploy-hasingleton\jms\" folder.</li>
<li>For JBoss 4.2.0 on 64-bit Windows 2003 copy "mssql-jdbc2-service.xml" and "mssql-jdbc-state-service.xml" to the "C:\Adobe\LiveCycle8.2\jboss\server\all\ deploy \jms\" folder.</li>
<li>Delete "mysql-jdbc2-service.xml" and "mysql-jdbc-state-service.xml".</li>
<li>Start "JBoss</li></ol></li>
<li>Run Configuration Manager
<ol>
<li>Finish running LCM.</li></ol></li>
<li>That's it...</li></ol></div>
<p>&nbsp;</p>]]>
    </content>
</entry>

<entry>
    <title>Disable or Cancel Printing on Required Fields</title>
    <link rel="alternate" type="text/html" href="http://blogs.4point.com/brad.white/2009/01/disable-or-cancel-printing-on-required-fields.html" />
    <id>tag:blogs.4point.com,2009:/brad.white//4.38</id>

    <published>2009-01-13T16:08:19Z</published>
    <updated>2009-01-13T18:21:51Z</updated>

    <summary>I looked many places to find an example of disabling printing if all required fields were not filled in. Follwing this post: http://forms.stefcameron.com/2008/04/13/prevent-printing-pdf-forms-in-acrobat-8/   and a little tweaking, I created a form that lets you turn on and off required...</summary>
    <author>
        <name>Brad White</name>
        
    </author>
    
        <category term="LiveCycle" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="printing" label="printing" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://blogs.4point.com/brad.white/">
        <![CDATA[<p>I looked many places to find an example of disabling printing if all required fields were not filled in. Follwing this post: </p>
<div class="edit_area" id="3833" title="Double click to edit" jquery1231862443297="4"><a class="snap_shots" href="http://forms.stefcameron.com/2008/04/13/prevent-printing-pdf-forms-in-acrobat-8/" target="_new" rel="nofollow">http://forms.stefcameron.com/2008/04/13/prevent-printing-pdf-forms-in-acrobat-8/</a></div>
<div class="edit_area" title="Double click to edit" jquery1231862443297="4"> </div>
<div class="edit_area" title="Double click to edit" jquery1231862443297="4">and a little tweaking, I created a form that lets you turn on and off required fields and disables printing if required fields are not filled in. It's a very basic example but remember to read the link above for the key ingredient.</div>
<div class="edit_area" title="Double click to edit" jquery1231862443297="4"> </div>
<div class="edit_area" title="Double click to edit" jquery1231862443297="4">The form: 
<span class="mt-enclosure mt-enclosure-file" style="DISPLAY: inline"><a href="http://blogs.4point.com/brad.white/2009/01/13/MandatoryPrinting2.pdf">MandatoryPrinting2.pdf</a></span></div>]]>
        
    </content>
</entry>

<entry>
    <title>How to configure Flex Builder 3 with DataServices</title>
    <link rel="alternate" type="text/html" href="http://blogs.4point.com/brad.white/2009/01/how-to-configure-flex-builder-3-with-dataservices.html" />
    <id>tag:blogs.4point.com,2009:/brad.white//4.29</id>

    <published>2009-01-08T17:11:43Z</published>
    <updated>2009-01-13T18:22:24Z</updated>

    <summary>Getting something running with LiveCycle Data Services proved to be quite troublesome in Flex Builder 2. Then Flex Builder 3 came along and made everything so much better. It&apos;s much easier and following these instructions should move you along nicely....</summary>
    <author>
        <name>Brad White</name>
        
    </author>
    
        <category term="Flex" scheme="http://www.sixapart.com/ns/types#category" />
    
        <category term="LiveCycle" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="dataservices" label="Data Services" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="flex" label="Flex" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="flexbuilder2" label="Flex Builder 2" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="flexbuilder3" label="Flex Builder 3" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="livecycle" label="LiveCycle" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://blogs.4point.com/brad.white/">
        <![CDATA[<p class="MsoNormal" style="MARGIN: 0in 0in 0pt; mso-list: l0 level1 lfo1; tab-stops: list .5in"><span class="Apple-style-span" style="font-size: 16px;">Getting something running with LiveCycle Data Services proved to be quite troublesome in Flex Builder 2. Then Flex Builder 3 came along and made everything so much better. It's much easier and following these instructions should move you along nicely.</span></p>]]>
        <![CDATA[<ol>
<li>File | New | Flex Project</li>
<li>Fill in as per screen shot   <a onclick="window.open('http://blogs.4point.com/brad.white/assets_c/2009/01/BlogFB3_01.html','popup','width=667,height=648,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0'); return false" href="http://blogs.4point.com/brad.white/assets_c/2009/01/BlogFB3_01.html">View image</a></li>
<li>Next  <a onclick="window.open('http://blogs.4point.com/brad.white/assets_c/2009/01/BlogFB3_02.html','popup','width=631,height=633,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0'); return false" href="http://blogs.4point.com/brad.white/assets_c/2009/01/BlogFB3_02.html">View image</a> </li>
<li>Next   <a onclick="window.open('http://blogs.4point.com/brad.white/assets_c/2009/01/BlogFB3_03.html','popup','width=632,height=700,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0'); return false" href="http://blogs.4point.com/brad.white/assets_c/2009/01/BlogFB3_03.html">View image</a></li>
<li>Finish</li>
<li>Create folder "C:\Adobe\LiveCycle8.2\jboss\server\all\deploy\Play.war"</li>
<li>Go to Project Properties and match screen shot  </li>
<ol>
<li>
<span class="mt-enclosure mt-enclosure-image" style="DISPLAY: inline"><a onclick="window.open('http://blogs.4point.com/brad.white/assets_c/2009/01/BlogFB3_04.html','popup','width=810,height=598,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0'); return false" href="http://blogs.4point.com/brad.white/assets_c/2009/01/BlogFB3_04.html">View image</a></span> <o:p><font face="Times New Roman" color="#000000" size="3"> </font></o:p></li>
<li>
<span class="mt-enclosure mt-enclosure-image" style="DISPLAY: inline"><a onclick="window.open('http://blogs.4point.com/brad.white/assets_c/2009/01/BlogFB3_04.html','popup','width=810,height=598,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0'); return false" href="http://blogs.4point.com/brad.white/assets_c/2009/01/BlogFB3_04.html">View image</a></span> </li>
<li>
<span class="mt-enclosure mt-enclosure-image" style="DISPLAY: inline"><a onclick="window.open('http://blogs.4point.com/brad.white/assets_c/2009/01/BlogFB3_06.html','popup','width=810,height=595,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0'); return false" href="http://blogs.4point.com/brad.white/assets_c/2009/01/BlogFB3_06.html">View image</a></span></li></ol>
<li>Click on "Deploy Flex War". If prompted, point to LCDS.war.</li>
<li>OK</li>
<li>Do your coding.</li>
<li>Project Clean</li>
<li>Copy contents of  "C:\FB3 Workspaces\Play\WebContent" to "C:\Adobe\LiveCycle8.2\jboss\server\all\deploy\Play.war".</li>
<li>Stop JBoss</li>
<li>Delete tmp folder</li>
<li>Start JBoss</li>
<li>Run application.</li></ol>]]>
    </content>
</entry>

<entry>
    <title>Merge Data with a Template Using LC Output within a Process</title>
    <link rel="alternate" type="text/html" href="http://blogs.4point.com/brad.white/2009/01/merge-data-with-a-template-using-lc-output-within-a-process.html" />
    <id>tag:blogs.4point.com,2009:/brad.white//4.27</id>

    <published>2009-01-06T21:20:47Z</published>
    <updated>2009-03-11T13:24:04Z</updated>

    <summary>The following post walks you through creating a LiveCycle process within Workbench that generates a PDF document using LiveCycle Output 8.2. First a request is received via SOAP, then we look up configuration parameters in a properties file, then we...</summary>
    <author>
        <name>Brad White</name>
        
    </author>
    
        <category term="LiveCycle" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="livecycle" label="LiveCycle" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="livecycleoutput" label="LiveCycle Output" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="livecycleworkbench" label="LiveCycle Workbench" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="pdf" label="PDF" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="soap" label="SOAP" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="xdptemplate" label="XDP Template" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://blogs.4point.com/brad.white/">
        <![CDATA[<p>The following post walks you through creating a LiveCycle process within Workbench that generates a PDF document using LiveCycle Output 8.2. First a request is received via SOAP, then we look up configuration parameters in a properties file, then we retrieve records and data from a database, then we merge this data with a form template, and finally we write the file out to disk. <font face="Times New Roman" color="#000000" size="3"> </font></p>]]>
        <![CDATA[<p>Prerequisites:<br />- A database and tables to query with a valid datasource (named DEMO_DS below).<br />- LC Turnkey Install 8.2<br />- LC Workbench<br />- An XDP template to merge with the data.</p>
<p>Overview<br />Here is a screen shot of what the whole process looks like:  <a onclick="window.open('http://blogs.4point.com/brad.white/assets_c/2009/01/Blog_01.html','popup','width=777,height=210,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0'); return false" href="http://blogs.4point.com/brad.white/assets_c/2009/01/Blog_01.html">View image</a></p>
<p>The name and location of the XDP template and the data to merge is kept in the database so I can use this as an example of pulling from a database. When the process starts, the user will have to enter a formId and a customerId. The formId is used to look up the form name and location form a table and the customerId is used to look up the customer specific data from the database.</p>
<p>Here are two screen shots of my basic tables that you will have to copy unless you want to hard code a bunch of things.</p>
<p>
</p><span class="mt-enclosure mt-enclosure-image" style="DISPLAY: inline"><a onclick="window.open('http://blogs.4point.com/brad.white/assets_c/2009/01/Blog_022.html','popup','width=455,height=220,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0'); return false" href="http://blogs.4point.com/brad.white/assets_c/2009/01/Blog_022.html">View image</a></span><p></p>
<p>
</p><span class="mt-enclosure mt-enclosure-image" style="DISPLAY: inline"><a onclick="window.open('http://blogs.4point.com/brad.white/assets_c/2009/01/Blog_032.html','popup','width=871,height=214,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0'); return false" href="http://blogs.4point.com/brad.white/assets_c/2009/01/Blog_032.html">View image</a></span><p></p>
<p> </p>
<p>Steps</p>
<ol>
<li>Create the following global variables:</li>
<ol>
<li>customerData as xml</li>
<li>customerId as String (Input &amp; Required)</li>
<li>formId as String (Input &amp; Required)</li>
<li>formLocation as String</li>
<li>formName as String</li>
<li>pdfOutput as Document<br /><br />
<span class="mt-enclosure mt-enclosure-image" style="DISPLAY: inline"><a onclick="window.open('http://blogs.4point.com/brad.white/assets_c/2009/01/Blog_041.html','popup','width=527,height=212,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0'); return false" href="http://blogs.4point.com/brad.white/assets_c/2009/01/Blog_041.html">View image</a></span></li></ol>
<li>
<span class="mt-enclosure mt-enclosure-image" style="DISPLAY: inline"></span>We need to extract the form name a location from the database. This next step is what you need to do to extract a single result from a database.</li>
<ol>
<li>Insert the component "Foundation | JDBC | Query Single Row" as your start component.</li>
<li>Under "Input | Datasource Name" enter a "literal value" of your datasource name. I called mine "java:DEMO_DS". </li>
<li>Under "SQL Statement", click on the "..." button and enter a query that will extract the form location. Mine happens to be "SELECT formLocation, formName FROM demo.tblforms WHERE formId = ?". </li>
<li>Check the box, "Use Parameterized Query". </li>
<li>Enter the variable that you want to substitute for the question mark, which in my example is formId.<br /><br />  
<span class="mt-enclosure mt-enclosure-image" style="DISPLAY: inline"><a onclick="window.open('http://blogs.4point.com/brad.white/assets_c/2009/01/Blog_05.html','popup','width=501,height=599,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0'); return false" href="http://blogs.4point.com/brad.white/assets_c/2009/01/Blog_05.html">View image</a></span><br /></li>
<li>Click "OK". </li>
<li>Under "Data Mapping" click on the "..." button to map the results to useable variables.</li>
<li>Since our query stated that we want "formLocation" and "formName" we need to map the result to variables. Map "formLocation" to your "formLocation" global variable and do the same for formName (as per screen shot).<br /><br />
<span class="mt-enclosure mt-enclosure-image" style="DISPLAY: inline"><a onclick="window.open('http://blogs.4point.com/brad.white/assets_c/2009/01/Blog_062.html','popup','width=399,height=218,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0'); return false" href="http://blogs.4point.com/brad.white/assets_c/2009/01/Blog_062.html">View image</a><br /></span></li>
<li>Click "OK" and now you have the XDP name and location from a table. You could hard code the name and value if need be.</li></ol>
<li>Now you need to extract the customer data that will be merged with the XDP template form.</li>
<ol>
<li>Insert the component "Foundation | JDBC | Query for Multiple Rows as XML" and attach to the last component.</li>
<li>Under "Input | Datasource Name" enter a "literal value" of your datasource name. I called mine "java:DEMO_DS". </li>
<li>Under "SQL Statement", click on the "..." button and enter a query that will extract the customer data. Mine happens to be "SELECT * FROM demo.tblcustomerdata WHERE customerId = ?</li>
<li>Check the box, "Use Parameterized Query". </li>
<li>Enter the variable that you want to substitute for the question mark, which in my example is customerId.<br /><br />  
<span class="mt-enclosure mt-enclosure-image" style="DISPLAY: inline"><a onclick="window.open('http://blogs.4point.com/brad.white/assets_c/2009/01/Blog_07.html','popup','width=511,height=598,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0'); return false" href="http://blogs.4point.com/brad.white/assets_c/2009/01/Blog_07.html">View image</a></span><br /></li>
<li>Finish by clicking "OK" and now you have a query that will obtain the XDP name and location from a table. You could hard code the name and value if need be. </li>
<li>Under "XML information" click on the "..." button to map the results to an xml structure.</li>
<li>The next dialog is a module used for creating XML from your query. The XML that you define here should match the schema that you created in the XDP form. This module can only create very basic and flat XML structure. Follow my screenshot below to create your basic XML structure that will be merged to the template.<br /><br /><a onclick="window.open('http://blogs.4point.com/brad.white/assets_c/2009/01/Blog_08.html','popup','width=350,height=425,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0'); return false" href="http://blogs.4point.com/brad.white/assets_c/2009/01/Blog_08.html">View image</a><br /><br />What you will end up with is an XML document with a root node called "main", a repeating node called "customer" and 9 customer related fields in the repeating node that is bound to the XDP template once we merge.</li>
<li>Click "OK" to close the "XML Document Info Editor" dialog.</li>
<li>Under "Output | XML document" select the XML "variable" that you created called "customerData". </li>
<li>Now you have all the data from the customer that we will merge into the form. </li></ol>
<li>Next I added a default logger just to verify all my information.</li>
<ol>
<li>Add the "Foundation | Variable Logger | log" component and attach it to the last component.</li></ol>
<li>Next we need to create the PDF with the "Output" component that is only available if you installed "Output" with LiveCycle. </li>
<ol>
<li>Drop the "Output | Output | generatePDFOutput" component and attach it to the last component. </li>
<li>Under "Input | Tranformation Format" select a "literal value" of PDF.</li>
<li>Under "Form" select the "variable" that you filled earlier called "formName". </li>
<li>In the "Context Root" select the "variable" that you filled earlier called "formLocation".</li></ol>
<li>In the "Input Data" select the "variable" that you filled earlier called "customerData". <br /><br />
<span class="mt-enclosure mt-enclosure-image" style="DISPLAY: inline"><a onclick="window.open('http://blogs.4point.com/brad.white/assets_c/2009/01/Blog_09.html','popup','width=319,height=771,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0'); return false" href="http://blogs.4point.com/brad.white/assets_c/2009/01/Blog_09.html">View image</a></span><br /></li>
<ol>
<li>In the "Output | PDF Output" section select the "variable" called "pdfOutput". This will put the resulting PDF into this variable. </li></ol>
<li>Now you have everything you need in memory but you need to see the resulting PDF so we'll save it to disk so we can view it. </li>
<ol>
<li>Drop the component "Foundation | File Utilities | Write Document" and attach it to the last component. </li>
<li>Under "Input | Pathname Pattern" enter a "literal value" of the file location where you want to save the PDF. In my case I used "C:\\BlogDemo\\HeyThere.pdf".</li>
<li>Under "Document" select the "variable" that you want to save to disk, "pdfOutput".</li></ol>
<li>Select "Make Unique" so that you don't overwrite anything and you can see your results every time the process is run. It will create a new file every time.<br /><br />
<span class="mt-enclosure mt-enclosure-image" style="DISPLAY: inline"><a onclick="window.open('http://blogs.4point.com/brad.white/assets_c/2009/01/Blog_102.html','popup','width=422,height=472,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0'); return false" href="http://blogs.4point.com/brad.white/assets_c/2009/01/Blog_102.html">View image</a><br /></span></li>
<li>
<span class="mt-enclosure mt-enclosure-image" style="DISPLAY: inline"> </span>You're done! Run the process by right clicking on the process map (after you Activate it) and enter the two input parameters that correspond to the values that you're looking up in the database. In my example I would do:<br /><br />
<span class="mt-enclosure mt-enclosure-image" style="DISPLAY: inline"><a onclick="window.open('http://blogs.4point.com/brad.white/assets_c/2009/01/Blog_112.html','popup','width=442,height=306,scrollbars=no,resizable=no,toolbar=no,directories=no,location=no,menubar=no,status=no,left=0,top=0'); return false" href="http://blogs.4point.com/brad.white/assets_c/2009/01/Blog_112.html">View image</a><br /></span></li>
<li>And then I would have a PDF in my folder "C:\BlogDemo\HeyThere.pdf".</li></ol><div>-------------------</div><div><span class="mt-enclosure mt-enclosure-file" style="display: inline;"><a href="http://blogs.4point.com/brad.white/2009/03/11/SimpleSample.xdp">SimpleSample.xdp</a></span></div><div><br /></div>]]>
    </content>
</entry>

<entry>
    <title>4 Ways to Invoke a WebService in Flex with MXML and ActionScript</title>
    <link rel="alternate" type="text/html" href="http://blogs.4point.com/brad.white/2008/12/4-ways-to-invoke-a-webservice-in-flex-with-mxml-and-actionscript.html" />
    <id>tag:blogs.4point.com,2008:/brad.white//4.21</id>

    <published>2008-12-11T20:41:16Z</published>
    <updated>2009-01-13T18:24:08Z</updated>

    <summary>I had a recent need to call a webservice to receive some display data. I thought the task was quite easy and in reality it is but trying to Google webservice and Flex brings you back more information than you want. I&apos;ve...</summary>
    <author>
        <name>Brad White</name>
        
    </author>
    
        <category term="Flex" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="actionscript" label="ActionScript" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="flex" label="Flex" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="mxml" label="MXML" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="webservice" label="Webservice" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://blogs.4point.com/brad.white/">
        <![CDATA[<p><span style="FONT-SIZE: 8pt; COLOR: #333333; FONT-FAMILY: Arial">I had a recent need to call a webservice to receive some display data. I thought the task was quite easy and in reality it is but trying to Google webservice and Flex brings you back more information than you want. I've attached an example of 4 ways to call a webservice in Flex.</span></p>]]>
        <![CDATA[<p><span style="FONT-SIZE: 8pt; COLOR: #333333; FONT-FAMILY: Arial">Here is the file: </span><span style="FONT-SIZE: 8pt; COLOR: #333333; FONT-FAMILY: Arial">
<span class="mt-enclosure mt-enclosure-file" style="DISPLAY: inline"><a href="http://blogs.4point.com/brad.white/2008/12/11/TestWebService.mxml">TestWebService.mxml</a></span>.<o:p></o:p></span></p>
<p><u><span style="FONT-SIZE: 8pt; COLOR: #333333; FONT-FAMILY: Arial">Solution #1) Webservice via MXML</span></u><span style="FONT-SIZE: 8pt; COLOR: #333333; FONT-FAMILY: Arial"><o:p></o:p></span></p>
<p><span style="FONT-SIZE: 8pt; COLOR: #333333; FONT-FAMILY: Arial">My first solution was really easy; I found out how to call a webservice using MXML and I had a test web service running in no time. <o:p></o:p></span></p>
<p><span style="FONT-SIZE: 8pt; COLOR: #333333; FONT-FAMILY: 'Courier New'">&lt;mx:WebService id="wsMXML" wsdl="http://www.flash-mx.com/ws/months.cfc?wsdl"><br /><span style="mso-spacerun: yes">     </span>&lt;mx:operation name="getMonths" resultFormat="object" result="result1(event);" fault="fault(event);" /><br />&lt;/mx:WebService><o:p></o:p></span></p>
<p><span style="FONT-SIZE: 8pt; COLOR: #333333; FONT-FAMILY: Arial">Then call "</span><span style="FONT-SIZE: 8pt; COLOR: #333333; FONT-FAMILY: 'Courier New'">wsMXML.getMonths.send();"</span><span style="FONT-SIZE: 8pt; COLOR: #333333; FONT-FAMILY: Arial"><o:p></o:p></span></p>
<p><span style="FONT-SIZE: 8pt; COLOR: #333333; FONT-FAMILY: Arial">And your result handler is:<o:p></o:p></span></p>
<p><span style="FONT-SIZE: 8pt; COLOR: #333333; FONT-FAMILY: 'Courier New'">var myObj:ArrayCollection = evt.result as ArrayCollection<br />textArea1.text = myObj[4].toString();<o:p></o:p></span></p>
<p><span style="FONT-SIZE: 8pt; COLOR: #333333; FONT-FAMILY: Arial">Problem was I found out I needed to do it in ActionScript. Hence solution #2.<o:p></o:p></span></p>
<p><u><span style="FONT-SIZE: 8pt; COLOR: #333333; FONT-FAMILY: Arial">Solution #2) Webservice via ActionScript</span></u><span style="FONT-SIZE: 8pt; COLOR: #333333; FONT-FAMILY: Arial"><o:p></o:p></span></p>
<p><span style="FONT-SIZE: 8pt; COLOR: #333333; FONT-FAMILY: Arial">My next solution took me a little longer to figure out. I tried importing the WSDL via the Import Web Service feature in Flex Builder. Here's how:<o:p></o:p></span></p>
<p><span style="FONT-SIZE: 8pt; COLOR: #333333; FONT-FAMILY: Arial">- Click on: "Data | Import Web Service"<br />- Select the folder where the flex source code resides.<br />- Type in the name of the URL of the WSDL<br />- Click "Finish" or configure the call a little more on the next screen and then select "Finish".<o:p></o:p></span></p>
<p><span style="FONT-SIZE: 8pt; COLOR: #333333; FONT-FAMILY: Arial">This creates proxy classes for your webservice, so now you can call them just like your ActionScript classes. I used this WSDL <a href="http://ws.cdyne.com/emailverify/Emailvernotestemail.asmx?wsdl"><font color="#800080">http://ws.cdyne.com/emailverify/Emailvernotestemail.asmx?wsdl</font></a> and then had to use this code:<o:p></o:p></span></p>
<p><span style="FONT-SIZE: 8pt; COLOR: #333333; FONT-FAMILY: 'Courier New'">var myWS:EmailVerNoTestEmail = new EmailVerNoTestEmail();<br />myWS.addverifyEmailEventListener(result3);<br />myWS.verifyEmail("sjobs@apple.com", null);<o:p></o:p></span></p>
<p><span style="FONT-SIZE: 8pt; COLOR: #333333; FONT-FAMILY: Arial">With this result handler:<o:p></o:p></span></p>
<p><span style="FONT-SIZE: 8pt; COLOR: #333333; FONT-FAMILY: 'Courier New'">var myObj:Object = evt.result;<br />textArea3.text = myObj.GoodEmail.toString();<o:p></o:p></span></p>
<p><span style="FONT-SIZE: 8pt; COLOR: #333333; FONT-FAMILY: Arial">Pretty neat... but then I found out that my WSDL was behind a firewall that was not accessible from any external systems. I had to come up with a new solution to load the webservice at runtime. Hence solution #3.<o:p></o:p></span></p>
<p><u><span style="FONT-SIZE: 8pt; COLOR: #333333; FONT-FAMILY: Arial">Solution #3) Webservice via ActionScript with a parameter<o:p></o:p></span></u></p>
<p><span style="FONT-SIZE: 8pt; COLOR: #333333; FONT-FAMILY: Arial">Same as one above but it sends a parameter.<o:p></o:p></span></p>
<p><u><span style="FONT-SIZE: 8pt; COLOR: #333333; FONT-FAMILY: Arial">Solution #4) Webservice at Runtime via ActionScript</span></u><span style="FONT-SIZE: 8pt; COLOR: #333333; FONT-FAMILY: Arial"><o:p></o:p></span></p>
<p><span style="FONT-SIZE: 8pt; COLOR: #333333; FONT-FAMILY: Arial">My last solution worked (assuming you set up the cross-domain.xml correctly) the best for my situation. <o:p></o:p></span></p>
<p><span style="FONT-SIZE: 8pt; COLOR: #333333; FONT-FAMILY: 'Courier New'">var loginWS:WebService = new WebService();<br />loginWS.useProxy = false; <br />loginWS.VerifyEmail.addEventListener("result", result4); <br />loginWS.LoginOperation.resultFormat = 'e4x'; <br />loginWS.addEventListener("fault", fault); <br />loginWS.loadWSDL('http://ws.cdyne.com/emailverify/Emailvernotestemail.asmx?wsdl'); loginWS.VerifyEmail("sjobs@apple.com", "?");<o:p></o:p></span></p>
<p><span style="FONT-SIZE: 8pt; COLOR: #333333; FONT-FAMILY: Arial">With this result handler:<o:p></o:p></span></p>
<p><span style="FONT-SIZE: 8pt; COLOR: #333333; FONT-FAMILY: 'Courier New'">var myObj:Object = evt.result as Object;<br />textArea4.text = myObj.ResponseText.toString();<o:p></o:p></span></p>
<p><span style="FONT-SIZE: 8pt; COLOR: #333333; FONT-FAMILY: Arial"><o:p> </o:p></span></p>]]>
    </content>
</entry>

</feed>
