Home > Default > Issue while posting XML to BAPI_LEAD_CREATE

Issue while posting XML to BAPI_LEAD_CREATE

October 11Hits:0
Advertisement
I am stuck while trying to HTTP post an XML to Gateway Service which calls the  BAPI_LEAD_CREATE in SAP CRM. The request is posted from the REST CLIENT In Firefox and i get an non descriptive HTTP 400 error in response
<?xml version="1.0" encoding="utf-8"?><error xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"><code/><message xml:lang="en">
System expected the element '{&amp;EXPECTED_NAMESPACE&amp;}&amp;EXPECTED_NAME&amp;'</message>
</error>
I am unable to figure what the issue is, because i have used the Standard atom Envelope for the Request Body and have ensured the required data elements are present in the XML string
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<atom:entry
xmlns:atom="http://www.w3.org/2005/atom"
xmlns:d="http://schemas.microsoft.com/ado/2007/08/dataservices"
xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata">
<atom:content type="application/xml">
<m:properties>
<d:value>[email protected]x,com</d:value>
<d:scheme_id>Z_CRM_LEAD_FINAL</d:scheme_id>
<d:scheme_agency_id>E61</d:scheme_agency_id>
<d:process_type_1>dmy1</d:process_type_1>
<d:lead_type>dmy1</d:lead_type>
<d:process_type_2>L</d:process_type_2>
<d:lead_type_1>dmy2</d:lead_type_1>
<d:partner_fct>L</d:partner_fct>
<d:title_p>M</d:title_p>
<d:firstname>sriram</d:firstname>
<d:lastname>vasudevan</d:lastname>
<d:city>bangalore</d:city>
<d:street>sjri</d:street>
<d:street_no>20</d:street_no>
<d:country>india</d:country>
<d:region>karnataka</d:region>
<d:tel1_numbr>900-000-002</d:tel1_numbr>
<d:fax_number>900-000-002</d:fax_number>
<d:partner_fct_1>C</d:partner_fct_1>
<d:title_p_1>M</d:title_p_1>
<d:firstname_1>sriram</d:firstname_1>
<d:lastname_1>vasudevan</d:lastname_1>
<d:city_1>C</d:city_1>
<d:street_1>C</d:street_1>
<d:street_no_1>S</d:street_no_1>
<d:country_1>I</d:country_1>
<d:region_1>T</d:region_1>
<d:e_mail>[email protected],com</d:e_mail>
<d:tel1_numbr_1>9</d:tel1_numbr_1>
<d:fax_number_1>9</d:fax_number_1>
</m:properties>
</atom:content>
</atom:entry>
Any help with this is appreciated.

Answers

Chandan
Couldn't figure out your reply on the payload, i have instead attached the Metadata for your reference, can you help me structure the payload
... Metadata
<?xml version="1.0" encoding="utf-8" ?>
<edmx:Edmx Version="1.0" xmlns:edmx="http://schemas.microsoft.com/ado/2007/06/edmx" xmlns:gp="http://www.sap.com/Protocols/SAPData/GenericPlayer" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns:sap="http://www.sap.com/Protocols/SAPData">
<edmx:DataServices m:DataServiceVersion="2.0">
<Schema Namespace="Z_CRM_LEAD_FINAL" xmlns="http://schemas.microsoft.com/ado/2008/09/edm">
<EntityType Name="z_crm_lead_final" m:HasStream="false" sap:content-version="1">
<Key>
<PropertyRef Name="scheme_id" />
<PropertyRef Name="scheme_agency_id" />
<PropertyRef Name="value" />
</Key>
<Property Name="row" Type="Edm.Int32" sap:label="Lines in parameter" sap:creatable="false" sap:updatable="false" sap:filterable="false" />
<Property Name="log_no" Type="Edm.String" MaxLength="20" sap:label="Log number" sap:creatable="false" sap:updatable="false" sap:filterable="false" />
<Property Name="process_type_1" Type="Edm.String" MaxLength="4" sap:label="Transaction Type" sap:creatable="true" sap:updatable="false" sap:filterable="false" />
<Property Name="street_no" Type="Edm.String" MaxLength="12" sap:label="Street Code" sap:creatable="true" sap:updatable="false" sap:filterable="false" />
<Property Name="partner_fct_1" Type="Edm.String" MaxLength="1" sap:label="Updated info. user data field" sap:creatable="true" sap:updatable="false" sap:filterable="false" />
<Property Name="tel1_numbr_1" Type="Edm.String" MaxLength="1" sap:label="Updated info. user data field" sap:creatable="true" sap:updatable="false" sap:filterable="false" />
<Property Name="firstname" Type="Edm.String" MaxLength="40" sap:label="First name" sap:creatable="true" sap:updatable="false" sap:filterable="false" />
<Property Name="message_v4" Type="Edm.String" MaxLength="50" sap:label="Message Variable" sap:creatable="false" sap:updatable="false" sap:filterable="false" />
<Property Name="parameter" Type="Edm.String" MaxLength="32" sap:label="Parameter Name" sap:creatable="false" sap:updatable="false" sap:filterable="false" />
<Property Name="message_v2" Type="Edm.String" MaxLength="50" sap:label="Message Variable" sap:creatable="false" sap:updatable="false" sap:filterable="false" />
<Property Name="field" Type="Edm.String" MaxLength="30" sap:label="Field name" sap:creatable="false" sap:updatable="false" sap:filterable="false" />
<Property Name="scheme_id" Type="Edm.String" Nullable="false" MaxLength="30" sap:creatable="false" sap:updatable="false" sap:filterable="false" />
<Property Name="country" Type="Edm.String" MaxLength="3" sap:label="Country Key" sap:creatable="true" sap:updatable="false" sap:filterable="false" />
<Property Name="fax_number" Type="Edm.String" MaxLength="30" sap:label="Fax" sap:creatable="true" sap:updatable="false" sap:filterable="false" />
<Property Name="e_mail" Type="Edm.String" MaxLength="241" sap:label="E-Mail Address" sap:creatable="true" sap:updatable="false" sap:filterable="false" />
<Property Name="number" Type="Edm.String" MaxLength="3" sap:label="Message number" sap:creatable="false" sap:updatable="false" sap:filterable="false" />
<Property Name="scheme_agency_id" Type="Edm.String" Nullable="false" MaxLength="16" sap:creatable="false" sap:updatable="false" sap:filterable="false" />
<Property Name="system" Type="Edm.String" MaxLength="10" sap:label="Logical system (source of message)" sap:creatable="false" sap:updatable="false" sap:filterable="false" />
<Property Name="title_p_1" Type="Edm.String" MaxLength="1" sap:label="Updated info. user data field" sap:creatable="true" sap:updatable="false" sap:filterable="false" />
<Property Name="partner_fct" Type="Edm.String" MaxLength="8" sap:label="Partner Function" sap:creatable="true" sap:updatable="false" sap:filterable="false" />
<Property Name="message_v1" Type="Edm.String" MaxLength="50" sap:label="Message Variable" sap:creatable="false" sap:updatable="false" sap:filterable="false" />
<Property Name="street" Type="Edm.String" MaxLength="60" sap:label="Street" sap:creatable="true" sap:updatable="false" sap:filterable="false" />
<Property Name="lead_type" Type="Edm.String" MaxLength="4" sap:label="Lead Group" sap:creatable="true" sap:updatable="false" sap:filterable="false" />
<Property Name="process_type_2" Type="Edm.String" MaxLength="1" sap:label="Updated info. user data field" sap:creatable="true" sap:updatable="false" sap:filterable="false" />
<Property Name="message_v3" Type="Edm.String" MaxLength="50" sap:label="Message Variable" sap:creatable="false" sap:updatable="false" sap:filterable="false" />
<Property Name="lastname" Type="Edm.String" MaxLength="40" sap:label="Last name" sap:creatable="true" sap:updatable="false" sap:filterable="false" />
<Property Name="street_1" Type="Edm.String" MaxLength="1" sap:label="Updated info. user data field" sap:creatable="true" sap:updatable="false" sap:filterable="false" />
<Property Name="title_p" Type="Edm.String" MaxLength="30" sap:label="Title" sap:creatable="true" sap:updatable="false" sap:filterable="false" />
<Property Name="region" Type="Edm.String" MaxLength="3" sap:label="Region" sap:creatable="true" sap:updatable="false" sap:filterable="false" />
<Property Name="lastname_1" Type="Edm.String" MaxLength="1" sap:label="Updated info. user data field" sap:creatable="true" sap:updatable="false" sap:filterable="false" />
<Property Name="region_1" Type="Edm.String" MaxLength="1" sap:label="Updated info. user data field" sap:creatable="true" sap:updatable="false" sap:filterable="false" />
<Property Name="log_msg_no" Type="Edm.String" MaxLength="6" sap:label="Message serial no." sap:creatable="false" sap:updatable="false" sap:filterable="false" />
<Property Name="type" Type="Edm.String" MaxLength="1" sap:label="Message type" sap:creatable="false" sap:updatable="false" sap:filterable="false" />
<Property Name="country_1" Type="Edm.String" MaxLength="1" sap:label="Updated info. user data field" sap:creatable="true" sap:updatable="false" sap:filterable="false" />
<Property Name="tel1_numbr" Type="Edm.String" MaxLength="30" sap:label="Telephone" sap:creatable="true" sap:updatable="false" sap:filterable="false" />
<Property Name="firstname_1" Type="Edm.String" MaxLength="1" sap:label="Updated info. user data field" sap:creatable="true" sap:updatable="false" sap:filterable="false" />
<Property Name="street_no_1" Type="Edm.String" MaxLength="1" sap:label="Updated info. user data field" sap:creatable="true" sap:updatable="false" sap:filterable="false" />
<Property Name="message" Type="Edm.String" MaxLength="220" sap:label="Message text" sap:creatable="false" sap:updatable="false" sap:filterable="false" />
<Property Name="id" Type="Edm.String" MaxLength="20" sap:label="Message Class" sap:creatable="false" sap:updatable="false" sap:filterable="false" />
<Property Name="city" Type="Edm.String" MaxLength="40" sap:label="City" sap:creatable="true" sap:updatable="false" sap:filterable="false" />
<Property Name="city_1" Type="Edm.String" MaxLength="1" sap:label="Updated info. user data field" sap:creatable="true" sap:updatable="false" sap:filterable="false" />
<Property Name="value" Type="Edm.String" Nullable="false" MaxLength="72" sap:creatable="true" sap:updatable="false" sap:filterable="false" />
<Property Name="fax_number_1" Type="Edm.String" MaxLength="1" sap:label="Updated info. user data field" sap:creatable="true" sap:updatable="false" sap:filterable="false" />
<Property Name="lead_type_1" Type="Edm.String" MaxLength="1" sap:label="Updated info. user data field" sap:creatable="true" sap:updatable="false" sap:filterable="false" />
</EntityType>
<EntityContainer Name="Z_CRM_LEAD_FINAL" m:IsDefaultEntityContainer="true">
<EntitySet Name="z_crm_lead_finalCollection" EntityType="Z_CRM_LEAD_FINAL.z_crm_lead_final" sap:content-version="1" sap:creatable="true" sap:updatable="false" sap:deletable="false" />
</EntityContainer>
</Schema>
</edmx:DataServices>
</edmx:Edmx>
--> ....
Appreciate your help on this.

Read other 5 answers

Tags:

Related Articles

  • Issue while posting XML to BAPI_LEAD_CREATEOctober 11

    I am stuck while trying to HTTP post an XML to Gateway Service which calls the  BAPI_LEAD_CREATE in SAP CRM. The request is posted from the REST CLIENT In Firefox and i get an non descriptive HTTP 400 error in response <?xml version="1.0" enc

  • Issue with inbound xml..October 11

    Hi All, We have an issue with inbound XML : XML structure is as follows: <?xml version="1.0" encoding="UTF-8" ?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://ww

  • How to fix iframe issue that displays XML values instead of formatted XML in IE11October 11

    The following sub.jsp file shows the formatted XML properly as expected when is opened directly: <% response.setContentType("text/xml"); %> <book> <chapter1>chapter 1</chapter1> <chapter2>chapter 2</chapter2>

  • Performance Issues with large XML (1-1.5MB) filesOctober 11

    Hi, I'm using an XML Schema based Object relational storage for my XML documents which are typically 1-1.5 MB in size and having serious performance issues with XPath Query. When I do XPath query against an element of SQLType varchar2, I get a good p

  • Issue with uploading XML file from application server into internal tableOctober 11

    i Need to fetch the XML file from the application server and place into internal table and i am getting error message while using the functional module   SMUM_XML_PARSE and the error message is "line   1 col   1-unexpected symbol; expected '<', '&

  • Facing issue while reading XML file 'LPX-00217: 'October 11

    Hi Gurus, I am facing one issue while reading the xml file in the one my 11g database instance. The same file if I ran in another instance then it is working fine for me. I presume it will be related to NLS character. Please help me in finding out ch

  • Issue in loading XML data in BW delta queueOctober 11

    Hello All, My requirement is to stage small amount of XML data in SAP BW. For doing so, i have followed below steps... 1. Create File data source 2. Define Myself data source using file data source with Function module 3. Initialize load process with

  • Data Services Fix Pack 12.2.1.2 issued to resolve XML loader problemOctober 11

    We've had a few customers contacting us about the following error message: "The message type for datastore <my_ds> has not been set". Please notify Customer Support" Note that the text "<my_ds> will be the name of the XML l

  • MOPZ has issues calculating stack XML file in SOLUTION MANAGEROctober 11

    Hello, We have a SOLUTION MANAGER system on NW 7.0 EHP1 SP stack level at initial support stack (ISS). Recently we upgraded all our R/3 systems to ECC6.0 EHP4 SPS04 and now we are trying to upgrade the stack level to EHP4 SPS07. So we are trying to g

  • Namespace issue while generating XML based on xsdOctober 11

    Hi All, I am using Jdeveloper-11.1.1.6 SOA:- 11.1.1.6 WLS:- 11.3.6 When i am publishing xml message i am getting name space issue. My process design as i am getting a message from AQ JMS and doing a transformation with out any logic and writing into

Copyright (C) 2019 wisumpire.com, All Rights Reserved. webmaster#wisumpire.com 14 q. 0.870 s.