Thursday, July 8, 2010

Using Soap Channel in SALES FORCE and using soap lookups

Technical concepts you learn
1. soap lookups in message mapping and javaMapping( parameterized mapping calling soap channel in message mapping).
2. using soap channels in Sales force.
3. Dynamically Setting soap receiver channel parameters.
4. useSoap Envlope Parameter in Receiver communication channel
Links for above things
if not use articles then select SOA integration section, select sales force use case.

simple exaplanation above topics using above docs
1. Behind machanisum in SALES FORCE
PI is able communicate with this using SOAP receiver.
but SALES FORCE has login webservice, application related webserices
first we need fallow this sequence 1.Login websercie 2. application related Webserice
1. Login Webserice provides you Target url and session id.
2. By using these two you can get required service.
So these services are inter - related and sequence manner.
soap ui , soap client( freely downloadable) we can test webserices.
Both of the webservices are getting from sales force website / 3rd party system.
2.Dynamically set soap receiver channel parameters.
3. Using Soap Lookup in message mapping.( from 2nd document)

lookup code.

public String calculateDiscount(String cust_no, String region, Channel
soapDiscount, Container container) throws StreamTransformationException{
SystemAccessor accessor = null;
String discount = "";
StringBuffer sb = new StringBuffer();
// 1. Get a system accessor for the channel.
accessor = LookupService.getSystemAccessor(soapDiscount);
// 2. Build up request
InputStream reqStream;
String reqString =""
+ "OrderDiscountRule xmlns:ns0=\"\">"
+ ""
+ ""+cust_no+" "+region+""
+ "0
+ "
reqStream = (InputStream) new
XmlPayload reqPayload = LookupService.getXmlPayload(reqStream);
// 3. Call BRM
XmlPayload resPayload = (XmlPayload);
// 4. Parse result
byte[] b = new byte[4096];
for (int n; (n = resPayload.getContent().read(b)) != -1;) {
sb.append(new String(b, 0, n));
int i =sb.indexOf("") + 10;
int j =sb.indexOf("
discount = sb.substring(i, j);
catch (Exception e) {
// TODO Auto-generated catch block
finally {
// 5. Close the accessor in order to free resources.
if (accessor!=null) accessor.close();
return discount;

Avoiding Brides in ccBPM using modules

file - RFC - file , or file- Soap - file , in these case we used the fallowing approach.

By using this modules we can acheive the same funcationality with out BPM also
Using Request Response Bean Module in FILE Adapter . user ful link from forum

sap pi help