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 "Roel Verbunt (JIRA)" <ji...@apache.org> on 2007/12/21 15:42:43 UTC
[jira] Commented: (AXIS2-3017) WSDL generation error - lowercasing
1st char in element names
[ https://issues.apache.org/jira/browse/AXIS2-3017?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12553952 ]
Roel Verbunt commented on AXIS2-3017:
-------------------------------------
Hi,
I'm experiencing the same kind of problem with Axis2 1.3, but coming from another aspect. This time I have to create a webservice based on a WSDL using all capitalized properties. This works fine for top-level leaves but not for leaves on a lower level. I looked at the 1.4 fixes but didn't find a fix for this issue among them.
The argument that property names should follow Java coding conventions is not valid in my opinion. SOAP services are a good interface for connecting all kind of applications, both Java and non-Java. Because this WSDL applies to other providers, changing the interface (eg. with the underscore trick) is not an option.
In my case our middleware (BizTalk -> M$) needs a callback service for recieving pdf-documents with this schema:
:
<s:schema elementFormDefault="qualified" targetNamespace="...">
<s:element name="DeliverDocumentsCallback">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="TrackingID" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="CorrelationID" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="Result" type="tns:Result" />
<s:element minOccurs="0" maxOccurs="1" name="Documents" type="tns:ArrayOfDocument" />
</s:sequence>
</s:complexType>
</s:element>
<s:complexType name="Result">
<s:sequence>
<s:element minOccurs="1" maxOccurs="1" name="Code" type="s:int" />
<s:element minOccurs="0" maxOccurs="1" name="Description" type="s:string" />
</s:sequence>
</s:complexType>
<s:complexType name="ArrayOfDocument">
<s:sequence>
<s:element minOccurs="0" maxOccurs="unbounded" name="Document" nillable="true" type="tns:Document" />
</s:sequence>
</s:complexType>
<s:complexType name="Document">
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="ID" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="Data" type="s:base64Binary" />
</s:sequence>
</s:complexType>
<s:element name="DeliverDocumentsCallbackResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="DeliverDocumentsCallbackResult" type="tns:Result" />
</s:sequence>
</s:complexType>
</s:element>
</s:schema>
:
I created some POJO's for this structure and build a webservice to do the job. To meet the capitalized properties I defined my attributes with capitals as well, like:
:
public class ResultWrapper {
private String Code;
private String Description;
public String getCode() {
return Code;
}
public void setCode(String Code) {
this.Code = Code;
}
public String getDescription() {
return Description;
}
public void setDescription(String Description) {
this.Description = Description;
}
}
:
But the WSDL Axis2 produces for this part converts the first letter to lowercase for all property names for sub-level leaves. (code, description, data, iD), but respects the capitalize property names for top-level leaves.
:
<xs:element name="DeliverDocumentsCallback">
<xs:complexType>
<xs:sequence>
<xs:element name="TrackingID" minOccurs="0" type="xs:string" nillable="true" />
<xs:element name="CorrelationID" minOccurs="0" type="xs:string" nillable="true" />
<xs:element name="Result" minOccurs="0" type="ns1:ResultWrapper" nillable="true" />
<xs:element name="Documents" maxOccurs="unbounded" minOccurs="0" type="ns1:DocumentWrapper" nillable="true" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="DeliverDocumentsCallbackResponse">
<xs:complexType>
<xs:sequence>
<xs:element name="return" minOccurs="0" type="ns1:ResultWrapper" nillable="true" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:schema xmlns:ax235=".../xsd" targetNamespace=".../xsd" attributeFormDefault="qualified" elementFormDefault="qualified">
<xs:complexType name="ResultWrapper">
<xs:sequence>
<xs:element name="code" minOccurs="0" type="xs:string" nillable="true" />
<xs:element name="description" minOccurs="0" type="xs:string" nillable="true" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="DocumentWrapper">
<xs:sequence>
<xs:element name="data" minOccurs="0" type="xs:string" nillable="true" />
<xs:element name="iD" minOccurs="0" type="xs:string" nillable="true" />
</xs:sequence>
</xs:complexType>
</xs:schema>
:
Any idea how to get this working on Axis2?
> WSDL generation error - lowercasing 1st char in element names
> -------------------------------------------------------------
>
> Key: AXIS2-3017
> URL: https://issues.apache.org/jira/browse/AXIS2-3017
> Project: Axis 2.0 (Axis2)
> Issue Type: Bug
> Components: wsdl
> Reporter: nadir amra
> Assignee: Deepal Jayasinghe
> Priority: Critical
> Attachments: ConvertTemp.zip
>
>
> Here is the problem. I deploy a POJO and when AXIS2 (using nightly build
> 2007/07/25) automatically generated WSDL via ?wsdl it produces a WSDL file
> the includes the following:
> <xs:complexType name="CONVERTTEMPInput">
> <xs:sequence>
> <xs:element minOccurs="0" name="tEMPIN" nillable="true" type="xs:string"/>
> <xs:element minOccurs="0" name="tEMPOUT" nillable="true" type="xs:string"/>
> </xs:sequence>
> </xs:complexType>
> <xs:complexType name="CONVERTTEMPResult">
> <xs:sequence>
> <xs:element minOccurs="0" name="tEMPIN" nillable="true" type="xs:string"/>
> <xs:element minOccurs="0" name="tEMPOUT" nillable="true" type="xs:string"/>
> </xs:sequence>
> </xs:complexType>
> The problem is with the element names. It seems that AXIS2 is lowercasing the "t" in TEMPIN and TEMPOUT, which makes the service unusable. The CONVERTTEMPInput class is as follows:
> public class CONVERTTEMPInput implements Serializable
> {
> private static final long serialVersionUID = -884605419035002637L;
> public CONVERTTEMPInput() { }
> public void setTEMPIN( String TEMPIN )
> {
> _TEMPIN = TEMPIN;
> }
> public String getTEMPIN( )
> {
> return _TEMPIN;
> }
> public void setTEMPOUT( String TEMPOUT )
> {
> _TEMPOUT = TEMPOUT;
> }
> public String getTEMPOUT( )
> {
> return _TEMPOUT;
> }
> private String _TEMPIN = "";
> private String _TEMPOUT = "";
> }
> If I add an underscore prior to TEMPIN and TEMPOUT in the method names, things start to work.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org