Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.
-
Mike@Jobscience #1
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
-
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... -
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... -
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... -
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. ... -
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... -
Sfumato #2
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



Reply With Quote

