Entries for December 2006

Lately we have been writing a lot of webservices to help integrate with some other language systems across the company and we ran into an issue that I know others have ran into, but haven't seen anyone else realize exactly what the problem is. I was returning a complex data type from the webservice ( long story, but we wanted to make sure that the individual items in the result showed up in the wsdl) so I had a cfcomponent with properties of each of the items we were going to return, and then we were creating an object out of the component and returning it. Quick note here, I oftentimes will wrap the contents of my cfcomponent tags in cfsilent tags to help suppress whitespace. Dont do this with the components for this purpose, the webservice doesn't like it much. Back to the issue at hand, I kept getting the error: faultString: org.xml.sax.SAXParseException: Premature end of file. I only got this when invoking it as a webservice, as a regular component invoke it worked fine. I finally realized, that after creating the object in the method to be returned, you have to set all of the different variables to their default values, so you make sure you set all of the variables in the object or they wont be defined. You have to do this, even if you put a default="" on your cfproperty definitions. So if you ever run into this, make sure you are initializing all of your variables in the object before returning it. If I haven't been clear about any of this, let me know, but send me an email to ryanguill [at] gmail [dot] com, my mail server on my server still isn't working so I may not see your comments.

Posted on Wed. December 13, 2006 by Ryan Guill #
Design, Photograph, Work © Ryan Guill, aDeepBlue 2013: All Rights Reserved. | Contact | RSS Feed