Expand my Community achievements bar.

LC Designer CouldFusion cfc?WSDL

Avatar

Level 1

Request: Can someone please provide me a link to a "good" example of using LC Designer to connect to a .cfc?wsdl file & populating a field with the results of the web service?

Scenario:

The first time client submits the form, the data populates the Parent table with a Project Name entered by the client. The next time the form is opened, I’d like to have a hidden field populated with the assigned PK of the record using a data connection to the CFC?WSDL file. I have a CFC, with remote access, that will query the database on the argument of Project Name and return the PK to populate this hidden field.

Webservice:

<cfcomponent>

          <cffunction name = “getID” access = “remote”  returntype = “numeric”>

              <cfargument name=”projectName”  type = “string”/>

                    <cfquery name="qgetID" datasource="devnetws">

                              SELECT projectID

                              FROM TABLE

                              WHERE txtprojectName = #projectName#

                    </cfquery>

            <cfreturn getID> 

</cfcomponent>

4 Replies

Avatar

Former Community Member

All of my samples use Web services that are local to my machine and will not work for you. The source of the wsdl is unimportant (whether it is a cfc or .net or java). You simply point the data connection wizard to your wsdl and map the inputs and outputs on your form and then decide when you want to fire the web connection and you are done. To fire the wsdl you do not need a button you can use this command on the appropriate event:

xfa.connectionSet.Name of Data Connection.execute(1)

The parameter that is passed is a true/false value that indicates whether you want to remerge that data or not. In most cases you do not want to remerge the data.

Paul

Avatar

Level 1

Well, that sounds great. The only problem is that I keep getting error messages when trying to connect to the WSDL. "Cannot use this opperation, SOAP binding must be document/literal. That's why I'd like an explanation of why I can't use a WSDL created in ColdFusion. Becuase I am obviously missing something and I have no examples to go by.

Avatar

Former Community Member

Can you send me your wsdl file and I will have a look at it. Send it to LiveCycle8@gmail.com

Paul

Avatar

Level 1

I just found out how to change the encoding from RPC to document-literal via the style attribute in the component tag of my .cfc file. I've connected my LC Dynamic PDF to my WSDL file on my CF server. Thanks for listening to me rant until I found my solution.

Just to re-cap folks, the LC Designer PDF files will only connect to document-literal SOAP encoded WSDL files. If you do not specify style = "document" in your component tag, ColdFusion creates a WSDL file with RPC encoded SOAP instead of document-literal.