on 05-03-2013 4:49 PM
Hi Experts,
The integration scenario is SAP to Salesforce integration.
I am able to establish the connection to Salesforce and query interface in woking fine.
Now when I was trying to create an Account in the Salesforce, the <ns0:sObjects> is to be changed to <ns0:sObjects xsi:type="Account" xmlns="urn:enterprise.soap.sforce.com">
I have followed following sdn links and could develop Java mapping to establish connection with Salesforce.
Also I have followed the link http://scn.sap.com/message/13158048 to add the string replacement
Newpayload.replace("<ns0:sObjects>", "<ns0:sObjects xsi:type=\"Account\" xmlns=\'urn:enterprise.soap.sforce.com>"); //new code line to be added
But this also did not helped me to resolve the issue.
Anyone tried this similar interface or any tips will be much appreciated...
I also tried to create an XSLT map after the java map to add the attribute but of no use.
The error from the response message from Salesforce is
<soapenv:Fault>
<faultcode>sf:INVALID_TYPE</faultcode>
<faultstring>INVALID_TYPE: Must send a concrete entity type.</faultstring>
<detail>
<sf:InvalidSObjectFault xsi:type="sf:InvalidSObjectFault">
<sf:exceptionCode>INVALID_TYPE</sf:exceptionCode>
<sf:exceptionMessage>Must send a concrete entity type.</sf:exceptionMessage>
<sf:row>-1</sf:row>
<sf:column>-1</sf:column>
</sf:InvalidSObjectFault>
</detail>
</soapenv:Fault>
Please help.
hi.
Could you provide your xsl mapping or JavaMapping.?
I guees the problem is with the Output data.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for the reply..
I could find out the solution.
I have tweaked the java mapping program.
As per the doc: http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/802f8d03-9282-2d10-52b4-f9446e077...
I have added the necessary namespace in the java code to create SOAP envelope and
in addition to the code mentioned in the link
I have added below mentioned code:
--------------------------------------------------------
try
{
.
.
Newpaload = c.substring(len+1);//existing code.
/*New code to be added */
String Newpayload1 = "";
Newpayload1 = Newpayload.replaceAll("<ns0:sObjects>", "<ns0:sObjects xsi:type=\"Account\" xmlns=\"urn:enterprise.soap.sforce.com\">");
/*Remaining code same */
.
.
-------------------------------------------------------
Its working fine and I am able to get the response back from Salesforce.
If the response need to be mapped, you may have to add an XSLT mapping to remove soap envelope and extract only the soap body coming from salesforce and then map the output to any required graphical mapping to store the response Id or data from Salesforce.
XSLT code for anyone who is trying:
---------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output indent="yes"/>
<xsl:template match="@* | node()">
<xsl:copy>
<xsl:apply-templates select="@* | node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="soapenv:*">
<xsl:apply-templates select="@* | node()"/>
</xsl:template>
</xsl:stylesheet>
------------------------------------------------------------------------
Praveen.
User | Count |
---|---|
79 | |
9 | |
9 | |
7 | |
7 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.