Monday, February 26, 2007

Unable to connect to endpoint: {wsdl path}

I was getting this obscure error while trying to insert data from Flex 1.5 into a database using a WebService and a stored procedure. Despite the error message, it likely has nothing to do with connection issues between Flex and your WSDL. More likely, it is due to a coding error. You may be trying to pass a complex object into a simple data type (either in your WSDL or in SQL). For me though, I don't think this was the case.

The problem for me ended up being that I was passing null data (the user, me, had left the input box blank), into a stored procedure that expected data. The weird thing was that if I put a space (or any other character) into that field and then deleted that space before submitting the form, it would go through fine. The error would only occur if I never entered (or deleted) anything in that field at all.

Anyways, I was able to fix it simply by putting a default value into my input variable in the stored procedure (in this case, a space):

@city varchar(100) = '  '

2 comments:

It is better to write than to curse - Supriya said...
This comment has been removed by the author.
It is better to write than to curse - Supriya said...

I have created a class and set all properties that were expected by the webservice, yet get the same error.What could have gone wrong?