cancel
Showing results for 
Search instead for 
Did you mean: 

Conversion XML to ABAP

former_member185171
Participant
0 Kudos

Hello,

From a provider we get the following XSD from a response message:

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://xxx" targetNamespace="http://yyy">

<xsd:element name="loginResponse" type="loginResponse" />

<xsd:complexType name="loginResponse">

<xsd:sequence>

<xsd:element name="result" type="xsd:string" />

</xsd:sequence>

</xsd:complexType>

</xsd:schema>

His actual response looks like this:

<SOAP-ENV:loginResponse

xmlns:SOAP-ENV='http://schemas.xmlsoap.org/soap/envelope/'

xmlns:SOAPENC='http://schemas.xmlsoap.org/soap/encoding/'

xmlns:xsd='http://www.w3.org/2001/XMLSchema'

xmlns:xsi='http://www.w3.org/2001/XMLSchema-Instance'>

<Result xsi:type='xsd:string'>artv8uv38gvqu05gjohv26g8l5</Result>

</SOAP-ENV:loginResponse>

PI accepts this well, but during the conversion from XML to ABAP we get the following error:

PARSE_APPLICATION_DATA Error during XML => ABAP conversion (Response Message; error ID: CX_ST_MATCH_ELEMENT; (/1SAI/TXS3656E9BD8

Error during XML => ABAP conversion (Response Message; error ID: CX_ST_MATCH_ELEMENT; (/1SAI/TXS3656E9BD8A34AE8B7F16 XML Bytepos

Element 'loginResponse' verwacht

I have the impression that there is a problem with the namespace and wonder how I can solve this. I do not know enough about XML to judge if the returned XML is valid according to the definition. Maybe the problem lies there.

Thanks for any help.

Kris

Accepted Solutions (0)

Answers (2)

Answers (2)

stefan_grube
Active Contributor
0 Kudos

in your xsd, result is small.

In the SOAP message Result starts with a capital.

XML is case sensitive.

former_member185171
Participant
0 Kudos

I hadn't noticed, but it makes no difference. It seems to me as if the system does not get that far.

Kris

stefan_grube
Active Contributor
0 Kudos

You are right. The error is the root node:

SOAP-ENV:loginResponse

This prefix is not allowed.

It should be something like this:

<loginResponse xmlns="http://xxx"

Edited by: Stefan Grube on Aug 23, 2010 4:35 PM

former_member185171
Participant
0 Kudos

Stefan,

I asked our provider to omit these prefixes.

This might help.

Thanks.

Kris

vkaushik82
Active Participant
0 Kudos

Problem is because of xmlns="http://xxx

you need to change xmlns="http://xxx to xmlns="http://www.w3.org/2001/XMLSchema-Instance"

then try if it works.

former_member185171
Participant
0 Kudos

Seems to make no difference.

Kris