cancel
Showing results for 
Search instead for 
Did you mean: 

No filing ABAP structure when the response is defined with a complextype with a choice sentence

Antonio_leites
Participant
0 Kudos

Hi, we have defined an ABAP client proxy to consume a Web Service which response it is defined with a complextype using a choice.

<xs:complexType name="Ie115V1SalType">

     <xs:choice>

       <xs:element ref="Sal101:IE101"/>

       <xs:element ref="Sal104:IE104"/>

      </xs:choice>

</xs:complexType>

The ResponsePaylod is working fine but we get nothing in ABAP, I mean when the proxy has to map from the Payload to the ABAP structures it does not work.

Just to check where the problem is we modified the proxy removing the choice complexType and using only one structure for the output and in this case the ABAP structure is filled up correctly. So we guess the problem is related with the choice sentence.

We also checked this with two different systems and the behavior is the same..... (NW 7.01 SP13 and NW 7.01 SP12)

Do you have any similiar experence?

Regards,

Antonio

Accepted Solutions (0)

Answers (3)

Answers (3)

Antonio_leites
Participant
0 Kudos

By the way, the error we get is: "GENERAL ERROR - PART UNKNOWN (NULL) occur.

And with a payload trace from transaction SRT_UTIL we can show a correct response.

Antonio_leites
Participant
0 Kudos

We made a further investigation and we found that the problem is that the qualified part name does not match with what the program expects.

In our case the output is defined by:

<wsdl:message name="Salida">

    <wsdl:part name="Ie115V1Sal" type="Ie115V1:Ie115V1SalType"/>

</wsdl:message>

where

<xs:complexType name="Ie115V1SalType">

     <xs:choice>

       <xs:element ref="Sal101:IE101"/>

       <xs:element ref="Sal104:IE104"/>

      </xs:choice>

</xs:complexType>

So in the payload the part name is  IE101 or IE104 and what the program expects is Salida.

It seems like the complexType for the response does not work. We tried with xs:sequence and with xs:all instead of xs:choice and the same behavior. The system always expects Salida as part name instead of the name of the value of the field selection of choice.

We guess the problem is in this class

CL_WS_PROXY_RUNTIME_OUTBOUND


When XML data is deserialized the field SELECTION  should be filled accordingly. The system uses that class to get the observer that is utilized to compare with the observer gotten from the payload with the class CL_SXMLP_DEFAULT_OBSERVER.

and the problem is that the class CL_WS_PROXY_RUNTIME_OUTBOUND does not get the right name for the qualified part name.

So I wonder if the problem is with the definition of the WSDL or is with the use of a ComplexType for the output.

Any hint is welcome.

Regards,

Antonio

iaki_vila
Active Contributor
0 Kudos

Hi Antonio,

Have you checked that the structure has been correctly generated in R/3?, i have got one, in this way:

Pay attention that choice is not a XML tag.

Try to regenerate the proxy, or delete and create again.

Check that your proxy inbound XML is right. I have had problems when the XML had the two tags under the choice tag, this is incorrect and it's normal that the proxy doesnt generete any tag.

Regards.

Antonio_leites
Participant
0 Kudos

Hi iñaki,

yes, the abap structure seems to be generated propertly:

and clicking CHOICE:

What kind of problems did you get? At generation level or at runtime level?

When we trace the call we get the ResponsePayload.xml file filled, but we face the problem at the abap part of the mapping.

regards,

Antonio

iaki_vila
Active Contributor
0 Kudos

Hi Antonio,

It was a silly problem that occurred to me in runtime proccesing, have you checked that IE101 and IE104 are not generated at the same time?, one of the two tags doesnt must exist, even with no data but generated failed.

Regards.

Antonio_leites
Participant
0 Kudos

  Hi Iñaki,
I do not understand what you mean with "one of the two tags doesnt must exist". Following the documentation when using xsd:choice the generated ABAP structure has a field named SELECTION and a field for each possible choice. The current choice is determined by the value of the field SELECTION. (The value of SELECTION must be the name of the chosen field in upper case). When the ABAP data is serialized the field addressed by SELECTION is used. When XML data is deserialized the field SELECTION is filled accordingly.

In our case the SELECTION field is always empty and we do not know why.

Regards,

Antonio

markangelo_dihiansan
Active Contributor
0 Kudos

Hello Antonio,

According to this document,

http://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/708cff46-1569-2a10-40bf-90694e16c...


xsd choice is not supported in PI 7.1 in both ABAP and Java Proxies. Just use complexType with sequence as a workaround.

Hope this helps,

Mark

Antonio_leites
Participant
0 Kudos

Hi Mark,

thanks for you quickly anwser, but the document you point out is out of date. In SAP note 944029  you can find the most up to date document of the supported xml schema elements and for 7.00 and 7.01 the choice element is supported.

markangelo_dihiansan
Active Contributor
0 Kudos

Hello Antonio,

It could be that your ECC system is using SAP BASIS 7.00 SP13 and below.

Regards,

Mark

Antonio_leites
Participant
0 Kudos

Hi Mark,

that is not the case, the system is 7.01 SP13 and the other one where we tried 7.01 SP7.

Have you ever tried an abap proxy with a complextype with the xsd choice?

markangelo_dihiansan
Active Contributor
0 Kudos

Hello Antonio,

Yup, I have already tried it but it did not work. That is why I re-edited the xsd to use complexType with xsd:sequence. Apologies for the very late reply.

Regards,

Mark