3 Replies Latest reply on Dec 2, 2007 5:40 PM by Zareh Tashjian

    Coldfusion web services

    Zareh Tashjian
      Hi all,

      I built a simple web service that inserts some content into the database, however if the content has been pasted from a word doc or outlook and contains some print characters...etc its breaking the web service when I try to display it. its going into the database successfully but causing an error when i try to get it via the web service. Is there a technique to make the web service work with any kind of content ?

        • 1. Re: Coldfusion web services
          JR "Bob" Dobbs-qSBHQ2 Level 3
          1. please post your code

          2.what is the error message?

          3. Are you using cfqueryparam and/or cfprocparam in your database access code? If not you should be.
          • 2. Re: Coldfusion web services
            coffeedrinker56 Level 1
            A quick answer is to use a RegEx to strip invalid characters from the input stream.

            ... or use XmlFormat - which doesn't necessarily have to be used for XML - which converts such characters into web service-readable form.
            • 3. Re: Coldfusion web services
              Zareh Tashjian Level 1
              Thank you for your replies and help, appreciate it.

              I will try cfqueryparam and Xmlformat and see it that will solve the problem. I'll try both in the insert statement.

              My code goes like this: putting parts of the code only...

              <cfinvoke webservice ="mywebservice_url"
              <cfinvokeargument name="description" value="#ReReplace(form.description,'[^[:print:]]','','ALL')#"/>


              <cffunction name="add_description" output="false" access="remote" returntype="boolean" hint="Add description">

              <cfargument name="description" required="true" type="string">


              INSERT INTO mytable...'#arguments.description#',...etc