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

How to expose a Java or .NET type in a CF webservice

New Here ,
Aug 24, 2007 Aug 24, 2007

Copy link to clipboard

Copied

Hello

How can you directly expose a Java or .NET type in a CF webservice? My idea is to expose a Java or .NET enum type thus you have this enumeration exposed in the WSDL which then consumers can use.

Unfortunately ColdFusion whether knows enumerations nor named constants (which you could use in a datatype to simulate an enum).

Kind regards and thank you for your help
TOPICS
Advanced techniques

Views

546

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 ,
Aug 27, 2007 Aug 27, 2007

Copy link to clipboard

Copied

If I'm reading this right ---
Just write a "wrapper" cffunction that invokes the Java or .NET function/class in question, then "expose" it by setting the access="remote" attribute in the cffunction tag. What it really comes down to is building a wrapper function for it.

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 ,
Aug 27, 2007 Aug 27, 2007

Copy link to clipboard

Copied

Thanks a lot for your answer. That's exactly what I'd like to do. Could you tell me what I have to specify in the "returnType" attribute of the cffunction in order to get a WSDL which precisely returns that .NET or Java type?

Thank you for your help
Kind regards

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
Aug 28, 2007 Aug 28, 2007

Copy link to clipboard

Copied

Have fun! ;)

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 ,
Aug 28, 2007 Aug 28, 2007

Copy link to clipboard

Copied

Hmmm, but now you are exposing the cfcomponent "myVarType" which isn't whether a .NET type nor a Java type. Here is a little example: I'd like to expose the .NET enum type "DayOfWeek" in a webservice. "DayOfWeek" has to be exposed in the WSDL. How can I do that?

<cfscript>
myDotNetEnumType = CreateObject(".NET", "System.DayOfWeek");
</cfscript>
<cfdump var="#myDotNetEnumType#" />

Kind regards

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
Adobe Employee ,
Sep 06, 2007 Sep 06, 2007

Copy link to clipboard

Copied

LATEST
Parker,
You can not do what you want to do. And you shouldn't be able to. :-)

Web services are generally used for interop between (often very different) systems, tying a service to a particular type goes against that purpose.

For an enumeration, you should just take a string argument and validate that input in the service for the values you accept ("monday", tuesday", ..). This is much more in the spirit of web services.

Hope that helps.

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