IBM webMethods Hybrid Integration

IBM webMethods Hybrid Integration

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
Expand all | Collapse all

Salesforce.com

webMethods Community Member

webMethods Community MemberWed October 05, 2005 04:10 AM

webMethods Community Member

webMethods Community MemberThu October 27, 2005 06:10 PM

  • 1.  Salesforce.com

    Posted Mon October 03, 2005 09:08 PM

    I did a search for salesforce.com and came back with nothing. What am I missing? People must use webMethods to integrate with salesforce.com, right?


    #API-Management
    #soa
    #webMethods


  • 2.  RE: Salesforce.com

    Posted Mon October 03, 2005 09:40 PM

    Hello,

    Yemi Bedu


    #API-Management
    #webMethods
    #soa


  • 3.  RE: Salesforce.com

    Posted Tue October 04, 2005 12:26 AM

    Chris,

    Assuming that the Salesforce API used web services, you could take the first steps, but generating Web Services Connectors from the WSDL files provided by the vendor.

    After getting something up and working using Web Services Connectors, I prefer to modify them to read things like endpoint addresses and login credentials from properties files or database tables and to attempt the pub.client:soapHTTP invoke inside of a retry loop for better fault tolerance.

    Depending on the service levels of the SF server, you might first publish the soap message to the broker and create a separate service to attempt to send it to the SF server. That way, you have two levels of retry, one inside the Flow and another controlled by the trigger.

    The good news is that no application adapters are needed to connect to SalesForce.com.

    Mark


    #webMethods
    #API-Management
    #soa


  • 4.  RE: Salesforce.com

    Posted Tue October 04, 2005 05:46 PM

    Thanks for the good info. I have the enterprise WSDL from salesforce.com. From this, I can create the web service connectors. These allow me to log in, get a session id, and do all of the activities I need in order to integrate.

    The problem I am facing is that the CRUD methods take a very loosely-type object as their input. The foundation for these types is a salesforce SObject. The business objects extend the SObject. For example, the basic building block for sf.com is an Account.

    The WSDL describes what an Account is. When I pull the WSDL into Developer to create the web service connectors, the document that represents Account is nowhere to be found.

    I can create an ad-hoc Account in Developer, but that doesn’t seem right to me.

    What am I missing here?


    #soa
    #API-Management
    #webMethods


  • 5.  RE: Salesforce.com

    Posted Tue October 04, 2005 08:01 PM

    Not sure why the web services connector is not generating doc types from the WSDL.

    If you open the WSDL, you will see one or more embedded schemas describing inputs and outputs. The definition for the Account element should be there. You can manually extract the schema to your file system and create document types from that.

    One other thought, some WSDL files import schema definitions. If the one for SF.com does that, make sure you have it in the same location as your WSDL (or in the schemaLocation it is looking for).

    HTH,

    Mark


    #soa
    #webMethods
    #API-Management


  • 6.  RE: Salesforce.com

    Posted Tue October 04, 2005 08:38 PM

    There is an import statement in the WSDL with no schemaLocation attribute. Because of this, XML Spy complains when the WSDL is validated.

    Thanks for the info, Mark.


    #soa
    #webMethods
    #API-Management


  • 7.  RE: Salesforce.com

    Posted Wed October 05, 2005 04:10 AM

    Ahhhh. Is it working OK now?


    #soa
    #webMethods
    #API-Management


  • 8.  RE: Salesforce.com

    Posted Wed October 05, 2005 01:52 PM

    Not yet, but I am learning a lot about XML. I am trying to figure out the best way to resolve this.

    I can open the WSDL w/ XML Spy, and from it, I can edit the schemas. Spy warns that namespaces are defined by imports that do not have corresponding prefixes, and offers to create them. After answering yes to have them created, XML Spy says that the schemaLocation is missing and will be ignored.

    If I had this schema, and I put it in the same folder as my WSDL, this wouldn’t be a problem.


    #soa
    #API-Management
    #webMethods


  • 9.  RE: Salesforce.com

    Posted Wed October 05, 2005 03:40 PM

    You’ll have to obtain the schema before you can either use the web services connector to generate Flow to invoke the web service (WSDL2Flow) or to create the document types correctly so that you can write your own Flow to do so.

    In essence, the WSDL is not complete unless the publisher provides all of the referenced types.

    Mark


    #soa
    #API-Management
    #webMethods


  • 10.  RE: Salesforce.com

    Posted Thu October 27, 2005 03:46 PM

    I am having the same issues as Chris. Has anybody successfully used the update API to update an Account? If so, how?


    #webMethods
    #API-Management
    #soa


  • 11.  RE: Salesforce.com

    Posted Thu October 27, 2005 04:03 PM

    Try SiebelOnDemand. I got their web services up and running in a matter of minutes.

    But seriously, you have to address the fact that there isn’t enough information in their WSDL to create the business objects (like Account, AccountContactRole, AccountShare, Asset, …) in webMethods Developer.


    #API-Management
    #soa
    #webMethods


  • 12.  RE: Salesforce.com

    Posted Thu October 27, 2005 04:57 PM

    Well, if the SF.com WSDL imports an XML schema that defines these objects, then I would argue that as long as they provide the schema, then they have provided “enough information in their WSDL”.

    If you don’t have all of the imported schemas then you don’t have the complete WSDL and you can not proceed.

    Mark


    #webMethods
    #soa
    #API-Management


  • 13.  RE: Salesforce.com

    Posted Thu October 27, 2005 06:10 PM

    I agree with your argument, Mark.


    #soa
    #webMethods
    #API-Management


  • 14.  RE: Salesforce.com

    Posted Mon December 19, 2005 11:39 PM

    Looks like Salesforce.com requires you to generate the WSDL file using an administrative function which can be found by logging into your Salesforce.com account (or free developer account) and navigating to Setup->CustomForce->Integrate-WSDL Generator. This function allows you to generate a WSDL file specific to your organization and includes custom fields your company may have added (or deleted).

    The AppExchangeAPI Quick Start docs cover the steps required to do this. Once you have your WSDL you would generate IS web services connectors (FLOWs) from that WSDL.

    Chris, was this how you obtained your WSDL? Did it generate the schemas that were referenced in the WSDL as imports?

    Mark


    #webMethods
    #soa
    #API-Management


  • 15.  RE: Salesforce.com

    Posted Tue December 20, 2005 12:48 PM

    Yes, this is how I obtained my WSDL. Salesforce.com did not provide the schemas referenced in the WSDL.


    #webMethods
    #soa
    #API-Management


  • 16.  RE: Salesforce.com

    Posted Tue December 20, 2005 04:27 PM

    The “enterprise.wsdl” generated by the development server defines three different schemas in the “types” section.

    Each of these schemas has a namespace and two of them import the definitions of one of the other schemas. The third schema which defines the enumerations of error types for the fault messages does not appear to depend on the other two.

    These three schemas can be extracted, as I’m guessing you have done, into individual XSD files. The first two must use import statements to reference each other.

    These XSD files can be imported as Integration Server schemas and used to create document types for the Salesforce.com operations that you need to support.

    IS will generate document types when creating web service connectors, but will not generate the doc types (or mapping statements) to create header elements and add them to the soap request.

    I was able to generate a web services connector from the enterprise.wsdl file. I could run the login service with no changes, but had to create a document type to be used to build the SessionHeader document to hold the sessionId returned by the login service. This SessionHeader doc must be added as a soap header in subsequent service calls.

    You must also use the URL retuned by the login message as the endpoint address in subsequent calls. Once I figured that out, I had the getServerTimestamp service up and running in no time.

    The Salesforce.com development server could process the login request and subsequent getServerTimestamp request in 2-4 seconds on average. I’m sure this would be a bit longer for servers with production-level data volumns and transaction loads.

    BTW, the attached XML file contains a valid getServerTimestamp request showing the SessionHeader soap header containing the sessionId. The sessionId and endpoint address are two of the parameters returned by the login request.

    Mark

    (Message edited by admin on December 20, 2005)


    #soa
    #webMethods
    #API-Management


  • 17.  RE: Salesforce.com

    Posted Fri December 23, 2005 11:48 PM

    Simon Fell, of PocketSoap fame, blogged recently about the impact of enabling various performance tuning recommendations when using the Salesforce.Com web services API.

    The biggest impact was relating to enabling GZip compression on the https request/response.

    Simon used PocketSoap to creat a simple utility for assessing the impact of these tuning suggestions called sforceExporter. sforceExporter connects to a sforce server (including the server that is accessible with a free developer account) and exports the contents of one of the sforce object types. It has command line switches to disable the keepalive, readahead and gzip compression options as well as to configure the batch size.

    Read Simon’s blog post on this topic here

    Mark


    #API-Management
    #soa
    #webMethods


  • 18.  RE: Salesforce.com

    Posted Mon September 18, 2006 04:54 PM

    Hi Roger,

    I am facing the same problem… not able to update Account. Could you please share the solution? I get the message " Destination URL not reset. The URL returned from login must be set in the SforceService".

    Any idea what to do with the serverUrl/endpoint addresses ?

    Regards,
    Sandesh Tak


    #API-Management
    #webMethods
    #soa


  • 19.  RE: Salesforce.com

    Posted Wed March 14, 2007 05:58 PM

    Hi Mark

    I am also trying to integrate with salesforce.com. Can you please guide me in the process. I found the following posting from you.

    How exactly you added the session ID and serverurl to the soap header. Can you attach a sample

    Thanks

    [FONT=Arial]The “enterprise.wsdl” generated by the development server defines three different schemas in the “types” section. [/font]

    Each of these schemas has a namespace and two of them import the definitions of one of the other schemas. The third schema which defines the enumerations of error types for the fault messages does not appear to depend on the other two.

    These three schemas can be extracted, as I’m guessing you have done, into individual XSD files. The first two must use import statements to reference each other.

    These XSD files can be imported as Integration Server schemas and used to create document types for the Salesforce.com operations that you need to support.

    IS will generate document types when creating web service connectors, but will not generate the doc types (or mapping statements) to create header elements and add them to the soap request.

    I was able to generate a web services connector from the enterprise.wsdl file. I could run the login service with no changes, but had to create a document type to be used to build the SessionHeader document to hold the sessionId returned by the login service. This SessionHeader doc must be added as a soap header in subsequent service calls.

    You must also use the URL retuned by the login message as the endpoint address in subsequent calls. Once I figured that out, I had the getServerTimestamp service up and running in no time.

    The Salesforce.com development server could process the login request and subsequent getServerTimestamp request in 2-4 seconds on average. I’m sure this would be a bit longer for servers with production-level data volumns and transaction loads.

    [I]BTW, the attached XML file contains a valid getServerTimestamp request showing the SessionHeader soap header containing the sessionId. The sessionId and endpoint address are two of the parameters returned by the login request.
    [/i]


    #API-Management
    #webMethods
    #soa


  • 20.  RE: Salesforce.com

    Posted Wed March 14, 2007 06:52 PM

    You need to create a document type matching the structure of the SessionHeader element. You can do this manually by creating a new doc type from scratch or by creating the doc type from a XSD extracted from the SF.Com WSDL.

    Once you have a document type, populate it in a MAP step with the sessionID and URL returned from the login operation. Then convert it to a node and add it to the soap request using pub.soap.utils:addHeaderEntry.

    I don’t have any examples and will not be creating any. This should get you started.
    HTH,

    Mark


    #webMethods
    #API-Management
    #soa


  • 21.  RE: Salesforce.com

    Posted Wed March 14, 2007 09:53 PM

    Mark, Thanks for the quick reply. The document type should have only sessionID and serverURL or do I need to have the entire structure like other imported documents

    Thanks


    #soa
    #webMethods
    #API-Management


  • 22.  RE: Salesforce.com

    Posted Wed March 14, 2007 10:19 PM

    You need to match exactly the structure of the SessionHeader element as described in the WSDL’s types section.

    Mark


    #webMethods
    #soa
    #API-Management


  • 23.  RE: Salesforce.com

    Posted Mon November 05, 2007 11:04 PM

    Hi

    I was trying to integrate with salesforce.com and this thread has been very helpful . I had to struggle a bit to get the the getServerTimestamp working. I am attaching sample code so that others can take this a reference to start .

    Note : In order to use this ,you should have a developer account with salesforce.

    [URL=“Developer Portal | Salesforce Developers”]http://www.salesforce.com/developer/[/URL]

    Sample soap messages can be found @ [url]http://wiki.apexdevnet.com/index.php/Sample_SOAP_Messages[/url]

    Thanks
    Srini
    getServerTimestamp.zip (12.3 KB)


    #API-Management
    #webMethods
    #soa


  • 24.  RE: Salesforce.com

    Posted Tue March 23, 2010 04:17 PM

    I am also facing a similar issue. We are using webMetods 7.1.2 with latest webservices fixes.
    The login connector works fine and returing the sessionID and server URL.
    But the upsert connector webservice is not preparing the soap body by using the pub.client.soapClient.

    HTTP Get <?xml version="1.0" encoding="UTF-8"?>
    <SOAP-ENV:Envelope xmlns:SOAP-ENV=“[URL]http://schemas.xmlsoap.org/soap/envelope/[/URL]” xmlns:SOAP-ENC=“[URL]http://schemas.xmlsoap.org/soap/encoding/[/URL]” xmlns:xsd=“[URL]http://www.w3.org/2001/XMLSchema[/URL]” xmlns:xsi=“[URL]http://www.w3.org/2001/XMLSchema-instance[/URL]”>
    <SOAP-ENV:Header xmlns:SOAP-ENV=“http://schemas.xmlsoap.org/soap/envelope/”><tns:SessionHeader xmlns:tns=“urn:enterprise.soap.sforce.com”>
    tns:sessionIdXXXXX</tns:sessionId></tns:SessionHeader></SOAP-ENV:Header>
    SOAP-ENV:Body
    </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>

    I am creating soap header and body for upsert request using soap util services now and sending the request to salesforce now using pub.client.soapHTTP.

    Has someone been able to update/upsert to salesforce successfully from webMethods using the connectors generated from salesforce enterprise wsdl without any modification on the doctypes and connectors.


    #API-Management
    #webMethods
    #soa