3 Replies Latest reply on Oct 6, 2006 10:15 AM by ksmith

    HELP!!  Using SOAP with CF for webservice API

      I have been tasked with setting up a form that, in essence, has two actions. One is to collect all the form fields and deposit into our database, the other is to post this data to a broadcast email webservice via their API. I plan to do this on a single action page. The webservice provides an API to support this.

      They have defined the parameters that need to be sent in SOAP/XML format. I have never had to use this format or any kind of API integration with Cold Fusion in the past. I have read several posts indicating some usage of CFINVOKE or specific CFSCRIPTs. I have placed the SOAP code provided by the webservice below. Can someone take a look and give me a clue as to how to proceed here? My CF Code book is a version out or so and doesn't seem to have the CFINVOKE tag defined. Can I use WDDX? If so, How?

      I tried the code below and got this error:
      Name: http://app.campaignmonitor.com/api/api.asmx?WSDL. WSDL: http://app.campaignmonitor.com/api/api.asmx?WSDL. org.apache.axis.wsdl.toJava.DuplicateFileException: Duplicate file name: C:\CFusionMX7\stubs\WS1938286156\com\campaignmonitor\app\api\SubscriberUnsubscribe.java. Hint: you may have mapped two namespaces with elements of the same name to the same package name. 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.
        • 1. Re: HELP: Using SOAP with CF for API
          jasals Level 1
          Well I ended up using an HTTP GET using CFHTTP as shown in the code below... but they have a custom fields option and their Get documentation doesn't seem to support this - so i will still need a SOAP solution eventaully to use their custom fields.... just thought I'd put this in to help anyone who may be trying to just put in a simple Subscriber.Add
          • 2. Re: HELP!!  Using SOAP with CF for webservice API
            jasals Level 1
            SADLY, there is little or no clear documentation on how to handle webservices that utilize overloading of methods. Equally missing is any input from the Macromedia/Adobe team in these forums on it. There are many webservices out there that use overloading of methods... this needs to be addressed!

            Things used to be better in here... I miss the days of seeing many responses and Team Macromedia or Team Allaire getting involved in the difficult ones.

            Anyway - in case you are trying to accomplish this or a similar task. Try PHP. It works beautifully, I never thought I'd be the guy saying that in here! After being a huge fan of CF for 10 years, I am touting PHP for this task... though I guess Ben Forta does encourage using the best tool in the shed for the task - just suprised that I would have to use another application language for this.

            PHP, for this task, is very simple and straight forward, there is plenty of documentations and real world code examples to get you going via Google searches. Plus most shared servers running Cold Fusion also support PHP.

            I don't like to mix technologies in a web site, but due to Cold Fusion's apparent inability to handle this, I have had to resort to doing this.

            If you need specifics on how I did it, contact me and I will create a snippet that is sanitized for your use. Also you might want to look up other forum posts by me around Sept-Oct 2006 for other comments and code I tried in CF. Might save you a few failure steps with CF on your way to using the PHP route....
            • 3. Re: HELP!!  Using SOAP with CF for webservice API
              ksmith Level 1
              Please see your other post.