XML Serialization Error- While testing BAPI turned Web service
I have a requirement to create sales order in SAP R/3 from an e-commerce site. I went through many forums suggesting "exposing FMs into Web Service". I wrapped BAPI_SALESORDER_CREATEFROMDAT2 and BAPI_TRANSACTION_COMMIT into one FM and exposed as Web Service. I did a successful test-sequence.
When I tested the web service without giving values I got a response asking for "Sold-to Party or Ship-To Party". While testing the Web service with some values, I got the below error -
XML Serialization Error. Object content does not correspond to Schema restrictions of type [urn:sap-com:document:sap:rfc:functions][numeric4].
The e-commerce team tried to hit the Web service and got the below error-
IWAB0383E Error validating parameters
Note: Our servers does not have any ENHPacks. Only ECC 6.0.
Please suggest what might have gone wrong and how to resolve this.
Gourav Khare replied
Please check WSDL of webservice for correct format of data type (XSD data type is not similar to ABAP data type), you can see the hint: numeric4.
Search wsdl for numeric4 datatype (usually you will find it in the beginning of WSDL)
- <xsd:simpleType name="numeric4"> - <xsd:restriction base="xsd:string"> <xsd:maxLength value="4" /> <xsd:pattern value="\d*" /> </xsd:restriction> </xsd:simpleType>
and make sure your input value is comply with restriction of datatype.