Hi,
I am new to Axis 1.4. I have developed a Java Class BeanService that
has a single getCodeList method. The method returns an array of
CodeValuePair objects.
I am using Java2WSDL to generate my WSDL and have hand coded my wsdd
file. I am not getting the 'item' XML elements when the elements in
the array are serialized. I have been struggling for the past 2 days to
get the expected response. No luck so far. Could somebody point my
mistakes please?
1) Expected Response:
<getCodeListReturn>
<item><code>SG</code><value>Singapore</value></item>
</getCodeListReturn>
2) Actual Response
<getCodeListReturn>
<getCodeListReturn><code>SG</code><value>Singapore</value></getCodeListR
eturn>
</getCodeListReturn>
3) MultiRef disabled in server-config.wsdd
3) WSDL generated using Ant task
<java2wsdl
output="${axis.home}/build/work/samples/userguide/example9/generated/exa
mple9.wsdl"
className= "samples.userguide.example9.BeanService"
useInheritedMethods="false"
namespace="urn:BeanService"
location="http://localhost:8080/axis/services/AxisService"
style="RPC"
use="literal"
deploy="true">
<mapping namespace="urn:BeanService"
package="samples.userguide.example9"/>
</java2wsdl>
4) WSDD file
<deployment xmlns="http://xml.apache.org/axis/wsdd/"
xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
<service name="urn:BeanService" provider="java:RPC" use="literal"
>
<parameter name="className"
value="samples.userguide.example9.BeanService" />
<parameter name="allowedMethods"
value="processPurchaseRequest,getCodeList,getItem,getComment" />
<beanMapping qname="myNS:CodeValuePair"
xmlns:myNS="urn:BeanService"
languageSpecificType="java:...CodeValuePair" />
</service>
</deployment>
5) Service class
public BeanService {
public CodeValuePair[] getCodeList(String listName) {
/* return list of CodeValuePair */
}
}
6) Data object
public CodeValuePair {
private String code;
private String value;
/* getters and setters omitted */
}
Best Regards
Rao (Peruri Rama Mohan Rao)
T&O-ES-Imaging & Workflow
Tel: 65- 6878 2071
Mobile: 65-9389 7141
CONFIDENTIAL NOTE: The information contained in this email is intended only for
the use of the individual or entity named above and may contain information
that is privileged, confidential and exempt from disclosure under applicable
law. If the reader of this message is not the intended recipient, you are
hereby notified that any dissemination, distribution or copying of this
communication is strictly prohibited. If you have received this message in
error, please immediately notify the sender and delete the mail.
Thank you.