webservice could not generate stub object

Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.

  1. #1

    Default webservice could not generate stub object

    Hi,
    I am trying to make a simple web service. the .cfc file works as .cfc?wsdl
    browsing. when I invoke it as component name, it's work fine too. but when I
    try to invoke it as webservice then it shows error "Could not generate stub
    object for web service invocation." Here I am giving a sample example.
    1. [url]http://localhost/_com/testws.cfc?wsdl[/url]
    <cfcomponent output="yes" >
    <cffunction name="getServiceValue" returntype="string" access="remote" >
    <cfreturn "this is the first web service output.">
    </cffunction>
    </cfcomponent>
    2. [url]http://localhost/_test/testinvoke.cfm[/url]
    <cfinvoke webservice=" [url]http://localhost/_com/Dataview.cfc?WSDL[/url] "
    method="getServiceValue" returnvariable="returnedText"/>
    <!--- <cfinvoke component="_com.testws" method="getServiceValue"
    returnvariable="returnedText"/> ---->
    <cfoutput> #variables.returnedText# </cfoutput>

    Error :

    Could not generate stub objects for web service invocation.
    Name: [url]http://localhost/_com/Dataview.cfc?WSDL[/url] . WSDL:
    [url]http://localhost/_com/Dataview.cfc?WSDL[/url] . org.xml.sax.SAXException: Fatal
    Error: URI=null Line=1: Content is not allowed in prolog. It is recommended
    that you use a web browser to retrieve and examine the requested WSDL document
    for correctness. If the requested WSDL document can't be retrieved or it is
    dynamically generated, it is likely that the target web service has programming
    errors.

    Do you have any idea to resolve it?

    Thanking in advance.



    CF_Geliebter Guest

  2. Similar Questions and Discussions

    1. WebService stub generation
      Hello, As many people which try to use the AS3 stub generation from WSDL, I have problems because the generated code is not working with...
    2. webservice.htc and custom object array. only first object is deserialized in the result.value
      Hello I've been using webservice.htc for 6 months or so with great results. recently i came into the following problem that I am not sure how to...
    3. Could not generate stub objects for web serviceinvocation
      When I try to connect to a webservice I get thi error message: Could not generate stub objects for web service invocation Does anyone know what...
    4. COM object in webservice
      Is there some sort of restriction for instantiating a COM object in a ..NET webservice? I have a method inside my webservice that instantiates a...
    5. could not COM object in webservice
      Hello, thanks in advance.. Problem I have a I created a c# windows class library SLR.License which has only method GenLicKey, which inturn...
  3. #2

    Default Re: webservice could not generate stub object

    Could any of you help me on above problem?
    thx...
    CF_Geliebter Guest

  4. #3

    Default Re: webservice could not generate stub object

    There is something wrong with the WSDL that is being retrieved by cfinvoke.

    The key is the error: "Content is not allowed in prolog." There is
    something in the WSDL XML that isn't XML. Check 'view source' in a browser.

    --
    Tom Jordahl
    Macromedia Server Development


    Tom Jordahl Guest

  5. #4

    Default Re: webservice could not generate stub object

    Hi Tom,
    Thank you very much for the answer. here is the view source I have attached
    here. I don't see any wrong in the XML. I am not so good. could you please
    have a look on this? Thanking you in advance again .



    <?xml version="1.0" encoding="UTF-8"?>
    <wsdl:definitions targetNamespace="http://_com"
    xmlns="http://schemas.xmlsoap.org/wsdl/"
    xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://_com"
    xmlns:intf="http://_com"
    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 Macromedia ColdFusion MX version 7,0,0,91690-->
    <wsdl:types>
    <schema targetNamespace="http://rpc.xml.coldfusion"
    xmlns="http://www.w3.org/2001/XMLSchema">
    <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
    <complexType name="CFCInvocationException">
    <sequence/>
    </complexType>
    </schema>
    </wsdl:types>

    <wsdl:message name="getServiceValueRequest">

    </wsdl:message>

    <wsdl:message name="getServiceValueResponse">

    <wsdl:part name="getServiceValueReturn" type="xsd:string"/>

    </wsdl:message>

    <wsdl:message name="CFCInvocationException">

    <wsdl:part name="fault" type="tns1:CFCInvocationException"/>

    </wsdl:message>

    <wsdl:portType name="testws">

    <wsdl:operation name="getServiceValue">

    <wsdl:input message="impl:getServiceValueRequest"
    name="getServiceValueRequest"/>

    <wsdl:output message="impl:getServiceValueResponse"
    name="getServiceValueResponse"/>

    <wsdl:fault message="impl:CFCInvocationException"
    name="CFCInvocationException"/>

    </wsdl:operation>

    </wsdl:portType>

    <wsdl:binding name="testws.cfcSoapBinding" type="impl:testws">

    <wsdlsoap:binding style="rpc"
    transport="http://schemas.xmlsoap.org/soap/http"/>

    <wsdl:operation name="getServiceValue">

    <wsdlsoap:operation soapAction=""/>

    <wsdl:input name="getServiceValueRequest">

    <wsdlsoap:body
    encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
    namespace="http://_com" use="encoded"/>

    </wsdl:input>

    <wsdl:output name="getServiceValueResponse">

    <wsdlsoap:body
    encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
    namespace="http://_com" use="encoded"/>

    </wsdl:output>

    <wsdl:fault name="CFCInvocationException">

    <wsdlsoap:fault
    encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
    name="CFCInvocationException" namespace="http://_com" use="encoded"/>

    </wsdl:fault>

    </wsdl:operation>

    </wsdl:binding>

    <wsdl:service name="testwsService">

    <wsdl:port binding="impl:testws.cfcSoapBinding" name="testws.cfc">

    <wsdlsoap:address location="http://localhost/_com/testws.cfc"/>

    </wsdl:port>

    </wsdl:service>

    </wsdl:definitions>


    CF_Geliebter Guest

  6. #5

    Default Re: webservice could not generate stub object

    Perhaps you are using a DevNet edition that puts a watermark in the output?

    I have no problems with that WSDL.

    --
    Tom Jordahl
    Macromedia Server Development


    Tom Jordahl Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139