• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Consuming webservices using CF8

New Here ,
Sep 16, 2010 Sep 16, 2010

Copy link to clipboard

Copied

I recently upgraded to CF8 and I’m not able to consume webservices from my dev edition on my personal PC.

I have tried making my own simple test webservice, but I’m not able to consume them using CF. (I’m able to consume the ws using .Net or Java, but not from CF itself).

I always get the following error:

org.apache.axis.ConfigurationException: org.xml.sax.SAXException: Fatal Error: URI=null Line=40: The string "--" is not permitted within comments.

This is the code I’m using:

<cfscript>

wsargs = structnew();

wsargs.proxyServer = "proxy";

wsargs.proxyPort = "8080";

ws = createObject("webservice","http://ws.fraudlabs.com/zipcodeworldUS_webservice.asmx?wsdl",wsargs);

</cfscript>

I know that the WSDL is ok since the WS works in .Net and Java. I also know that I can retrieve the wsdl using

<cfhttp method="get" url="http://ws.fraudlabs.com/zipcodeworldUS_webservice.asmx?wsdl" result="myRes" proxyserver="proxy" proxyport="8080"/>

So why do I get the “The string "--" is not permitted within comments.” error?

I know that

  1. I get the same error for all ws I try to consume from CF, even simple test ws made using CF.
  2. The ws work, because I can consume them using .Net and Java.
  3. CFINVOKE gives me the same error

Thanks,

Olav, Oslo, Norway

TOPICS
Advanced techniques

Views

798

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 21, 2010 Sep 21, 2010

Copy link to clipboard

Copied

Have you tried the other methods of connecting to a webservice?

For instance by tag

<cfinvoke
              webservice="http://ws.fraudlabs.com/zipcodeworldUS_webservice.asmx?wsdl"
              method="post"
              returnvariable="httpResponse">
                <cfinvokeargument name="parameters" value="<xmlToSend>"/>

</cfinvoke>

Or by building up the CFHTTP call directly

<cfhttp
            url="http://ws.fraudlabs.com/zipcodeworldUS_webservice.asmx?wsdl"
            method="post"
            result="httpResponse">
            <cfhttpparam
                 type="header"
                 name="accept-encoding"
                value="no-compression"
             />
            <cfhttpparam
            type="header"
            name="SOAPAction"
            value="http://ws.fraudlabs.com/zipcodeworldUS_webservice"
            />
             <!---
                    When posting the SOAP body, use the CFHTTPParam type of
                    XML. This does two things: it posts the XML as a the BODY
                    and sets the mime-type to be XML.
            
                    NOTE: Be sure to Trim() your XML since XML data cannot be
                    parsed with leading whitespace.
                --->
            <cfhttpparam
                type="xml"
                value="#trim( orderXML )#"
                />
        </cfhttp>

I found fiddling around with all three methods of creating a webservice usually results in one that works

Regards

Joanne

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 28, 2010 Sep 28, 2010

Copy link to clipboard

Copied

LATEST

add the line:

wsargs.refreshWSDL="yes";

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation