AFAIK annotations is the only option for this. (i.e if your going through axis2).
But you have the option of transforming the results from web service before it reaching your C program. For example you can transform following response, <ns:queryResponse xmlns:ns="http://foo.bar"> <return> <bookId>Axis2 unleashed</bookId> <price>299.0</price> <orderStatus>confirmed</orderStatus> </return> </ns:queryResponse> Into following, <result xmlns:ns="http://foo.bar"> <bookId>Axis2 unleashed</bookId> <price>299.0</price> <orderStatus>confirmed</orderStatus> </result> using the XSLT given bellow. <xsl:stylesheet version="2.0" xmlns:ns="http://foo.bar" xmlns:xsl=" http://www.w3.org/1999/XSL/Transform" > <xsl:output method="xml" omit-xml-declaration="yes" indent="yes"/> <xsl:template match="//ns:queryResponse"> <result> <xsl:for-each select="//ns:queryResponse/return"> <xsl:for-each select="./*"> <xsl:variable name="element-name" select="local-name(.)"/> <xsl:element name="{$element-name}"> <xsl:value-of select="."/> </xsl:element> </xsl:for-each> </xsl:for-each> </result> </xsl:template> </xsl:stylesheet> /sumedha > > -------- Original Message -------- > Subject: Re: Axis2 return name > Date: Wed, 25 Jun 2008 06:44:42 -0700 (PDT) > From: sdr <[EMAIL PROTECTED]> > Reply-To: [email protected] > To: [email protected] > References: <[EMAIL PROTECTED]> <[EMAIL PROTECTED] > > > > > > Hi, > > Thanks for the response, but the solution you suggested is only valid for > incoming parameters, not for responses. > > > public class UssdIvrInterface { > public Common12RingResponse Reload12Ring(Reload12RingRequest in) { > Common12RingResponse out = new Common12RingResponse(); > out.setMsisdn(in.getMsisdn()); > out.setRequest_id(in.getRequest_id()); > out.setService_id(in.getService_id()); > out.setStatus(new Integer(1000)); > > return out; > } > > > > I have indeed an element name equal to in in my wsdl, but no element name > equal to out. > > > > - <xs:element name="Reload12Ring"> > - <xs:complexType> > - <xs:sequence> > <xs:element minOccurs="0" name="in" nillable="true" > type="ns1:Reload12RingRequest" /> </xs:sequence> > </xs:complexType> > </xs:element> > - <xs:element name="Reload12RingResponse"> > - <xs:complexType> > - <xs:sequence> > <xs:element minOccurs="0" name="return" nillable="true" > type="ns1:Common12RingResponse" /> </xs:sequence> > </xs:complexType> > </xs:element> > </xs:schema> > > > > Kr, > Sdr. > > > > Charitha Kankanamge wrote: > >> >> Hi, >> I think the answer for your question is explained here [1] >> >> [1] http://wso2.org/library/3743 >> >> regards >> Charitha >> sdr wrote: >> >> Hi, >>> >>> I'm generating a wsdl out of code with following java code: >>> >>> public class EmbeddedAxis2Server { >>> public static void main(String[] args) throws Exception { >>> ConfigurationContext context = >>> >>> ConfigurationContextFactory.createConfigurationContextFromFileSystem(null, >>> null); >>> context.setContextRoot("lmpg-ws"); >>> >>> AxisService service = >>> AxisService.createService(UssdIvrInterface.class.getName(), >>> context.getAxisConfiguration()); >>> context.getAxisConfiguration().addService(service); >>> SimpleHTTPServer server = new SimpleHTTPServer(context, >>> 8080); >>> server.start(); >>> } >>> } >>> >>> The wsdl that is generated is as follows: >>> >>> >>> - <wsdl:types> >>> - <xs:schema xmlns:ns="http://ws.apache.org/axis2" >>> attributeFormDefault="qualified" elementFormDefault="unqualified" >>> targetNamespace="http://ws.apache.org/axis2"> >>> - <xs:element name="Register12Ring"> >>> - <xs:complexType> >>> - <xs:sequence> >>> <xs:element minOccurs="0" name="in" nillable="true" >>> type="ns1:Register12RingRequest" /> </xs:sequence> >>> </xs:complexType> >>> </xs:element> >>> - <xs:element name="Register12RingResponse"> >>> - <xs:complexType> >>> - <xs:sequence> >>> <xs:element minOccurs="0" name="return" nillable="true" >>> type="ns1:Common12RingResponse" /> </xs:sequence> >>> </xs:complexType> >>> </xs:element> >>> - <xs:element name="Reload12Ring"> >>> - <xs:complexType> >>> - <xs:sequence> >>> <xs:element minOccurs="0" name="in" nillable="true" >>> type="ns1:Reload12RingRequest" /> </xs:sequence> >>> </xs:complexType> >>> </xs:element> >>> - <xs:element name="Reload12RingResponse"> >>> ...etc >>> >>> >>> Is there a possibility to change name="return" into something else? We >>> >> have > >> troubles creating a c++ client as return is a keyword in c++. I'm not >>> able to use annotations as I have to use java 1.4 >>> >>> Kind regards, >>> Sdr >>> >>> >> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PROTECTED] >> >> >> >> > -- > View this message in context: > http://www.nabble.com/Axis2-return-name-tp18112183p18112853.html > Sent from the Axis - User mailing list archive at Nabble.com. > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > >
