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

Return Soap Fault in CF web service

New Here ,
Apr 05, 2013 Apr 05, 2013

Copy link to clipboard

Copied

How do I return a Soap Fault like this:

      <soapenv:Fault>

         <faultcode>soapenv:Client.Validation</faultcode>

         <faultstring>SalesCode must be 5 characters in length</faultstring>

        ...

      </soapenv:Fault>

instead of a CFCInvocationException?

Views

836

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
Explorer ,
Nov 14, 2013 Nov 14, 2013

Copy link to clipboard

Copied

Hi Dina,

Did you find a solution to your problem? I'm looking at doing the same thing.

Cheers,
Simon

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 ,
Nov 17, 2013 Nov 17, 2013

Copy link to clipboard

Copied

LATEST

I had to use a workaround. In the complex type (CFC) returned by the web

service, I added two additional properties, success (boolean) and fault

(string). That way, if validation fails, I set success to false and return

validation messages in the fault property using syntax like this:

. It communicates what the client needs to know but

is not in the format I originally wanted to implement. I did find a clue

about how to get control of the SOAP envelope in a comment made by Arthur

Blake at the end of one of Ben Nadel's blog entries about using HTTP to

consume a web service. He said he could customize the XML request/response by

writing a "proxy" in ColdFusion that forwards to the real SOAP service. I

never did figure out how to go about doing that, so if you happen to get

your head around it, please post your solution. In general, I found that

ColdFusion 8 doesn't play nicely with a pre-defined complex WSDL that

import XSDs and doesn't honor a "required=no" setting in the property tag

of a complex type's CFC when generating its WSDL dynamically. In fact, I

have a whole list of "gotchas" on this... Didn't mean to write a book, but

you opened an old wound that had just about healed. Good luck, Simon. Hope

I didn't douse too much water on your passion to move forward with this.

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