Skip to Content
avatar image
Former Member

SAP PI to SFDC

Hi All,

I am trying to send a message from SAP to SFDC using PI 7.1 EHP 1. I am getting the below error:

<?xml version="1.0" encoding="UTF-8" ?>

- http://schemas.xmlsoap.org/soap/envelope/" xmlns:sf="urn: fault.enterprise.soap.sforce.com" xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance">

- <soapenv:Body>

- <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>

</soapenv:Body>

</soapenv:Envelope>

I have a Java mapping which creates the SOAP message and I am using the option in SOAP adapterThis is what the code is sending to SF:

Using the Enterprise WSDL, the Java code does 2 things:

1) Using the User and Password+token to go out to SF to get a session ID to send out during the next step.

2) Creates the request body structure generated from the Enterprise WSDL.

However when the program retrieves the body structure (from #2), it send out <urn:sObjects>. I want to send <urn:sObjects xsi:type="urn1:Account"> instead of <urn:sObjects>. How do I achieve that.

This is what SF is expecting:

<soapenv:Body>

<urn:create>

<urn:sObjects xsi:type ="urn1:Account">

<Name>Canon, Inc.</Name>

</urn:sObjects>

</urn:create>

</soapenv:Body>

Here is a sample of what SF is expecting:

http://wiki.developerforce.com/index.php/Enterprise_Create

Thx in advance

Ravijeet

Edited by: RAVIJEET.SAP.PI on Mar 8, 2011 1:43 AM

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    Mar 08, 2011 at 01:22 AM

    Hello,

    Using the same java mapping, you can add

     xsi:type ="urn1:Account" 

    to

     <urn:sObjects> 

    Hope this helps,

    Mark

    Add comment
    10|10000 characters needed characters exceeded

    • Hello,

      I fetch the payload from the TransformationOutput arg1 ->Newpayload of java mapping and combine with upper string data to form the complete SOAP message. Where can we add xsi:type ="urn1:Account" ? Do I just do a plain string.replaceAll but that is not working.

      You can do this step:

      InputStream (InputStream inputStream = input.getInputPayload().getInputStream();) --> InputStreamReader --> BufferedReader

      Use BufferedReader to convert the input into a string and then you can use the string.replaceAll

      Hope this helps,

      Mark