AdobeStock_455007340

Distinguishing CFC Method Invocation From Web Service Method Invocation

If you are writing CFC methods that are exposed as Web Services, then you may want to be able to determine exactly how your method is being invoked (as a CFC or as a Web Service). I’d been struggling with this one for a while, and today Tom Jordahl came to my rescue with the following function. You can drop it in any CFC and call it as needed, it will return TRUE if responding to a SOAP request and FALSE if not.














3 responses to “Distinguishing CFC Method Invocation From Web Service Method Invocation”

  1. Bryan F. Hogan Avatar
    Bryan F. Hogan

    Ben, isn’t this an unsupported technique? If so wouldn’t it be bad if one uses this technique and the next update to CFMX does not support it?

  2. Ben Forta Avatar
    Ben Forta

    Yes, it is unsupported. But as long as Axis is included in ColdFusion then it should work, and I doubt that Axis is going to be replaced any time soon. And I sincerely hope that this type of function will become part of CFML itself in the future, it should be.

  3. Bryan F. Hogan Avatar
    Bryan F. Hogan

    I agree 100%, I still think it may be wise to mention that it’s not a supported function. And that a user should be aware of that. Just my opinion. Thanks for clarifying.
    Bryan

Leave a Reply