<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://www.infopathdev.com:443/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Data Connections</title><link>https://www.infopathdev.com:443/forums/44.aspx</link><description> </description><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Form Approval Data Connection</title><link>https://www.infopathdev.com:443/forums/thread/72839.aspx</link><pubDate>Mon, 12 Dec 2011 15:16:48 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:72839</guid><dc:creator>chasquad</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/72839.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=44&amp;PostID=72839</wfw:commentRss><description>&lt;p&gt;Overview:&lt;/p&gt;&lt;p&gt;We use CA Service Desk for our ticketing system.&amp;nbsp; I&amp;#39;m developing an InfoPath form to collect information from the requestor and then to obtain approval before a ticket would be created in our CA Service Desk system.&lt;/p&gt;&lt;p&gt;The CA Service Desk system provides a Web Service so that you can automate the creation of tickets in this system.&lt;/p&gt;&lt;p&gt;The Goal:&lt;/p&gt;&lt;p&gt;When the Approve button is clicked in the InfoPath form, a ticket is created in the CA Service Desk system automatically via the Web Service.&lt;/p&gt;&lt;p&gt;So far, I have figured out how to create a submit data connection in the InfoPath form to the CA Service Desk Web Service.&amp;nbsp; But I cannot figure out how to set the variables in the connection.&amp;nbsp; I found the following information which describes how to do this if we were writing a VB application:&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;Step1: Create a web reference in the front &lt;strong&gt;end&lt;/strong&gt;. &lt;/p&gt;&lt;ol&gt;&lt;li&gt;Start the front end.&lt;/li&gt;&lt;li&gt;Go to Website menu and click “Add web reference”.&lt;/li&gt;&lt;li&gt;In the URL box provide the web service URL and click go. http://&amp;lt;hostname&amp;gt;:8080/axis/services/USD_R11_WebService?wsdl&amp;#39;&amp;#39;&amp;#39;&lt;/li&gt;&lt;li&gt;We can find the methods being pulled out.&lt;/li&gt;&lt;li&gt;Add the webreference with the name “WebReference”.&lt;/li&gt;&lt;/ol&gt;&lt;a name="Step_2:_Create_an_Object_of_the_web_reference"&gt;&lt;/a&gt;&lt;h3&gt; &lt;span class="mw-headline"&gt; Step 2: Create an Object of the web reference &lt;/span&gt;&lt;/h3&gt;&lt;div style="text-align:left;"&gt;&lt;pre class="source-javascript"&gt;Dim ws &lt;span class="kw1"&gt;&lt;strong&gt;&lt;font color="#000066"&gt;As&lt;/font&gt;&lt;/strong&gt;&lt;/span&gt; &lt;span class="kw2"&gt;&lt;strong&gt;&lt;font color="#003366"&gt;New&lt;/font&gt;&lt;/strong&gt;&lt;/span&gt; WebReference.&lt;span class="me1"&gt;&lt;font color="#006600"&gt;USD_WebService&lt;/font&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;a name="Step_3:_Specify_the_Correct_web_service_URL"&gt;&lt;/a&gt;&lt;h3&gt; &lt;span class="mw-headline"&gt; Step 3: Specify the Correct web service URL &lt;/span&gt;&lt;/h3&gt;&lt;div style="text-align:left;"&gt;&lt;pre class="source-text"&gt;ws.Url = &amp;quot;http://&amp;lt;hostname&amp;gt;:8080/axis/services/USD_R11_WebService?wsdl&amp;quot;&lt;/pre&gt;&lt;/div&gt;&lt;a name="Step_4:_Provide_the_username_and_password_to_get_the_sid_value"&gt;&lt;/a&gt;&lt;h3&gt; &lt;span class="mw-headline"&gt; Step 4: Provide the username and password to get the sid value &lt;/span&gt;&lt;/h3&gt;&lt;div style="text-align:left;"&gt;&lt;pre class="source-javascript"&gt;Dim username, password &lt;span class="kw1"&gt;&lt;strong&gt;&lt;font color="#000066"&gt;As&lt;/font&gt;&lt;/strong&gt;&lt;/span&gt; String
Dim sid &lt;span class="kw1"&gt;&lt;strong&gt;&lt;font color="#000066"&gt;As&lt;/font&gt;&lt;/strong&gt;&lt;/span&gt; Integer
username = &lt;span class="st0"&gt;&lt;font color="#3366cc"&gt;&amp;quot;analyst1&amp;quot;&lt;/font&gt;&lt;/span&gt;
password = &lt;span class="st0"&gt;&lt;font color="#3366cc"&gt;&amp;quot;123&amp;quot;&lt;/font&gt;&lt;/span&gt;
sid = ws.&lt;span class="me1"&gt;&lt;font color="#006600"&gt;login&lt;/font&gt;&lt;/span&gt;&lt;span class="br0"&gt;&lt;font color="#66cc66"&gt;(&lt;/font&gt;&lt;/span&gt;username, password&lt;span class="br0"&gt;&lt;font color="#66cc66"&gt;)&lt;/font&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;where login is the method used to get the sid.&lt;/p&gt;&lt;a name="Step_5:_Get_the_User_Handle"&gt;&lt;/a&gt;&lt;h3&gt; &lt;span class="mw-headline"&gt; Step 5: Get the User Handle &lt;/span&gt;&lt;/h3&gt;&lt;div style="text-align:left;"&gt;&lt;pre class="source-javascript"&gt;Dim userhandle &lt;span class="kw1"&gt;&lt;strong&gt;&lt;font color="#000066"&gt;As&lt;/font&gt;&lt;/strong&gt;&lt;/span&gt; String
userhandle = ws.&lt;span class="me1"&gt;&lt;font color="#006600"&gt;getHandleForUserid&lt;/font&gt;&lt;/span&gt;&lt;span class="br0"&gt;&lt;font color="#66cc66"&gt;(&lt;/font&gt;&lt;/span&gt;sid, username&lt;span class="br0"&gt;&lt;font color="#66cc66"&gt;)&lt;/font&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Where getHandleForUserid is the method&lt;/p&gt;&lt;a name="Step_6:_Create_a_Request"&gt;&lt;/a&gt;&lt;h3&gt; &lt;span class="mw-headline"&gt; Step 6: Create a Request &lt;/span&gt;&lt;/h3&gt;&lt;div style="text-align:left;"&gt;&lt;pre class="source-javascript"&gt;Dim attrVal&lt;span class="br0"&gt;&lt;font color="#66cc66"&gt;(&lt;/font&gt;&lt;/span&gt;&lt;span class="nu0"&gt;&lt;font color="#cc0000"&gt;5&lt;/font&gt;&lt;/span&gt;&lt;span class="br0"&gt;&lt;font color="#66cc66"&gt;)&lt;/font&gt;&lt;/span&gt;, attr&lt;span class="br0"&gt;&lt;font color="#66cc66"&gt;(&lt;/font&gt;&lt;/span&gt;&lt;span class="nu0"&gt;&lt;font color="#cc0000"&gt;1&lt;/font&gt;&lt;/span&gt;&lt;span class="br0"&gt;&lt;font color="#66cc66"&gt;)&lt;/font&gt;&lt;/span&gt;, prop&lt;span class="br0"&gt;&lt;font color="#66cc66"&gt;(&lt;/font&gt;&lt;/span&gt;&lt;span class="nu0"&gt;&lt;font color="#cc0000"&gt;1&lt;/font&gt;&lt;/span&gt;&lt;span class="br0"&gt;&lt;font color="#66cc66"&gt;)&lt;/font&gt;&lt;/span&gt;, persistent_id &lt;span class="kw1"&gt;&lt;strong&gt;&lt;font color="#000066"&gt;As&lt;/font&gt;&lt;/strong&gt;&lt;/span&gt; String
Dim requestHandle, requestNumber &lt;span class="kw1"&gt;&lt;strong&gt;&lt;font color="#000066"&gt;As&lt;/font&gt;&lt;/strong&gt;&lt;/span&gt; String
attrVal = &lt;span class="kw2"&gt;&lt;strong&gt;&lt;font color="#003366"&gt;New&lt;/font&gt;&lt;/strong&gt;&lt;/span&gt; String&lt;font color="#66cc66"&gt;&lt;span class="br0"&gt;(&lt;/span&gt;&lt;span class="br0"&gt;)&lt;/span&gt;&lt;/font&gt; &lt;span class="br0"&gt;&lt;font color="#66cc66"&gt;{&lt;/font&gt;&lt;/span&gt;&lt;span class="st0"&gt;&lt;font color="#3366cc"&gt;&amp;quot;customer&amp;quot;&lt;/font&gt;&lt;/span&gt;, userhandle, &lt;span class="st0"&gt;&lt;font color="#3366cc"&gt;&amp;quot;category&amp;quot;&lt;/font&gt;&lt;/span&gt;, &lt;span class="st0"&gt;&lt;font color="#3366cc"&gt;&amp;quot;&amp;lt;category id&amp;gt;&amp;quot;&lt;/font&gt;&lt;/span&gt;, &lt;span class="st0"&gt;&lt;font color="#3366cc"&gt;&amp;quot;description&amp;quot;&lt;/font&gt;&lt;/span&gt;, &lt;span class="st0"&gt;&lt;font color="#3366cc"&gt;&amp;quot;Description here&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;span class="br0"&gt;&lt;font color="#66cc66"&gt;}&lt;/font&gt;&lt;/span&gt;
prop = &lt;span class="kw2"&gt;&lt;strong&gt;&lt;font color="#003366"&gt;New&lt;/font&gt;&lt;/strong&gt;&lt;/span&gt; String&lt;font color="#66cc66"&gt;&lt;span class="br0"&gt;(&lt;/span&gt;&lt;span class="br0"&gt;)&lt;/span&gt;&lt;/font&gt; &lt;span class="br0"&gt;&lt;font color="#66cc66"&gt;{&lt;/font&gt;&lt;/span&gt;&lt;span class="st0"&gt;&lt;font color="#3366cc"&gt;&amp;quot;&amp;quot;&lt;/font&gt;&lt;/span&gt;&lt;span class="br0"&gt;&lt;font color="#66cc66"&gt;}&lt;/font&gt;&lt;/span&gt;
attr = &lt;span class="kw2"&gt;&lt;strong&gt;&lt;font color="#003366"&gt;New&lt;/font&gt;&lt;/strong&gt;&lt;/span&gt; String&lt;font color="#66cc66"&gt;&lt;span class="br0"&gt;(&lt;/span&gt;&lt;span class="br0"&gt;)&lt;/span&gt;&lt;/font&gt; &lt;span class="br0"&gt;&lt;font color="#66cc66"&gt;{&lt;/font&gt;&lt;/span&gt;persistent_id&lt;span class="br0"&gt;&lt;font color="#66cc66"&gt;}&lt;/font&gt;&lt;/span&gt;
requestHandle = &lt;span class="st0"&gt;&lt;font color="#3366cc"&gt;&amp;quot;&amp;quot;&lt;/font&gt;&lt;/span&gt;
requestNumber = &lt;span class="st0"&gt;&lt;font color="#3366cc"&gt;&amp;quot;&amp;quot;&lt;/font&gt;&lt;/span&gt;
ws.&lt;span class="me1"&gt;&lt;font color="#006600"&gt;createRequest&lt;/font&gt;&lt;/span&gt;&lt;span class="br0"&gt;&lt;font color="#66cc66"&gt;(&lt;/font&gt;&lt;/span&gt;sid, userhandle, attrVal, prop, &lt;span class="st0"&gt;&lt;font color="#3366cc"&gt;&amp;quot;&amp;quot;&lt;/font&gt;&lt;/span&gt;, attr, requestHandle, requestNumber&lt;span class="br0"&gt;&lt;font color="#66cc66"&gt;)&lt;/font&gt;&lt;/span&gt;&lt;/pre&gt;&lt;pre class="source-javascript"&gt;&lt;span class="br0"&gt;&lt;font color="#66cc66"&gt;&lt;/font&gt;&lt;/span&gt;&amp;nbsp;&lt;/pre&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;pre class="source-javascript"&gt;&lt;span class="br0"&gt;However, when I setup the data connection to the Web Service in InfoPath, It seems to be looking for field mappings or a string for the variables &amp;quot;attrVal&amp;quot;, &amp;quot;prop&amp;quot;, &amp;quot;attr&amp;quot;, etc. per the examples above.  I&amp;#39;m not sure how to accomplish creating this connection successfully.  I would like for it to use the username of the logged in user (logged into SharePoint 2010) and the other field values would be hard coded because they do not come from fields within the form.&lt;/span&gt;&lt;/pre&gt;&lt;pre class="source-javascript"&gt;&lt;span class="br0"&gt;Thank you for your help!&lt;/span&gt;&lt;/pre&gt;</description></item></channel></rss>