Home > ColdFusion, Errors, Webservices, code > Cannot perform web service invocation – Premature end of file

Cannot perform web service invocation – Premature end of file

I’ve been getting a ColdFusion error on a remote server that I’m not getting when testing locally so obviously something is different between those 2 servers. I had thought to just try using a webservice call to the remote server to see if I could debug it better (the error I’m getting in Flex isn’t detailed enough to begin to track down the issue). The webservice I was testing is supposed to return back a complex object, but I was getting the error

Cannot perform web service invocation – Premature end of file

If I tested a return of just a string, it worked, but it did not like returning the complex object. After browsing around via Google for a bit, it seems that it may be related to nulls being returned in my complex object. Now I’m not sure how to fix this other than to add default values to my objects when they are returned (which I really don’t want, or *need* to do as calling it via Flash remoting works nicely), but debugging them via CF, not so optimal.

  1. July 12th, 2010 at 15:55 | #1

    I don’t have any experience with ColdFusion, but if this were PHP I would say it sounds to me like you are trying to set a request header after returning the part of the body of the request.

  2. Gareth
    July 12th, 2010 at 22:18 | #2

    Yeah, with ColdFusion, it handles that stuff for you. In order to convert one of your ColdFusion Components (cfc) to a webservice, you just set access=”remote”, and add ?wsdl after the .cfc It’s a good and a bad thing as you get stuff automagically converted to a wsdl, but if something doesn’t quite work correctly, then it’s a pain to try to debug.