Entries Tagged as “WebServices”

JRE should be used or JDK should be used with ColdFusion 10 ?

March 08, 2013 / Krishna Reddy

  Administrator | Adobe ColdFusion | Adobe ColdFusion 10 | ColdFusion | Docs | General | WebServices

There is a bit of confusion whether to use JRE or JDK with ColdFusion when you want to use an externally installed one.

This blog entry clarifies on whether to use jre7 or jdk7.

Note:Unless there is a specific reason, it is generally recommended to use the latest patched JRE/JDK of major Java version supported. As of 8th March 2013, for Java 1.7 the latest patched version is Java 1.7 Update 17.

The decision on whether JRE or JDK should be used is determined by whether JRE/JDK contains Server VM or not as ColdFusion runs only on top of Server VM. ColdFusion can't run on Client VM.

For all platforms, JRE that comes along with JDK contains server VM.

Even the public JRE that is available from Oracle contains Server VM for all platforms except for Windows 32-bit JRE.

So, from this it can be derived as follows:

1. For Win 64, Linux 32, Linux 64, Solaris 64-bit, Mac 64-bit you can use any of public JRE from Oracle or the JRE that is contained within JDK. We would recommend you to use Public JRE from Oracle. For Mac OS X there is an extra note below before which you want to conclude whether to use public JRE or JDK's JRE.

2. For Windows 32-bit, you can use the JRE that is contained within JDK

 OR

You can use the Win 32- Public JRE by customizing it to contain Server VM.

(To customize it you can copy <JDK_HOME>\jre\bin\server\ directory and its content to Public JRE (jre\bin\server ). It would at same directory level as client directory.

Note for Mac OS X Installations:

For Mac also public JRE as well JDK contained JRE contains server VM.
If you are using Web Services you would need one file from JDK(tools.jar). JRE doesn’t contain this file.
Since full version of ColdFusion 10 is shipped before Java 7  and Mac OS X used to ship JDK earlier which contains this file by default, we never shipped it along with ColdFusion installation.
With update 8 for Java 1.7 support on mac OS X, we are just copying this tools.jar from installed JDK to <ColdFusion_Home>\cfusion\lib\.
Going forward we will be shipping it along with ColdFusion installer for Mac as well but for ColdFusion 10 this file is not there.
So, consider using JRE or JDK depending on the need for Mac OS X
                      OR
Just use JRE itself and only if needed you can copy tools.jar(it is same for all platforms) to <ColdFusion_Home>\cfusion\lib.
So if you are using ColdFusion 10 on Mac OS X with JRE 1.7 you might want to copy tools.jar to <ColdFusion_Home>\cfusion\lib\

 

 


ColdFusion 10 WebServices - Axis2 vs Axis1

July 25, 2012 / Milan Chandna

  ColdFusion | WebServices

I have seen many people getting confused between Axis-2 and Axis-1 WebServices in ColdFusion 10. ColdFusion 10 has added the support for Axis-2 WebService, earlier till ColdFusion 9 only Axis-1 WebServices were supported.

So to begin with what exactly is this Axis-2 and Axis-1.

Intro Axis:
Apache Axis (Axis-1) is an open sourceXML based Web service framework. ColdFusion internally uses Axis to publish and consume WebServices.  Apache Axis-2 is a complete re-design and re-write of the widely used Apache Axis but achieves same purpose. Axis-2 supports many new and flexible features over Axis-1 which means ColdFusion has implemented it not only to provide you latest features like Soap1.2 but also to give you more flexibility and power in your hand. You can always search for 'Axis-1 vs Axis2' if you want to study the advantages of Axis-2.


New in ColdFusion 10
  
 So let's see what ColdFusion 10 is offering with Axis-2

  1. SOAP 1.2 support (SOAP 1.1 was there with Axis-1) 
  2. WSDL2 support
  3. Wrapped styled WSDL support
  4. Easy switching from Axis-2 to Axis-1 and vice-versa.


Taking these points one by one.

Read More


Axis-2 and Axis-1 compatibility issues

July 12, 2012 / Milan Chandna

  Adobe ColdFusion 10 | ColdFusion | WebServices

 Axis-2 and Axis-1 compatibility issues

 

Problem:

With ColdFusion 10 you can leverage power of Axis-2 WebServices. But you might get into issues if you are mixing Axis-2 with Axis-1. Axis-2 services are incompatible with Axis-1 services in ColdFusion because of the way their WSDL's are formed. Though by design Axis-1 and Axis-2 are compatible but in ColdFusion you might run into issues if you are using ColdFusion complex data types.

 

Since Axis-1 and Axis-2 are incompatible, this means that if you are publishing your WebServices using Axis-2, then they should be consumed using Axis-2 only. Similarly if you are publishing your WebServices using Axis-1 then they should be consumed using Axis-1 only.

 

ColdFusion 10 Solution:

ColdFusion has taken all the measures to support backward compatibility with it's earlier versions. ColdFusion allows you to specify the version of Axis in which WebServices should be published or consumed. ColdFusion has given a control at three levels:

  1. Server level
  2. Application level
  3. Component level

Publishing

  1. Server level: In ColdFusion 10 WebServices administrator page there is a new setting called as wsversion. This setting defines the default version of Axis that will be used to publish the WebServices in ColdFusion if you have not specified it at Application/Component level.

    Default value of this setting is set to '2', which means by default your WebServices will be published using Axis-2. You can anytime change it to '1' if you are facing the problems.

    This will be very handy if you are consuming all your WebServices from ColdFusion 9. In ColdFusion 9 Axis-2 is not supported and hence your WebServices will be consume by Axis-1 only, so that is why if all your WebServices are consumed in ColdFusion 9 then you can set this to default '1' for whole server.
  2. Application level: In Application.cfc you can specify an attribute as this:

    <cfset this.wssettings.version.publish = "2">

    Setting this attribute at Application level will ensure that all WebServices in this Application will be published using this version of Axis if not overridden at component level.
  3. Component level: In you WebService component (mywebservice.cfc) you can specify this attribute as this:

    <cfcomponent wsversion="1">
    Specifying this attribute will ensure that this WebService will be published using Axis-1

Consuming

ColdFusion understands that WebServices could be published from any platform and can be consumed from CF so to make it easy CF automatically detects if the service is published in Axis-2 or Axis-1. If it's published in Axis-2, CF will consume it using Axis-2 unless overridden and same goes for Axis-1 too.

 

You can however override this behavior if you are very sure of the published verison, at two levels:

  1. Application level: In Application.cfc you can specify an attribute as this:

    <cfset this.wssettings.version.consume = "2">
    Setting this attribute at Application level will ensure that all WebServices in this Application will be consumed using this version of Axis if not overridden at component level.
  2. Invoking level: While invoking the WebService you can specify an attribute 'wsversion' to tell CF from which version the Service should be consumed.

    ws=createObject("webservice","http://localhost:8500/mycfc.cfc?wsdl",{wsversion="2"})
    <cfinvoke webservice = "http://localhost:8500/mycfc.cfc?wsdl" method="echo" wsversion="2" returnVariable="foo" >

 

 

I am sure that if you read this post, you will never stuck in Axis-1/Axis-2 compatibility issues.

Specially it is a must for any user who is publishing WebService as in ColdFusion 10 but consuming them in ColdFusion 9 or earlier releases. It's because in CF 10 by default Axis-2 will be used whereas in earlier CF releases only Axis-1 was supported, so you might run into issues if will not take measures.

 

Milan.

my blog


Blue Mango Theme Design By Mark Aplet

Super Powered by Mango Blog