• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Coldfusion web services

New Here ,
Dec 01, 2007 Dec 01, 2007

Copy link to clipboard

Copied

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 ?

Thanks
TOPICS
Advanced techniques

Views

230

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advisor ,
Dec 01, 2007 Dec 01, 2007

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Dec 02, 2007 Dec 02, 2007

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 02, 2007 Dec 02, 2007

Copy link to clipboard

Copied

LATEST
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')#"/>

Then:

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

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

AND:

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation