You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by "Siyana Slavova (Jira)" <ji...@apache.org> on 2021/08/02 09:46:00 UTC

[jira] [Commented] (AXIS2-5939) Axis2 not parsing correctly query parameters after upgrading xml schema

    [ https://issues.apache.org/jira/browse/AXIS2-5939?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17391468#comment-17391468 ] 

Siyana Slavova commented on AXIS2-5939:
---------------------------------------

The code does not actually go to the runtime exception thrown by service.
Since this is old defect I needed to debug the service also. The OMElement is not correctly parsed when the service is called as REST and the parameter requests are not added in the soap envelope. The cause is that it is not correctly parsed in BuilderUtil.buildsoapMessage method. 

I attached 2 code snippets - the current axis code (axis code snippet.txt) and possible fix (modified.txt).

You could debug the service in both cases - as a SOAP and as REST and to see the differences.

I use SOAPUi for both SOAP and REST.

> Axis2 not parsing correctly query parameters after upgrading xml schema
> -----------------------------------------------------------------------
>
>                 Key: AXIS2-5939
>                 URL: https://issues.apache.org/jira/browse/AXIS2-5939
>             Project: Axis2
>          Issue Type: Bug
>    Affects Versions: 1.7.8
>            Reporter: Siyana Slavova
>            Assignee: Robert Lazarski
>            Priority: Critical
>         Attachments: Echo.aar, MyService.aar, axis code snippet.txt, modified.txt
>
>
> *Steps to reproduce:*
>  # Deploy sample Echo.aar in axis 2.
>  # Call [http://localhost:8080/axis2/services/MyService/echoOMElement?in=in]
>  # Check the response.
> *Expected behaviour:*
>  The response should be 200 ok and the om element should be properly echoed.
> *Actual behaviour:*
>  The response is 500. Internally null pointer is thrown because the OMElement parameter in echoOMElement is null. The cause is that it is not correctly parsed in BuilderUtil.buildsoapMessage method. The parameter requests are not added in the soap envelope.
> On previous version of axis (before changing the schema) the qName of the particle element was null (on row 145), but after upgrading it is not and the program does not enter the if method, so the parameters are not added. See the code snippet
> {code:java}
> XmlSchemaParticle particle = complexType.getParticle();
> if (particle instanceof XmlSchemaSequence || particle instanceof XmlSchemaAll) {
>     if (particle instanceof XmlSchemaSequence) {
>         XmlSchemaSequence sequence = (XmlSchemaSequence) particle;
>         // now we need to know some information from the binding operation.
>         for (XmlSchemaSequenceMember sequenceMember : sequence.getItems()) {
>             XmlSchemaElement innerElement = (XmlSchemaElement) sequenceMember;
>             QName qName = innerElement.getWireName();
>             // ignoring the elements without proper type and minoccurs zero
>             if ((innerElement.getSchemaTypeName() == null) &&
>                 (innerElement.getMinOccurs() == 0)) {
>                 continue;
>             }
>             if (qName == null && innerElement.getSchemaTypeName()
>                     .equals(org.apache.ws.commons.schema.constants.Constants.XSD_ANYTYPE)) {
>                 createSOAPMessageWithoutSchema(soapFactory, bodyFirstChild,
>                                                requestParameterMap);
>                 break;
>             }
>             checkMinOccurs(innerElement, qName, soapFactory, requestParameterMap,
>                            bodyFirstChild);
>         }
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org