1 Reply Latest reply on Jun 28, 2006 9:48 AM by Newsgroup_User

    How to connect to a web service??

    Level 7
      I am banging my head on how to produce the appropriate code to connect to a
      web service I created locally.

      I have a local web service:

      http://localhost:8500/cfc/getprojects.cfc?wsdl

      I am trying to figure out how to write a correct <mx:WebService> to connect
      to it so I can go on and bang my head on how to then bind the results to
      Labels.

      I am attempting to follow the manual on this topic but it goes all over the
      place and my newbie mind can't wrap my head around it.

      I tried this:
      <mx:WebService id="get_projects"
      wsdl=" http://localhost:8500/cfc/getprojects.cfc?wsdl" useProxy="false"/>
      </mx:WebService>

      But I keep getting: The prefix "mx" for element "mx:WebService" is not
      bound.

      I tried to find out more about it and thought I had to add:

      <mx peration name="getProjects">
      <mx:request>
      <projecttitle>????</projecttitle>
      </mx:request>
      </mx peration>

      But I have no idea on what to put in the request section per each title
      (<projecttitle>

      And anyone show me how to write a correct <mx:WebService> statement to be
      able to connect to my web service?!

      And if anyone is really bored:

      The query results in 5 fields of data (project_title, p_height, p_width,
      p_type, live)

      How do I then bind the project_title results to a label?
      --
      Wally Kolcz
      Developer / Support


        • 1. Re: How to connect to a web service??
          Level 7

          For a most basic exapmle you only need the operation. Anything inside
          there is a parameter that you want to pass to your webservice. So, if
          you wanted to pass a certain 'projecttitle', then you simply do what you
          did below. I don't know what your WebService looks like, so I don't know
          if you have any required parameters or not.

          In this case, the operation name should match a function name in your cfc.

          <mx:WebService id="get_projects"
          wsdl=" http://localhost:8500/cfc/getprojects.cfc?wsdl" useProxy="false"/>
          <mx:operation name="getProjects">
          </mx:operation>
          </mx:WebService>

          I hope that helps to get you going...



          Wally Kolcz wrote:
          > I am banging my head on how to produce the appropriate code to connect to a
          > web service I created locally.
          >
          > I have a local web service:
          >
          > http://localhost:8500/cfc/getprojects.cfc?wsdl
          >
          > I am trying to figure out how to write a correct <mx:WebService> to connect
          > to it so I can go on and bang my head on how to then bind the results to
          > Labels.
          >
          > I am attempting to follow the manual on this topic but it goes all over the
          > place and my newbie mind can't wrap my head around it.
          >
          > I tried this:
          > <mx:WebService id="get_projects"
          > wsdl=" http://localhost:8500/cfc/getprojects.cfc?wsdl" useProxy="false"/>
          > </mx:WebService>
          >
          > But I keep getting: The prefix "mx" for element "mx:WebService" is not
          > bound.
          >
          > I tried to find out more about it and thought I had to add:
          >
          > <mx:operation name="getProjects">
          > <mx:request>
          > <projecttitle>????</projecttitle>
          > </mx:request>
          > </mx:operation>
          >
          > But I have no idea on what to put in the request section per each title
          > (<projecttitle>)
          >
          > And anyone show me how to write a correct <mx:WebService> statement to be
          > able to connect to my web service?!
          >
          > And if anyone is really bored:
          >
          > The query results in 5 fields of data (project_title, p_height, p_width,
          > p_type, live)
          >
          > How do I then bind the project_title results to a label?