You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by "Wallace Dennis Jr." <wa...@aonhewitt.com> on 2012/01/31 01:46:20 UTC

HELP: Issue with ADB & MTOMAwareOMBuilder

Hello,

I am trying to create a service to return a composite of response elements from other services.  I am able to successfully serialize the response by obtaining an OMElement like this:

                OMElement elem =
                    response.getOMElement(
                        GetDcDataResponse.MY_QNAME,
                        OMAbstractFactory.getOMFactory()
                        );
                String rspStr = elem.toString();
                System.out.println(rspStr);

This produces this output:

<ns5:getDcDataResponse xmlns:ns5="http://acme.com/dc/xsd">
    <ns5:responseHeader>
        <ns1:responseCode xmlns:ns1="http://acme.com/xsd/v1_0">0</ns1:responseCode>
        <ns1:responseDescription xmlns:ns1="http://acme.com/xsd/v1_0"></ns1:responseDescription>
    </ns5:responseHeader>
    <ns5:dcResponseData1>
        <Array1 xmlns="http://acme.com/dc/xsd/d1">
            <Id>10</Id>
            <TypeCode>BT</TypeCode>
            <Amount>0.0</Amount>
        </Array1>
        <Array1 xmlns="http://acme.com/dc/xsd/d1">
            <Id>10</Id>
            <TypeCode>RT</TypeCode>
            <Amount>0.0</Amount>
        </Array1>
        <ns3:ArrayCount xmlns:ns3="http://acme.com/dc/xsd/d1">4</ns3:ctrbRateArrayCount>
    </ns5:dcResponseData1>
    <ns5:dcResponseData2>
        <Array2 xmlns="http://acme.com/dc/xsd/d2">
            <Id>10</Id>
            <BrandCode>PB</BrandCode>
            <Amount>3232939.34</Amount>
        </Array2>
        <ns2:ArrayCount xmlns:ns2="http://acme.com/dc/xsd/d2">2</ns2:dcBalArrayCount>
    </ns5:dcResponseData2>
</ns5:getDcDataResponse>

My issue is that even though this is perfectly valid XML, the MTOMAwareOMBuilder chokes on this response because it is maintaining a list of prefix to namespace mappings and it incorrectly thinks that the "" prefix is trying to be used for both http://acme.com/dc/xsd/d1 and http://acme.com/dc/xsd/d2.   It seems like part of the problem is that the dcResponseData1 and dcResponseData2 ADB beans do not declare a MY_QNAME - they instead rely on the parent QName (see below):

        public  class DcResponseData1
        implements org.apache.axis2.databinding.ADBBean{
        /* This type was generated from the piece of schema that had
                name = DcResponseData1
                Namespace URI = http://acme.com/dc/xsd/d2
                Namespace Prefix = ns2
                */


        public  class DcResponseData2
        implements org.apache.axis2.databinding.ADBBean{
        /* This type was generated from the piece of schema that had
                name = DcResponseData2
                Namespace URI = http://acme.com/dc/xsd/d1
                Namespace Prefix = ns3
                */

Is there a way to force ADB to always create MY_QNAME on all generated beans so that there are no "" prefixes in the serialized XML or is there a way for me to not use the MTOMAwareOMBuilder?

Thanks,
Wally Dennis


Re: HELP: Issue with ADB & MTOMAwareOMBuilder

Posted by Amila Jayasekara <am...@wso2.com>.
Hi Wally,

This should be in Axis2 1.6.1 release.

Thanks
AmilaJ

On Tue, Jan 31, 2012 at 7:48 AM, Wallace Dennis Jr.
<wa...@aonhewitt.com> wrote:
> It appears as though my issue might be related to RAMPART-282.  Has this
> been incorporated into a release?  If so, what version?
>
>
>
> Thanks,
>
> Wally
>
>
>
>
>
> From: Wallace Dennis Jr. [mailto:wally.dennis@aonhewitt.com]
> Sent: Monday, January 30, 2012 7:46 PM
> To: java-user@axis.apache.org; java-dev@axis.apache.org
> Subject: HELP: Issue with ADB & MTOMAwareOMBuilder
>
>
>
> Hello,
>
>
>
> I am trying to create a service to return a composite of response elements
> from other services.  I am able to successfully serialize the response by
> obtaining an OMElement like this:
>
>
>
>                 OMElement elem =
>
>                     response.getOMElement(
>
>                         GetDcDataResponse.MY_QNAME,
>
>                         OMAbstractFactory.getOMFactory()
>
>                         );
>
>                 String rspStr = elem.toString();
>
>                 System.out.println(rspStr);
>
>
>
> This produces this output:
>
>
>
> <ns5:getDcDataResponse xmlns:ns5="http://acme.com/dc/xsd">
>
>     <ns5:responseHeader>
>
>         <ns1:responseCode
> xmlns:ns1="http://acme.com/xsd/v1_0">0</ns1:responseCode>
>
>         <ns1:responseDescription
> xmlns:ns1="http://acme.com/xsd/v1_0"></ns1:responseDescription>
>
>     </ns5:responseHeader>
>
>     <ns5:dcResponseData1>
>
>         <Array1 xmlns="http://acme.com/dc/xsd/d1">
>
>             <Id>10</Id>
>
>             <TypeCode>BT</TypeCode>
>
>             <Amount>0.0</Amount>
>
>         </Array1>
>
>         <Array1 xmlns="http://acme.com/dc/xsd/d1">
>
>             <Id>10</Id>
>
>             <TypeCode>RT</TypeCode>
>
>             <Amount>0.0</Amount>
>
>         </Array1>
>
>         <ns3:ArrayCount
> xmlns:ns3="http://acme.com/dc/xsd/d1">4</ns3:ctrbRateArrayCount>
>
>     </ns5:dcResponseData1>
>
>     <ns5:dcResponseData2>
>
>         <Array2 xmlns="http://acme.com/dc/xsd/d2">
>
>             <Id>10</Id>
>
>             <BrandCode>PB</BrandCode>
>
>             <Amount>3232939.34</Amount>
>
>         </Array2>
>
>         <ns2:ArrayCount
> xmlns:ns2="http://acme.com/dc/xsd/d2">2</ns2:dcBalArrayCount>
>
>     </ns5:dcResponseData2>
>
> </ns5:getDcDataResponse>
>
>
>
> My issue is that even though this is perfectly valid XML, the
> MTOMAwareOMBuilder chokes on this response because it is maintaining a list
> of prefix to namespace mappings and it incorrectly thinks that the "" prefix
> is trying to be used for both http://acme.com/dc/xsd/d1 and
> http://acme.com/dc/xsd/d2.   It seems like part of the problem is that the
> dcResponseData1 and dcResponseData2 ADB beans do not declare a MY_QNAME -
> they instead rely on the parent QName (see below):
>
>
>
>         public  class DcResponseData1
>
>         implements org.apache.axis2.databinding.ADBBean{
>
>         /* This type was generated from the piece of schema that had
>
>                 name = DcResponseData1
>
>                 Namespace URI = http://acme.com/dc/xsd/d2
>
>                 Namespace Prefix = ns2
>
>                 */
>
>
>
>
>
>         public  class DcResponseData2
>
>         implements org.apache.axis2.databinding.ADBBean{
>
>         /* This type was generated from the piece of schema that had
>
>                 name = DcResponseData2
>
>                 Namespace URI = http://acme.com/dc/xsd/d1
>
>                 Namespace Prefix = ns3
>
>                 */
>
>
>
> Is there a way to force ADB to always create MY_QNAME on all generated beans
> so that there are no "" prefixes in the serialized XML or is there a way for
> me to not use the MTOMAwareOMBuilder?
>
>
>
> Thanks,
>
> Wally Dennis
>
>
>
> ________________________________
>
>
> The information contained in this e-mail and any accompanying documents may
> contain information that is confidential or otherwise protected from
> disclosure. If you are not the intended recipient of this message, or if
> this message has been addressed to you in error, please immediately alert
> the sender by reply e-mail and then delete this message, including any
> attachments. Any dissemination, distribution or other use of the contents of
> this message by anyone other than the intended recipient is strictly
> prohibited. All messages sent to and from this e-mail address may be
> monitored as permitted by applicable law and regulations to ensure
> compliance with our internal policies and to protect our business. E-mails
> are not secure and cannot be guaranteed to be error free as they can be
> intercepted, amended, lost or destroyed, or contain viruses. You are deemed
> to have accepted these risks if you communicate with us by e-mail.



-- 
Mobile : +94773330538

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


Re: HELP: Issue with ADB & MTOMAwareOMBuilder

Posted by Amila Jayasekara <am...@wso2.com>.
Hi Wally,

This should be in Axis2 1.6.1 release.

Thanks
AmilaJ

On Tue, Jan 31, 2012 at 7:48 AM, Wallace Dennis Jr.
<wa...@aonhewitt.com> wrote:
> It appears as though my issue might be related to RAMPART-282.  Has this
> been incorporated into a release?  If so, what version?
>
>
>
> Thanks,
>
> Wally
>
>
>
>
>
> From: Wallace Dennis Jr. [mailto:wally.dennis@aonhewitt.com]
> Sent: Monday, January 30, 2012 7:46 PM
> To: java-user@axis.apache.org; java-dev@axis.apache.org
> Subject: HELP: Issue with ADB & MTOMAwareOMBuilder
>
>
>
> Hello,
>
>
>
> I am trying to create a service to return a composite of response elements
> from other services.  I am able to successfully serialize the response by
> obtaining an OMElement like this:
>
>
>
>                 OMElement elem =
>
>                     response.getOMElement(
>
>                         GetDcDataResponse.MY_QNAME,
>
>                         OMAbstractFactory.getOMFactory()
>
>                         );
>
>                 String rspStr = elem.toString();
>
>                 System.out.println(rspStr);
>
>
>
> This produces this output:
>
>
>
> <ns5:getDcDataResponse xmlns:ns5="http://acme.com/dc/xsd">
>
>     <ns5:responseHeader>
>
>         <ns1:responseCode
> xmlns:ns1="http://acme.com/xsd/v1_0">0</ns1:responseCode>
>
>         <ns1:responseDescription
> xmlns:ns1="http://acme.com/xsd/v1_0"></ns1:responseDescription>
>
>     </ns5:responseHeader>
>
>     <ns5:dcResponseData1>
>
>         <Array1 xmlns="http://acme.com/dc/xsd/d1">
>
>             <Id>10</Id>
>
>             <TypeCode>BT</TypeCode>
>
>             <Amount>0.0</Amount>
>
>         </Array1>
>
>         <Array1 xmlns="http://acme.com/dc/xsd/d1">
>
>             <Id>10</Id>
>
>             <TypeCode>RT</TypeCode>
>
>             <Amount>0.0</Amount>
>
>         </Array1>
>
>         <ns3:ArrayCount
> xmlns:ns3="http://acme.com/dc/xsd/d1">4</ns3:ctrbRateArrayCount>
>
>     </ns5:dcResponseData1>
>
>     <ns5:dcResponseData2>
>
>         <Array2 xmlns="http://acme.com/dc/xsd/d2">
>
>             <Id>10</Id>
>
>             <BrandCode>PB</BrandCode>
>
>             <Amount>3232939.34</Amount>
>
>         </Array2>
>
>         <ns2:ArrayCount
> xmlns:ns2="http://acme.com/dc/xsd/d2">2</ns2:dcBalArrayCount>
>
>     </ns5:dcResponseData2>
>
> </ns5:getDcDataResponse>
>
>
>
> My issue is that even though this is perfectly valid XML, the
> MTOMAwareOMBuilder chokes on this response because it is maintaining a list
> of prefix to namespace mappings and it incorrectly thinks that the "" prefix
> is trying to be used for both http://acme.com/dc/xsd/d1 and
> http://acme.com/dc/xsd/d2.   It seems like part of the problem is that the
> dcResponseData1 and dcResponseData2 ADB beans do not declare a MY_QNAME -
> they instead rely on the parent QName (see below):
>
>
>
>         public  class DcResponseData1
>
>         implements org.apache.axis2.databinding.ADBBean{
>
>         /* This type was generated from the piece of schema that had
>
>                 name = DcResponseData1
>
>                 Namespace URI = http://acme.com/dc/xsd/d2
>
>                 Namespace Prefix = ns2
>
>                 */
>
>
>
>
>
>         public  class DcResponseData2
>
>         implements org.apache.axis2.databinding.ADBBean{
>
>         /* This type was generated from the piece of schema that had
>
>                 name = DcResponseData2
>
>                 Namespace URI = http://acme.com/dc/xsd/d1
>
>                 Namespace Prefix = ns3
>
>                 */
>
>
>
> Is there a way to force ADB to always create MY_QNAME on all generated beans
> so that there are no "" prefixes in the serialized XML or is there a way for
> me to not use the MTOMAwareOMBuilder?
>
>
>
> Thanks,
>
> Wally Dennis
>
>
>
> ________________________________
>
>
> The information contained in this e-mail and any accompanying documents may
> contain information that is confidential or otherwise protected from
> disclosure. If you are not the intended recipient of this message, or if
> this message has been addressed to you in error, please immediately alert
> the sender by reply e-mail and then delete this message, including any
> attachments. Any dissemination, distribution or other use of the contents of
> this message by anyone other than the intended recipient is strictly
> prohibited. All messages sent to and from this e-mail address may be
> monitored as permitted by applicable law and regulations to ensure
> compliance with our internal policies and to protect our business. E-mails
> are not secure and cannot be guaranteed to be error free as they can be
> intercepted, amended, lost or destroyed, or contain viruses. You are deemed
> to have accepted these risks if you communicate with us by e-mail.



-- 
Mobile : +94773330538

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


RE: HELP: Issue with ADB & MTOMAwareOMBuilder

Posted by "Wallace Dennis Jr." <wa...@aonhewitt.com>.
It appears as though my issue might be related to RAMPART-282.  Has this been incorporated into a release?  If so, what version?

Thanks,
Wally


From: Wallace Dennis Jr. [mailto:wally.dennis@aonhewitt.com]
Sent: Monday, January 30, 2012 7:46 PM
To: java-user@axis.apache.org; java-dev@axis.apache.org
Subject: HELP: Issue with ADB & MTOMAwareOMBuilder

Hello,

I am trying to create a service to return a composite of response elements from other services.  I am able to successfully serialize the response by obtaining an OMElement like this:

                OMElement elem =
                    response.getOMElement(
                        GetDcDataResponse.MY_QNAME,
                        OMAbstractFactory.getOMFactory()
                        );
                String rspStr = elem.toString();
                System.out.println(rspStr);

This produces this output:

<ns5:getDcDataResponse xmlns:ns5="http://acme.com/dc/xsd">
    <ns5:responseHeader>
        <ns1:responseCode xmlns:ns1="http://acme.com/xsd/v1_0">0</ns1:responseCode>
        <ns1:responseDescription xmlns:ns1="http://acme.com/xsd/v1_0"></ns1:responseDescription>
    </ns5:responseHeader>
    <ns5:dcResponseData1>
        <Array1 xmlns="http://acme.com/dc/xsd/d1">
            <Id>10</Id>
            <TypeCode>BT</TypeCode>
            <Amount>0.0</Amount>
        </Array1>
        <Array1 xmlns="http://acme.com/dc/xsd/d1">
            <Id>10</Id>
            <TypeCode>RT</TypeCode>
            <Amount>0.0</Amount>
        </Array1>
        <ns3:ArrayCount xmlns:ns3="http://acme.com/dc/xsd/d1">4</ns3:ctrbRateArrayCount>
    </ns5:dcResponseData1>
    <ns5:dcResponseData2>
        <Array2 xmlns="http://acme.com/dc/xsd/d2">
            <Id>10</Id>
            <BrandCode>PB</BrandCode>
            <Amount>3232939.34</Amount>
        </Array2>
        <ns2:ArrayCount xmlns:ns2="http://acme.com/dc/xsd/d2">2</ns2:dcBalArrayCount>
    </ns5:dcResponseData2>
</ns5:getDcDataResponse>

My issue is that even though this is perfectly valid XML, the MTOMAwareOMBuilder chokes on this response because it is maintaining a list of prefix to namespace mappings and it incorrectly thinks that the "" prefix is trying to be used for both http://acme.com/dc/xsd/d1 and http://acme.com/dc/xsd/d2.   It seems like part of the problem is that the dcResponseData1 and dcResponseData2 ADB beans do not declare a MY_QNAME - they instead rely on the parent QName (see below):

        public  class DcResponseData1
        implements org.apache.axis2.databinding.ADBBean{
        /* This type was generated from the piece of schema that had
                name = DcResponseData1
                Namespace URI = http://acme.com/dc/xsd/d2
                Namespace Prefix = ns2
                */


        public  class DcResponseData2
        implements org.apache.axis2.databinding.ADBBean{
        /* This type was generated from the piece of schema that had
                name = DcResponseData2
                Namespace URI = http://acme.com/dc/xsd/d1
                Namespace Prefix = ns3
                */

Is there a way to force ADB to always create MY_QNAME on all generated beans so that there are no "" prefixes in the serialized XML or is there a way for me to not use the MTOMAwareOMBuilder?

Thanks,
Wally Dennis

________________________________

The information contained in this e-mail and any accompanying documents may contain information that is confidential or otherwise protected from disclosure. If you are not the intended recipient of this message, or if this message has been addressed to you in error, please immediately alert the sender by reply e-mail and then delete this message, including any attachments. Any dissemination, distribution or other use of the contents of this message by anyone other than the intended recipient is strictly prohibited. All messages sent to and from this e-mail address may be monitored as permitted by applicable law and regulations to ensure compliance with our internal policies and to protect our business. E-mails are not secure and cannot be guaranteed to be error free as they can be intercepted, amended, lost or destroyed, or contain viruses. You are deemed to have accepted these risks if you communicate with us by e-mail.

RE: HELP: Issue with ADB & MTOMAwareOMBuilder

Posted by "Wallace Dennis Jr." <wa...@aonhewitt.com>.
It appears as though my issue might be related to RAMPART-282.  Has this been incorporated into a release?  If so, what version?

Thanks,
Wally


From: Wallace Dennis Jr. [mailto:wally.dennis@aonhewitt.com]
Sent: Monday, January 30, 2012 7:46 PM
To: java-user@axis.apache.org; java-dev@axis.apache.org
Subject: HELP: Issue with ADB & MTOMAwareOMBuilder

Hello,

I am trying to create a service to return a composite of response elements from other services.  I am able to successfully serialize the response by obtaining an OMElement like this:

                OMElement elem =
                    response.getOMElement(
                        GetDcDataResponse.MY_QNAME,
                        OMAbstractFactory.getOMFactory()
                        );
                String rspStr = elem.toString();
                System.out.println(rspStr);

This produces this output:

<ns5:getDcDataResponse xmlns:ns5="http://acme.com/dc/xsd">
    <ns5:responseHeader>
        <ns1:responseCode xmlns:ns1="http://acme.com/xsd/v1_0">0</ns1:responseCode>
        <ns1:responseDescription xmlns:ns1="http://acme.com/xsd/v1_0"></ns1:responseDescription>
    </ns5:responseHeader>
    <ns5:dcResponseData1>
        <Array1 xmlns="http://acme.com/dc/xsd/d1">
            <Id>10</Id>
            <TypeCode>BT</TypeCode>
            <Amount>0.0</Amount>
        </Array1>
        <Array1 xmlns="http://acme.com/dc/xsd/d1">
            <Id>10</Id>
            <TypeCode>RT</TypeCode>
            <Amount>0.0</Amount>
        </Array1>
        <ns3:ArrayCount xmlns:ns3="http://acme.com/dc/xsd/d1">4</ns3:ctrbRateArrayCount>
    </ns5:dcResponseData1>
    <ns5:dcResponseData2>
        <Array2 xmlns="http://acme.com/dc/xsd/d2">
            <Id>10</Id>
            <BrandCode>PB</BrandCode>
            <Amount>3232939.34</Amount>
        </Array2>
        <ns2:ArrayCount xmlns:ns2="http://acme.com/dc/xsd/d2">2</ns2:dcBalArrayCount>
    </ns5:dcResponseData2>
</ns5:getDcDataResponse>

My issue is that even though this is perfectly valid XML, the MTOMAwareOMBuilder chokes on this response because it is maintaining a list of prefix to namespace mappings and it incorrectly thinks that the "" prefix is trying to be used for both http://acme.com/dc/xsd/d1 and http://acme.com/dc/xsd/d2.   It seems like part of the problem is that the dcResponseData1 and dcResponseData2 ADB beans do not declare a MY_QNAME - they instead rely on the parent QName (see below):

        public  class DcResponseData1
        implements org.apache.axis2.databinding.ADBBean{
        /* This type was generated from the piece of schema that had
                name = DcResponseData1
                Namespace URI = http://acme.com/dc/xsd/d2
                Namespace Prefix = ns2
                */


        public  class DcResponseData2
        implements org.apache.axis2.databinding.ADBBean{
        /* This type was generated from the piece of schema that had
                name = DcResponseData2
                Namespace URI = http://acme.com/dc/xsd/d1
                Namespace Prefix = ns3
                */

Is there a way to force ADB to always create MY_QNAME on all generated beans so that there are no "" prefixes in the serialized XML or is there a way for me to not use the MTOMAwareOMBuilder?

Thanks,
Wally Dennis

________________________________

The information contained in this e-mail and any accompanying documents may contain information that is confidential or otherwise protected from disclosure. If you are not the intended recipient of this message, or if this message has been addressed to you in error, please immediately alert the sender by reply e-mail and then delete this message, including any attachments. Any dissemination, distribution or other use of the contents of this message by anyone other than the intended recipient is strictly prohibited. All messages sent to and from this e-mail address may be monitored as permitted by applicable law and regulations to ensure compliance with our internal policies and to protect our business. E-mails are not secure and cannot be guaranteed to be error free as they can be intercepted, amended, lost or destroyed, or contain viruses. You are deemed to have accepted these risks if you communicate with us by e-mail.