Skip to main content
September 30, 2009
Question

Deploying Web Services problem

  • September 30, 2009
  • 4 replies
  • 4101 views

I'm trying to build a very basic web service that will sit on a remote server and query the live database

<cfcomponent displayName="invoiceUtilities" output="false">
    <cffunction name="getInvoiceDetailsFromWebService" returnType="Query" access="remote" output="false">
        <cfargument name="invoiceDetailId" type="String" required="true">
        <cfquery datasource="#dataSource#" name="invoiceQuery">
            SELECT invoiceId,productType
            FROM InvoiceDetails
            WHERE InvoiceDetailId='#invoiceDetailId#'
        </cfquery>
        <cfreturn invoiceQuery/>
    </cffunction>
</cfcomponent>

Currently whilst I'm testing it - it is sat within a different application (as it would be normally) but on my dev server on my box

I can access the WSDL via the browser but when I try and call it from my application - I get the following error:

Cannot  generate stub objects for web service invocation.

Name:  http://localhost:8500/llsintranet/hip_view_657836ty/invoiceUtilities.cfc?wsdl.  WSDL:  http://localhost:8500/llsintranet/hip_view_657836ty/invoiceUtilities.cfc?wsdl.  org.apache.axis.wsdl.toJava.DuplicateFileException: Duplicate file name:  C:\ColdFusion9\stubs\WS306957249\llsintranet\hip_view_657836ty\InvoiceUtilities.java.  Hint: you may have mapped two namespaces with elements of the same name to the  same package name. It is recommended that you use a web browser to retrieve and  examine the requested WSDL document to ensure it is correct. If the requested  WSDL document cannot be retrieved or is dynamically generated, it is

likely that  the target web service has programming errors.

This is the WSDL:

<?xml  version="1.0" encoding="UTF-8" ?>
<!--
WSDL created by ColdFusion version 9,0,0,241018
-->
- <wsdl:types>
<import namespace="http://rpc.xml.coldfusion" />
- <complexType name="ArrayOf_xsd_string">
- <complexContent>
- <restriction base="soapenc:Array">
<attribute ref="soapenc:arrayType" wsdl:arrayType="xsd:string[]" />
</restriction>
</complexContent>
</complexType>
- <complexType name="ArrayOfArrayOf_xsd_anyType">
- <complexContent>
- <restriction base="soapenc:Array">
<attribute ref="soapenc:arrayType" wsdl:arrayType="xsd:anyType[][]" />
</restriction>
</complexContent>
</complexType>
</schema>
<import namespace="http://hip_view_657836ty.llsintranet" />
- <complexType name="QueryBean">
- <sequence>
<element name="columnList" nillable="true" type="impl:ArrayOf_xsd_string" />
<element name="data" nillable="true" type="impl:ArrayOfArrayOf_xsd_anyType" />
</sequence>
</complexType>
- <complexType name="CFCInvocationException">
<sequence />
</complexType>
</schema>
</wsdl:types>
- <wsdl:message name="getInvoiceDetailsFromWebServiceResponse">
<wsdl:part name="getInvoiceDetailsFromWebServiceReturn" type="tns1:QueryBean" />
</wsdl:message>
- <wsdl:message name="CFCInvocationException">
<wsdl:part name="fault" type="tns1:CFCInvocationException" />
</wsdl:message>
- <wsdl:message name="getInvoiceDetailsFromWebServiceRequest">
<wsdl:part name="invoiceDetailId" type="xsd:string" />
</wsdl:message>
- <wsdl:portType name="InvoiceUtilities">
- <wsdl:operation name="getInvoiceDetailsFromWebService" parameterOrder="invoiceDetailId">
<wsdl:input message="impl:getInvoiceDetailsFromWebServiceRequest" name="getInvoiceDetailsFromWebServiceRequest" />
<wsdl:output message="impl:getInvoiceDetailsFromWebServiceResponse" name="getInvoiceDetailsFromWebServiceResponse" />
<wsdl:fault message="impl:CFCInvocationException" name="CFCInvocationException" />
</wsdl:operation>
</wsdl:portType>
- <wsdl:binding name="invoiceUtilities.cfcSoapBinding" type="impl:InvoiceUtilities">
<wsdlsoap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http" />
- <wsdl:operation name="getInvoiceDetailsFromWebService">
<wsdlsoap:operation soapAction="" />
- <wsdl:input name="getInvoiceDetailsFromWebServiceRequest">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://hip_view_657836ty.llsintranet" use="encoded" />
</wsdl:input>
- <wsdl:output name="getInvoiceDetailsFromWebServiceResponse">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://hip_view_657836ty.llsintranet" use="encoded" />
</wsdl:output>
- <wsdl:fault name="CFCInvocationException">
<wsdlsoap:fault encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" name="CFCInvocationException" namespace="http://hip_view_657836ty.llsintranet" use="encoded" />
</wsdl:fault>
</wsdl:operation>
</wsdl:binding>
- <wsdl:service name="invoiceUtilities">
- <wsdl:port binding="impl:invoiceUtilities.cfcSoapBinding" name="invoiceUtilities.cfc">
</wsdl:service>
</wsdl:definitions>

And this is the call from my application:

<cfinvoke webservice="http://localhost:8500/llsintranet/hip_view_657836ty/invoiceUtilities.cfc?wsdl"
                                  method="getInvoiceDetailsFromWebService"
                                  returnvariable="invoiceQuery">
                                  <cfinvokeargument name="invoiceDetailId"
                                                      value="#Ltrim(invoiceDetailId)#">
                        </cfinvoke>
                        <cfdump var="#invoiceQuery#"/>

I've hunted online for an answer but can't find one that fits the scenario - I'm not using any authentication as far as I can tell - It's running on CF9 atm but will be put onto CF8 as well

Thanks for any pointers

This topic has been closed for replies.

4 replies

Participant
February 3, 2010

Try removing the attribute “displayname” from the <cfcomponent> tag.

Inspiring
April 4, 2013

Removing the attribute "displayname" worked for me. Can anyone explain why?

Inspiring
November 2, 2009

Your datasource variable is not defined.

Troubleshooting webservice problems is easier by invoking them as components until they work perfectly.  Then, any problems regarding invoking them as webservices is not likely to be caused by the component.

Participant
November 2, 2009

Thanks Dan for the update,

my component is working perfectly when calling it localy,

and if i rename it also i does work via webservice call (using <cfinvoke>)

it just not working now after we updated our CF 8 to CF 8.0.1

something is still cached somewhere, i tried deleting the /stub folder restarted the service still no luck : (

regards

M

Participant
November 2, 2009

Hi,

im runing into the same issue : (

i was wondering if you were able to fix yours ?

i am using :  CF 8,0,1,195765     along with HotFix3  (JVM: 1.6.0_14)

thaaks for the help in advance.

Regards

M

ilssac
Inspiring
September 30, 2009

The very first thing I ALWAYS do when ever I see that "Cannot  generate stub objects for web service invocation." is to go into the ColdFusion administrator under the web service tab and delete any related web service defined there.

This can be caused by CF caching an out of date WSDL and deleting the old one and letting a new one get created and clear this up.

September 30, 2009

I would have done that but there is nothing defined in the ColdFusion Administration Web Services tab at all - Do you know where it might be physically cached ?

I'll go for a hunt anyway

Thanks for a possible clue

ilssac
Inspiring
September 30, 2009

The next most common issue after caching outdated WSDL data, is an Application.cfm or Application.cfc file breaking the web service request.

If either an Application.cfm OR an Application.cfc OnRequest method are in play and they insert extra text, even white space, this will break the web service request and prevent them from working correctly.