in Technology

Unable to connect to endpoint – Flash Webservice problem

When you get “Unable to connect to endpoint” errors in Flash while using a web service, here are a few things you can check up:

  • If you are passing complex data, make sure you use classes on the backend. And not associative arrays.
  • If there is any problem on the web service, you may get this error. Test your service by writing a test case in the backend programming language (e.g. PHP) and see if that works.
  • Make sure the spelling of the function you are calling and the arguments to it are correctly written.
  • Did your first web service call succeed? If not, check the connection.

Write a Comment

Comment

  1. Can anyone please help us find a solution…
    This is what we get when we attempt to refresh the webservice from cold fusion admin site. It used to work before …but all of a sudden stopped.

    Unable to refresh webservice.
    Could not generate stub objects for web service invocation.
    Name: LabSafety. WSDL: http://localhost/ds/oshb/labsafety/introcourse/webservice/labsafetymain.cfc?WSDL. org.xml.sax.SAXException: Fatal Error: URI=null Line=1: Missing whitespace before SYSTEM literal URI. 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.

  2. Hi:
    I’m trying to connect Flash to a Webservice I coded in PHP5.
    My first calls worked fine.

    Now, with the SOAP Extension in PHP5 you can set the persistence of your object so it is persistent over a series of requests during a session.

    Now here’s the problem. If I set the persistence to “SOAP_PERSISTENCE_SESSION” and I call a method passing a parameter, I got the “Unable to connect to endpoint” error.
    If I don’t pass any parameters (even though the method needs them) it works fine, with no error, other than the fact that I NEED to pass some parameters.

    So I’m starting to consider implementing the persistence myself, but I’d need to pass an ID on every method.

    Do you know anything about this issue?

  3. The persistence uses sessions to track the user. Have you started session using session_start()? Even in that case, I am not sure if Flash will send back the session id back in the next request. We had a problem with OpenLaszlo sending session ids few months back.

    Please try out session starting, and accessing session information on a next request. If you can get that, your problem is solved!

    If all else fails, you can implement the persistence yourself! And if that’s the case, do post a comment here, so that everyone else will know about it!

    Thanks.

  4. Hi Nirav,

    I am only coding in Flash and not handling the backend/server side. What changes should I tell them specifically to be done?

    • @Supriya: first you should ask them to have some test cases for the web service. If the test cases work, but you continue to get problems in Flash, you got to check your code in Flash/Flex. All the points I mentioned in the blog…

Webmentions

  • Flash, Flex & Web service problems at Entrepreneur Geek March 31, 2011

    […] Unable to connect to endpoint – Flash Webservice problemFlex 2 and IE 7 beta’s outFDS install woes – space broke it?AJAX Ahoy – embraced by Laszlo and FlexFlex to go open source! […]