Skip to main content
November 13, 2010
Question

CF 9 and serializing CFCs for SOAP Web Services

  • November 13, 2010
  • 1 reply
  • 1230 views

I've noticed after upgrading to CF 9 from CF 8 that the name of any CFCs being returned are now being capitalized in the generated WSDL document and in the SOAP response.  This was not the case in CF 8, and is breaking clients written in case-sensitive languages (in this particular case, .NET).

I'm wondering if anyone else has experienced this problem, and what resolutions may have been found.

Here is an example

foo.cfc:

<cfcompont displayname="foo">

     <cfargument name="getBar" access="remote" returntype="bar" />

    

     <cfreturn new bar() />

</cfcomponent>

bar.cfc


<cfcomponent displayname="bar">

     <cfproperty name="name" type="string" />

</cfcomponent>

In the wsdl generated by CF 8, the complexType is named 'bar'.  In CF 9, it's named 'Bar'.  The same happens in the returned SOAP response.

Thanks.

    This topic has been closed for replies.

    1 reply

    Inspiring
    November 15, 2010

    If I take your sample "code" and fix it so that it's actually CFML, and pull up the WDSL for foo.cfc on both CF8 & CF9.0.1... they're identical save for the CF version number in the comment at the top, and the reference to the URL towards the bottom (because I'm running each server on a different port).

    Can you provide an actual working example: proper code that compiles and demonstrates the issue?

    --

    Adam

    November 15, 2010

    Did you run on CF 8.0.1 or CF 8?  Some further digging suggests that this might be an 8.0.0 vs. 8.0.1 issue.  Here is some "code" that will produce a WSDL in 9.0.1 and 8.0.0

    Soap.cfc:

    <cfcomponent output="false">

         <cffunction name="getObject" returntype="object" access="remote">

              <cfreturn createObject("component",  "object") />

         </cffunction>

    </cfcomponent>

    Object.cfc:
    <cfcomponent displayname="object">
         <cfproperty name="name" type="string" required="true" />
    </cfcomponent>
    WSDL produced by CF 9.0.1:
    <wsdl:definitions targetNamespace="http://soaptest" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://soaptest" xmlns:intf="http://soaptest" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns1="http://rpc.xml.coldfusion" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <!--WSDL created by ColdFusion version 9,0,1,274733-->
    <wsdl:types>
    <schema targetNamespace="http://soaptest" xmlns="http://www.w3.org/2001/XMLSchema">
    <import namespace="http://rpc.xml.coldfusion"/>
    <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
    <complexType name="Object">
    <sequence>
    <element name="name" nillable="true" type="xsd:string"/>
    </sequence>
    </complexType>
    </schema>
    <schema targetNamespace="http://rpc.xml.coldfusion" xmlns="http://www.w3.org/2001/XMLSchema">
    <import namespace="http://soaptest"/>
    <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
    <complexType name="CFCInvocationException">
    <sequence/>
    </complexType>
    </schema>
    </wsdl:types>
    <wsdl:message name="getObjectRequest">
    </wsdl:message>
    <wsdl:message name="CFCInvocationException">
    <wsdl:part name="fault" type="tns1:CFCInvocationException"/>
    </wsdl:message>
    <wsdl:message name="getObjectResponse">
    <wsdl:part name="getObjectReturn" type="impl:Object"/>
    </wsdl:message>
    <wsdl:portType name="Soap">
    <wsdl:operation name="getObject">
    <wsdl:input message="impl:getObjectRequest" name="getObjectRequest"/>
    <wsdl:output message="impl:getObjectResponse" name="getObjectResponse"/>
    <wsdl:fault message="impl:CFCInvocationException" name="CFCInvocationException"/>
    </wsdl:operation>
    </wsdl:portType>
    <wsdl:binding name="soap.cfcSoapBinding" type="impl:Soap">
    <wsdlsoap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
    <wsdl:operation name="getObject">
    <wsdlsoap:operation soapAction=""/>
    <wsdl:input name="getObjectRequest">
    <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://soaptest"use="encoded"/>
    </wsdl:input>
    <wsdl:output name="getObjectResponse">
    <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://soaptest"use="encoded"/>
    </wsdl:output>
    <wsdl:fault name="CFCInvocationException">
    <wsdlsoap:fault encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" name="CFCInvocationException"namespace="http://soaptest" use="encoded"/>
    </wsdl:fault>
    </wsdl:operation>
    </wsdl:binding>
    <wsdl:service name="SoapService">
    <wsdl:port binding="impl:soap.cfcSoapBinding" name="soap.cfc">
    <wsdlsoap:address location="http://lcmswindows/soapTest/soap.cfc"/>
    </wsdl:port>
    </wsdl:service>
    </wsdl:definitions>
    WSDL produced by CF 8.0.0
    <wsdl:definitions targetNamespace="http://soapTest" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://soapTest" xmlns:intf="http://soapTest" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns1="http://rpc.xml.coldfusion" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <!--WSDL created by ColdFusion version 8,0,0,176276-->
    <wsdl:types>
    <schema targetNamespace="http://soapTest" xmlns="http://www.w3.org/2001/XMLSchema">
    <import namespace="http://rpc.xml.coldfusion"/>
    <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
    <complexType name="object">
    <sequence>
    <element name="name" nillable="true" type="xsd:string"/>
    </sequence>
    </complexType>
    </schema>
    <schema targetNamespace="http://rpc.xml.coldfusion" xmlns="http://www.w3.org/2001/XMLSchema">
    <import namespace="http://soapTest"/>
    <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
    <complexType name="CFCInvocationException">
    <sequence/>
    </complexType>
    </schema>
    </wsdl:types>
    <wsdl:message name="CFCInvocationException">
    <wsdl:part name="fault" type="tns1:CFCInvocationException"/>
    </wsdl:message>
    <wsdl:message name="getObjectResponse">
    <wsdl:part name="getObjectReturn" type="impl:object"/>
    </wsdl:message>
    <wsdl:message name="getObjectRequest">
    </wsdl:message>
    <wsdl:portType name="soap">
    <wsdl:operation name="getObject">
    <wsdl:input message="impl:getObjectRequest" name="getObjectRequest"/>
    <wsdl:output message="impl:getObjectResponse" name="getObjectResponse"/>
    <wsdl:fault message="impl:CFCInvocationException" name="CFCInvocationException"/>
    </wsdl:operation>
    </wsdl:portType>
    <wsdl:binding name="soap.cfcSoapBinding" type="impl:soap">
    <wsdlsoap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
    <wsdl:operation name="getObject">
    <wsdlsoap:operation soapAction=""/>
    <wsdl:input name="getObjectRequest">
    <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://soapTest"use="encoded"/>
    </wsdl:input>
    <wsdl:output name="getObjectResponse">
    <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://soapTest"use="encoded"/>
    </wsdl:output>
    <wsdl:fault name="CFCInvocationException">
    <wsdlsoap:fault encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" name="CFCInvocationException"namespace="http://soapTest" use="encoded"/>
    </wsdl:fault>
    </wsdl:operation>
    </wsdl:binding>
    <wsdl:service name="soapService">
    <wsdl:port binding="impl:soap.cfcSoapBinding" name="soap.cfc">
    <wsdlsoap:address location="http://dev.m5.dominknow.com/soapTest/soap.cfc"/>
    </wsdl:port>
    </wsdl:service>
    </wsdl:definitions>
    I've highlighted the relevant differences.  I don't have a server running 8.0.1 at the moment.  Customers running MX 7 have the same (lower case) WSDL as 8.0.0.  I've had some correspondance with others that suggests 8.0.1 behaves the same as 9.0.1.  I've actually been able to find a blog post suggesting there was a change to WSDL generation in 8.0.1 with a link to an Adobe forum thread, but that thread no longer seems to exist.  The blog post:
    http://blog.coldfusionpowered.com/?p=28
    November 15, 2010

    Wow, I really did mangle the sample "code" in my original post, didn't I?