function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
ShaminaShamina 

Call Salesforce web service from ODI

Hello,

 

We have been able to connect ODI (Oracle Data Integrator) tool to a Salesforce Developer account and perform a reverse engineering process to load salesforce objects' data models into ODI.

 

We have developed an apex class with a web service method to call another batch apex class method available in the Salesforce developer account.

 

Our requirement is to call the web service method (hence the batch apex) from ODI. In salesforce, we have downloaded the partner.wsdl and generated the wsdl file for global apex class which contains the web service method. In ODI, there is a tool called ODiInvokeWebService which can be used to call a wsdl file. When we referenced the wsdl file for the apex class and invoke the method which will call the batch apex, we are having the following error message in ODI:

 

com.sunopsis.wsinvocation.SnpsWSInvocationException: INVALID_SESSION_ID: Invalid Session ID found in SessionHeader: Illegal Session

 at com.sunopsis.wsinvocation.client.a.a.d.requestReply(d.java)
 at com.sunopsis.graphical.wsclient.f.b(f.java)
 at com.sunopsis.graphical.tools.utils.swingworker.v.call(v.java)
 at edu.emory.mathcs.backport.java.util.concurrent.FutureTask.run(FutureTask.java:176)
 at com.sunopsis.graphical.tools.utils.swingworker.l.run(l.java)
 at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:665)
 at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:690)
 at java.lang.Thread.run(Thread.java:662)

at com.sunopsis.wsinvocation.client.a.a.d.requestReply(d.java)

 at com.sunopsis.graphical.wsclient.f.b(f.java) at com.sunopsis.graphical.tools.utils.swingworker.v.call(v.java)

 at edu.emory.mathcs.backport.java.util.concurrent.FutureTask.run(FutureTask.java:176)

 at com.sunopsis.graphical.tools.utils.swingworker.l.run(l.java)

 at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:665) at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:690)

at java.lang.Thread.run(Thread.java:662)

 

 

The issue is that, we are also able to initiate a login using the partner.wsdl in ODI but we do not know how to pass the session ID value to the global apex class wsdl. The only method in the global apex class wsdl available to call from ODI, is the web service method to call the batch apex. There is no login method as such as in partner.wsdl.

 

Can you please tell us a way to create a valid session which will allow us to call the batch apex in Salesforce?

 

Thanks and Regards,

Shamina

Via_ETLVia_ETL

I have a similar issue when calling a web service from ODI to Salesforce.com.  In order to get past the invalid session ID I first call a login web service and store the session id from the login to a variable that is passed in the header section of the next web service call.  The issue I now has is that I am receiving the error below.

 

com.sunopsis.wsinvocation.SnpsWSInvocationException: Part does not exist:Header
 at com.sunopsis.wsinvocation.client.a.d.a(d.java)
 at com.sunopsis.wsinvocation.client.a.d.a(d.java)
 at com.sunopsis.wsinvocation.client.a.d.b(d.java)
 at com.sunopsis.wsinvocation.client.a.c.a(c.java)
 at com.sunopsis.wsinvocation.client.a.c.getWebServiceRequestByOperation(c.java)
 at com.sunopsis.dwg.tools.InvokeWebService.actionExecute(InvokeWebService.java)
 at com.sunopsis.dwg.function.SnpsFunctionBase.execute(SnpsFunctionBase.java)
 at com.sunopsis.dwg.dbobj.SnpSessTaskSql.execIntegratedFunction(SnpSessTaskSql.java)
 at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTaskTrt(SnpSessTaskSql.java)
 at com.sunopsis.dwg.dbobj.SnpSessTaskSqlS.treatTaskTrt(SnpSessTaskSqlS.java)
 at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTask(SnpSessTaskSql.java)
 at com.sunopsis.dwg.dbobj.SnpSessStep.treatSessStep(SnpSessStep.java)
 at com.sunopsis.dwg.dbobj.SnpSession.treatSession(SnpSession.java)
 at com.sunopsis.dwg.cmd.DwgCommandSession.treatCommand(DwgCommandSession.java)
 at com.sunopsis.dwg.cmd.DwgCommandBase.execute(DwgCommandBase.java)
 at com.sunopsis.dwg.cmd.e.k(e.java)
 at com.sunopsis.dwg.cmd.g.A(g.java)
 at com.sunopsis.dwg.cmd.e.run(e.java)
 at java.lang.Thread.run(Thread.java:595)

The XML being requested is:

<?xml version ="1.0"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="http://soap.sforce.com/schemas/class/EmployeeReferralOpportuntiesController">
   <soapenv:Header>
      <urn:PackageVersionHeader>
      </urn:PackageVersionHeader>
      <urn:MruHeader>
         <urn:updateMru>false</urn:updateMru>
      </urn:MruHeader>
      <urn:QueryOptions>
      </urn:QueryOptions>
      <urn:SessionHeader>
         <urn:sessionId>#P_SF_Session_id</urn:sessionId>
      </urn:SessionHeader>
   </soapenv:Header>
   <soapenv:Body>
      <urn:getEmployeeReferralOpportunitiesRequest>
        <urn:getEmployeeReferralOpportunities>
          <startDate>2011-09-01</startDate>
   <endDate>2011-10-31</endDate>
  </urn:getEmployeeReferralOpportunities>
      </urn:getEmployeeReferralOpportunitiesRequest>
   </soapenv:Body>
</soapenv:Envelope>

 

 

Any assistance one can offer as to how to pass the sessionid successfully would be greatly appreciated.

 

Thanks

 

Alicia

BharaniBharani

Hi Shamina,

Via_ODIVia_ODI

We have found that the best way to pull and push information from SalesForce.com using ODI is via calls to Data Loader using command line calls.  We attempted to utilize the web service functionality; however, we found that this was not the best option for us due to the inability to edit the XML header within ODI.  In order to login to SF.com using the Web Service you must login and then capture a session id (or something similar, I am recalling this from memory) and pass it back in the XML header.  Within ODI you can not edit the XML header which prevented us from utilizing this functionality.  There was also an option of turning off this requirement, and passing in a token, but this much less secure as you are then using a public web service.  We opted to utilize Data Loader rather than risk a public web service as we are passing customer information to and from SF.com.

 

If you utilize data loader you need to create batch scripts and configuration files but the documentation is pretty clear on how this can be done. 

ShaminaShamina
Hello Bharani,

We used the Salesforce connector available within ODI tool. Actually at that time, we were investigating possibilities to integrate ODI with Salesforce but due to connection issues and unability to resolve them, we did not go ahead with this.

Check if the data loader alternative proposed by "Via_ODI" can help you

Best Regards