tags:

views:

48

answers:

1

Hello Everyone,

Here is my coldfusion web service. When I use soapUI tool to call 'test', i am receiving this

"<ns1:stackTrace xmlns:ns1="http://xml.apache.org/axis/"&gt;org.xml.sax.SAXParseException: Premature end of file."

error.

can anyone help me on this issue? I already seached online, but no luck. any code issue?

do I need to use <cfproperty> tag?

please help me.

thanks

<cfcomponent output="false">

    <!--- initialisation --->
    <cffunction
        name="init"
        output="false"
        hint="return an initialized object.">

        <!--- Return THIS reference. --->
        <cfreturn THIS />

    </cffunction>

    <!--- ping --->
    <cffunction
        name="test"
        access="remote"
        returntype="numeric"
        output="false"
        hint="return an true = 0.">

        <!--- declare local variables --->
        <cfset var local = 0 />

        <!--- Return 0. --->
        <cfreturn local />

    </cffunction>

</cfcomponent>
+3  A: 

Couple questions: are you on CF9? What happens when you invoke it straight up (not through SoapUI, but as a http call in a browser)?

Also, I would strongly recommend against using "Local" as a variable name in a function - CF9 introduced some changes in how variables are scoped within a function and uses that as the name for that constrained scope.

scrittler
I am using CF 8.1.I can able to call as a component instead of web service with out any issue.If I use http call in broswer with test.cfc?wsdl, no issue.
Big A
so what happens if you invoke the service call in a browser? http://{whatever}/something.cfc?method=test
scrittler
It runs successfully and return 0.
Big A
if you view source, what's in there? can you post a screenshot somewhere?
scrittler
here is source...<wddxPacket version='1.0'><header/><data><number>0.0</number></data></wddxPacket>
Big A
ok. you're not invoking it via SOAP. your Definition URL in soapUI should be /something.cfc?WSDL - without it, CF returns WDDX not SOAP.
scrittler
I can see that, however it's without /something.cfc?WSDL
Big A