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

Deploying Web Services problem

Guest
Sep 30, 2009 Sep 30, 2009

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

TOPICS
Getting started
4.0K
Translate
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
Valorous Hero ,
Sep 30, 2009 Sep 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.

Translate
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
Sep 30, 2009 Sep 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

Translate
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
Valorous Hero ,
Sep 30, 2009 Sep 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.

Translate
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
Oct 02, 2009 Oct 02, 2009

Thanks for that pointer - however I've moved everything out of Application.cfm to Application.cfc->onSessionStart and it's not made any difference to the errors I'm getting - This is very frustrating because the web service is key to me getting this problem sorted out - I have to be able to make a remote call to the external server to query the live database

Translate
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
Oct 02, 2009 Oct 02, 2009

Do not forget that more often than not each webservice request will create a new session (and will run onSessionStart()) if it invokes standard Application.cfc(cfm)...

I tend to create a separate Application.cfc(cfm) in webservices dir to do exactly what I need it to do.

Translate
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
Community Expert ,
Nov 04, 2009 Nov 04, 2009

Joannecorless,

Coldfusion did give you a hint which has apparently been ignored so far. Here it is:

"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."

Translate
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 ,
Nov 02, 2009 Nov 02, 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

Translate
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
LEGEND ,
Nov 02, 2009 Nov 02, 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.

Translate
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 ,
Nov 02, 2009 Nov 02, 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

Translate
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 ,
Feb 03, 2010 Feb 03, 2010

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

Translate
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
Explorer ,
Apr 03, 2013 Apr 03, 2013
LATEST

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

Translate
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