The SOAP Challenge - SUCCESS!!!

Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.

  1. #1

    Default Re: The SOAP Challenge - SUCCESS!!!

    Like others in this discussion, I've been able to run queries via the
    webservice api calls, however cannot get CF to create objects using the objects
    created by the wsdl. I've created a .jar file and placed it in both the
    cfmx/lib and my java class path folder ( set in the cf admin ). However I
    still get the message: Class not found:
    com.sforce.soap.enterprise.sobject.Account I'm running this on CFMX 7, as I
    can't get CFMX 6 to recognize the wsdl file.

    Mike@Jobscience Guest

  2. Similar Questions and Discussions

    1. The SOAP Challenge - SF says we can't do it!
      altimage, I am trying to do the same thing with the SABRE web services.... Could you post an example of a "wrapper classes that actually interact...
    2. The SOAP Challenge - SF says we can't do it!
      Sfumato : I tried your code you posted on SalesNet API instead of SalesForce but received the error "soap:Client Server did not recognize the...
    3. Writing a HTML/ASP SOAP client for a SOAP::Lite destination
      How would I go about writing a SOAP client in either HTML or classic asp? The SOAP "listener" was written in Perl with SOAP::Lite in Unix and I am...
    4. Problem of using apache soap to consume WSE 2.0 soap attachment
      I developed a web service at .NET with WSE 2.0 attachming soap attachment with soap response, and I can write a .NET client app to consume it. ...
    5. SOAP Client creation in ASP.NET using MS SOAP Toolkit
      how would I create a SOAP client in ASP.Net? The following code just works fine in VB: Dim lobjSOAP As New MSSOAPLib30.SoapClient30...
  3. #2

    Default Re: The SOAP Challenge - SUCCESS!!!

    I utilized Sean's connection code (see his post in this thread.. thanks Sean!),
    which allows you to perform a number of operations against the SalesForce API,
    including query and describGlobal. But like the rest, I was unable to perform
    the create operation without utilizing Java classes. For those who prefer to
    not use Java, a work-around to this problem is to POST the SOAP message
    envelope to the endpoint address (usually something like
    [url]https://na1-api.salesforce.com/services/Soap/c/6.0[/url]). Examples of SOAP messages
    are found at [url]http://www.sforce.com/resources/api.jsp[/url]

    So you would use the WS to login to SalesForce, as Sean demonstrated, and get
    your sessionId and serverUrl. Then use those values in a CFHTTP POST to submit
    SOAP message envelopes. See the example of "create" a "Lead" below. Note that
    your can simply swap out "Lead" for "Account" or "Contact" or anything else you
    want to create. The only thing is that you will have to parse the response,
    which is also a SOAP Message.


    <cfsavecontent variable="soap_packet"><cfoutput><?xml version="1.0"
    encoding="UTF-8"?>
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <soapenv:Header>
    <ns1:SessionHeader soapenv:mustUnderstand="0"
    xmlns:ns1="urn:enterprise.soap.sforce.com">
    <ns2:sessionId
    xmlns:ns2="urn:enterprise.soap.sforce.com">#sales_ force_sessionId#</ns2:sessionI
    d>
    </ns1:SessionHeader>
    </soapenv:Header>
    <soapenv:Body>
    <create xmlns="urn:enterprise.soap.sforce.com">
    <sObjects xsi:type="ns3:Lead"
    xmlns:ns3="urn:sobject.enterprise.soap.sforce.com" >
    <ns3:FirstName>Jesse</ns3:FirstName>
    <ns3:LastName>Monson</ns3:LastName>
    <ns3:Company>IX Studios</ns3:Company>
    <!--- And any other fields --->
    <!--- See [url]http://www.sforce.com/resources/api.jsp[/url] for SOAP Message examples
    --->
    <!--- See [url]http://www.sforce.com[/url] for documentation on the fields you can
    send. --->
    </sObjects>
    </create>
    </soapenv:Body>
    </soapenv:Envelope>
    </cfoutput>
    </cfsavecontent>

    <cfhttp url="#sales_force_serverUrl#" method="POST">
    <cfhttpparam type="HEADER" name="Content-Type" value="text/xml;
    charset=utf-8">
    <cfhttpparam type="HEADER" name="Accept" value="application/soap+xml,
    application/dime, multipart/related, text/*">
    <cfhttpparam type="HEADER" name="User-Agent" value="Axis/1.1">
    <cfhttpparam type="HEADER" name="Host" value="na1.salesforce.com">
    <cfhttpparam type="HEADER" name="Cache-Control" value="no-cache">
    <cfhttpparam type="HEADER" name="Pragma" value="no-cache">
    <!--- Leave SOAPAction blank. --->
    <cfhttpparam type="HEADER" name="SOAPAction" value="">
    <cfhttpparam type="HEADER" name="Content-Length"
    value="#len(trim(soap_packet))#">
    <cfhttpparam type="BODY" value="#trim(soap_packet)#">
    </cfhttp>

    <cfoutput>
    #cfhttp.fileContent#
    </cfoutput>

    Sfumato 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