CFINVOKE Web Services Problem

Ask a Question related to Coldfusion - Getting Started, Design and Development.

  1. #1

    Default CFINVOKE Web Services Problem

    First to say I know nothing about SOAP, XML etc but need to connect to a
    webservice. Running the attached code just generates a HTTP/1.1 405 Method not
    allowed error which is not very informative.

    Please can anyone shed any light on any errors I may have in my code?

    many thanks



    <CFCONTENT type="text/xml">
    <CFSAVECONTENT VARIABLE="soapmessage">
    <?xml version="1.0" encoding="utf-8"?>
    <soap:Envelope
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Body>
    <Login xmlns="http://www.XYZ.com/authentication_3_1/">
    <UserName>#username#</UserName>
    <Password>#Password#</Password>
    </Login>
    </soap:Body>
    </soap:Envelope>
    </CFSAVECONTENT>
    <cfoutput>
    <CFCONTENT type="text/html">
    <CFHTTP URL="http://dev.XYZ.com/clients/wsdl/authentication_3_1.wsdl"
    METHOD="post" RESOLVEURL="false">
    <CFHTTPPARAM TYPE="XML" VALUE="#soapmessage#">
    </CFHTTP>
    <cfdump var="#cfhttp#">
    </cfoutput>

    Jon Cooper Guest

  2. Similar Questions and Discussions

    1. CFInvoke Tag... dumb question
      Hi, I would like to know if the CFInvoke tag is available for all versions of CF or just CFMX7? Is it supported on a default install? If not,...
    2. CFINVOKE
      Hi, I've a problem invoking 2 cfc's in one function which has same return variable. please see the below code. my question is how does it affect...
    3. using cfinvoke
      Can I use <!--- file abc.cfc---> <cfcomponent> <cffunction> <cfquery> </cfquery> <cfreturn xyz> </cffunction> </cfcomponent>
    4. Consuming .Net Webservice with CFInvoke
      I am trying to consume a .Net Webservice and am having a problem. The webservice takes an array of string objects as a parameter, but when I try to...
    5. passing structures using cfinvoke.
      Quick question. Can I create a structure in a cfc and then return in? If so does anyone have a simple example. Thanks.
  3. #2

    Default Re: CFINVOKE Web Services Problem

    Have you tried changing the cfhttp method from POST to GET? That's caused me problems in the past...
    Fychan66 Guest

  4. #3

    Default Re: CFINVOKE Web Services Problem

    First of all, remove all <CFCONTENT> tags. Has nothing to do with what you are
    trying to achieve. Instead use <CFHTTPHEADER> to set Content-Type to
    "text/xml". Or <CFHTTPPARAM TYPE="XML"> already does it? Never could remeber
    this. Also, usually, SOAPAction header is required, but maybe not. Check the
    description of your service.

    Mr Black Guest

  5. #4

    Default Re: CFINVOKE Web Services Problem

    I'd have to agree I'm afraid. I got a version of your code running (see below)
    by going to [url]http://soapclient.com/soaptest.html[/url] and asking for the Request code
    to be shown (instead of the default Response) and putting that into a variable
    (soapmessage). It worked just fine for me.

    <cftry>
    <cfset soapmessage = '<output from http://soapclient.com/soaptest.html>'>
    <CFHTTP URL="http://my.mindsweep.net/MindSoap" METHOD="get"
    RESOLVEURL="false">
    <CFHTTPPARAM TYPE="XML" VALUE="#soapmessage#">
    </CFHTTP>
    <cfset tmp = XMLNew()>
    <cfset tmp = XmlParse( cfhttp.filecontent, true )>
    <cfdump var="#tmp#">
    <cfcatch>
    <cfdump var="#cfcatch#">
    </cfcatch>
    </cftry>

    Fychan66 Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139