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 "Edi Obradovic (JIRA)" <ji...@apache.org> on 2018/06/08 11:26:00 UTC
[jira] [Updated] (AXIS2-5919) Java classes generated from WSDL with
custom faults are missing parameters when calling toOM method
(axis2-codegen with axis2-jaxbri)
[ https://issues.apache.org/jira/browse/AXIS2-5919?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Edi Obradovic updated AXIS2-5919:
---------------------------------
Description:
We are currently unable to use newer version of axis2 because the Java classes generated by axis2-codegen and axi2-jaxbri have missing parameter errors.
When you generate Java classes from WSDL that uses custom faults you get errors in the newly generated classes: "The method toOM(TestFaultStruct, boolean, QName) in the type <class> is not applicable for the arguments (TestFaultStruct, boolean)". The reason you get that is because the QName parameter is missing when calling toOM in faults.
The error happens because:
- all toOM methods code is generated using JaxbRIDatabindingTemplate.xsl (axis2-jaxbri) and they all have QName parameter defined
- all custom faults code is generated using MessageReceiverTemplate.xsl (axis2-codegen) and if you look at the xsl code you can see that QName parameter is not there:
{code:xml}
<xsl:for-each select="fault-list/fault">
<xsl:if test="position()=1">}</xsl:if> catch (<xsl:value-of select="@name"/> e) {
msgContext.setProperty(org.apache.axis2.Constants.FAULT_NAME,"<xsl:value-of select="@localname"/>");
org.apache.axis2.AxisFault f = createAxisFault(e);
if (e.getFaultMessage() != null){
f.setDetail(toOM(e.getFaultMessage(),false));
}
throw f;
}
</xsl:for-each>
{code}
You can find the WSDL test file and generated class in the attachment.
Java call for WSDL2Java is also in the attachment.
Versions:
axis2-jaxbri: 1.7.7
axis2-codegen: 1.7.7
was:
We are currently unable to use newer version of axis2 because the Java classes generated by axis2-codegen have missing parameter errors.
When you generate Java classes from WSDL that uses custom faults you get errors in the newly generated classes: "The method toOM(TestFaultStruct, boolean, QName) in the type <class> is not applicable for the arguments (TestFaultStruct, boolean)". The reason you get that is because the QName parameter is missing when calling toOM in faults.
The error happens because:
- all toOM methods code is generated using MessageReceiverTemplate.xsl (axis2-codegen) and they all have QName parameter defined
- all custom faults code is generated using MessageReceiverTemplate.xsl (axis2-codegen) and if you look at the xsl code you can see that QName parameter is not there:
{code:xml}
<xsl:for-each select="fault-list/fault">
<xsl:if test="position()=1">}</xsl:if> catch (<xsl:value-of select="@name"/> e) {
msgContext.setProperty(org.apache.axis2.Constants.FAULT_NAME,"<xsl:value-of select="@localname"/>");
org.apache.axis2.AxisFault f = createAxisFault(e);
if (e.getFaultMessage() != null){
f.setDetail(toOM(e.getFaultMessage(),false));
}
throw f;
}
</xsl:for-each>
{code}
You can find the WSDL test file and generated class in the attachment.
Java call for WSDL2Java is also in the attachment.
Summary: Java classes generated from WSDL with custom faults are missing parameters when calling toOM method (axis2-codegen with axis2-jaxbri) (was: Java classes generated from WSDL with custom faults are missing parameters when calling toOM method)
> Java classes generated from WSDL with custom faults are missing parameters when calling toOM method (axis2-codegen with axis2-jaxbri)
> -------------------------------------------------------------------------------------------------------------------------------------
>
> Key: AXIS2-5919
> URL: https://issues.apache.org/jira/browse/AXIS2-5919
> Project: Axis2
> Issue Type: Bug
> Components: codegen
> Affects Versions: 1.7.7
> Reporter: Edi Obradovic
> Priority: Blocker
> Attachments: HelloService.wsdl, HelloServiceMessageReceiverInOut.java, WSDL2Java call.txt
>
>
> We are currently unable to use newer version of axis2 because the Java classes generated by axis2-codegen and axi2-jaxbri have missing parameter errors.
> When you generate Java classes from WSDL that uses custom faults you get errors in the newly generated classes: "The method toOM(TestFaultStruct, boolean, QName) in the type <class> is not applicable for the arguments (TestFaultStruct, boolean)". The reason you get that is because the QName parameter is missing when calling toOM in faults.
> The error happens because:
> - all toOM methods code is generated using JaxbRIDatabindingTemplate.xsl (axis2-jaxbri) and they all have QName parameter defined
> - all custom faults code is generated using MessageReceiverTemplate.xsl (axis2-codegen) and if you look at the xsl code you can see that QName parameter is not there:
> {code:xml}
> <xsl:for-each select="fault-list/fault">
> <xsl:if test="position()=1">}</xsl:if> catch (<xsl:value-of select="@name"/> e) {
> msgContext.setProperty(org.apache.axis2.Constants.FAULT_NAME,"<xsl:value-of select="@localname"/>");
> org.apache.axis2.AxisFault f = createAxisFault(e);
> if (e.getFaultMessage() != null){
> f.setDetail(toOM(e.getFaultMessage(),false));
> }
> throw f;
> }
> </xsl:for-each>
> {code}
> You can find the WSDL test file and generated class in the attachment.
> Java call for WSDL2Java is also in the attachment.
> Versions:
> axis2-jaxbri: 1.7.7
> axis2-codegen: 1.7.7
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: java-dev-unsubscribe@axis.apache.org
For additional commands, e-mail: java-dev-help@axis.apache.org