You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Yeroc <cp...@gmail.com> on 2007/07/25 22:48:17 UTC

WSDL method parameter names?

All...

I'm doing Java-first development on a service and the WSDL file being
generated (I'm using Tomcat v5.5 as my container with the CXFServlet) is
using arg0, arg1 etc. as the parameter names for my service methods rather
than using the actual parameter name specified in my Java code.  Is this a
known shortcoming or am I doing something wrong?  The WSDL isn't very
self-documenting with parameter names like this!

Here's an example wsdl snippet:

<xs:element name="moveItem" type="tns:moveItem"/>
  <xs:complexType name="moveItem">
  <xs:sequence>
    <xs:element minOccurs="0" name="arg0" type="xs:string"/>
    <xs:element minOccurs="0" name="arg1" type="xs:string"/>
    <xs:element minOccurs="0" name="arg2" type="xs:string"/>
    <xs:element minOccurs="0" name="arg3" type="xs:dateTime"/>
    <xs:element minOccurs="0" name="arg4" type="xs:string"/>
    <xs:element minOccurs="0" name="arg5" type="xs:string"/>
    <xs:element minOccurs="0" name="arg6" type="xs:string"/>
  </xs:sequence>
</xs:complexType>

Thanks,
Corey
-- 
View this message in context: http://www.nabble.com/WSDL-method-parameter-names--tf4147851.html#a11799651
Sent from the cxf-user mailing list archive at Nabble.com.


Re: WSDL method parameter names?

Posted by Stuart Bingë <st...@complinet.com>.
On Wednesday 25 July 2007 22:41:12 Corey Puffalt wrote:
> Chris, Daniel,
>
> I don't suppose there's any chance of CXF introducing a configurable option
> to use non-conforming (but more reasonable IMHO) default parameter names?
> Am I the only one that sees the default parameter names as something akin
> to obfuscation of the WSDL file?  I've sent a comment to the JSR224 email
> address but I doubt anything will come of it.

I would also like to see something such as this in a future release. While one 
may say CXF is conformant to the spec, the spec does seem a bit lacking in 
this specific matter.

Having "argN" parameter names isn't very descriptive when auto-generating 
frontends to SOAP services, and having to document each parameter with 
@WebParam(name="Xyz") to overcome this is quite excessive. Especially with 
large services with several hundred parameters -- the interface classes 
become quite messy with all the extra annotations, and prone to problems of 
names going out of sync when adding/modifying parameters.

Having a single on/off flag (default off) in the CXF configuration to allow 
the "non-conformant" behaviour of mirrored interface/WSDL parameter names 
would be exceptionally useful for circumstances such as these.

______________________________________________________________________

“Complinet Ltd is registered in England. Registered office at Vintners Place, 68 Upper Thames Street, London EC4V 3BJ. Company number 3170722. VAT No. 749 324 021.
Complinet Inc is a corporation registered in Delaware, USA.”

This email has been scanned by the MessageLabs Email Security System.

Re: WSDL method parameter names?

Posted by Corey Puffalt <cp...@gmail.com>.
Chris, Daniel,

I don't suppose there's any chance of CXF introducing a configurable option
to use non-conforming (but more reasonable IMHO) default parameter names?
Am I the only one that sees the default parameter names as something akin to
obfuscation of the WSDL file?  I've sent a comment to the JSR224 email
address but I doubt anything will come of it.

Thanks,
Corey

On 7/25/07, Christopher Moesel <Ch...@avid.com> wrote:
>
> Hi Corey,
>
> As you've probably seen in the reply from Dan K., the JAX-WS
> specification states that the default should be "argN" where N is
> replaced with the zero-based argument index.  CXF is compliant with the
> JAX-WS spec, so it looks like you've found a mistake in the CXF
> documentation.  Thanks for pointing this out-- I'll fix the
> documentation to eliminate the confusion.
>
> -Chris
>
>

RE: WSDL method parameter names?

Posted by Christopher Moesel <Ch...@avid.com>.
Hi Corey,

As you've probably seen in the reply from Dan K., the JAX-WS
specification states that the default should be "argN" where N is
replaced with the zero-based argument index.  CXF is compliant with the
JAX-WS spec, so it looks like you've found a mistake in the CXF
documentation.  Thanks for pointing this out-- I'll fix the
documentation to eliminate the confusion.

-Chris

-----Original Message-----
From: Yeroc [mailto:cplists@gmail.com] 
Sent: Wednesday, July 25, 2007 5:11 PM
To: cxf-user@incubator.apache.org
Subject: RE: WSDL method parameter names?


Chris,

Thanks for your response.  The document you reference states: "The
default
is to use the name of the parameter as it appears in the method's
argument
list." which is exactly what I'm looking for as I don't really want to
have
to annotate every single parameter on all my methods.  Is this a bug in
the
code or the documentation or am I reading things wrong?  The default
documented above seems more reasonable to me than what's being generated
today.

Thanks again,
Corey


Christopher Moesel wrote:
> 
> Hi Corey,
> 
> If you are doing a JAX-WS Java-first service, you can use the
@WebParam
> annotation to specify web parameter names.  It's in the documentation
> guide here:
> 
>
http://cwiki.apache.org/CXF20DOC/developing-a-service.html#DevelopingaSe
> rvice-The{{@WebParam}}annotation
> 
> (tiny url: http://tinyurl.com/yr2q2w)
> 
> -Chris
> 
> -----Original Message-----
> From: Yeroc [mailto:cplists@gmail.com] 
> Sent: Wednesday, July 25, 2007 4:48 PM
> To: cxf-user@incubator.apache.org
> Subject: WSDL method parameter names?
> 
> 
> All...
> 
> I'm doing Java-first development on a service and the WSDL file being
> generated (I'm using Tomcat v5.5 as my container with the CXFServlet)
is
> using arg0, arg1 etc. as the parameter names for my service methods
> rather
> than using the actual parameter name specified in my Java code.  Is
this
> a
> known shortcoming or am I doing something wrong?  The WSDL isn't very
> self-documenting with parameter names like this!
> 
> Here's an example wsdl snippet:
> 
> <xs:element name="moveItem" type="tns:moveItem"/>
>   <xs:complexType name="moveItem">
>   <xs:sequence>
>     <xs:element minOccurs="0" name="arg0" type="xs:string"/>
>     <xs:element minOccurs="0" name="arg1" type="xs:string"/>
>     <xs:element minOccurs="0" name="arg2" type="xs:string"/>
>     <xs:element minOccurs="0" name="arg3" type="xs:dateTime"/>
>     <xs:element minOccurs="0" name="arg4" type="xs:string"/>
>     <xs:element minOccurs="0" name="arg5" type="xs:string"/>
>     <xs:element minOccurs="0" name="arg6" type="xs:string"/>
>   </xs:sequence>
> </xs:complexType>
> 
> Thanks,
> Corey
> -- 
> View this message in context:
>
http://www.nabble.com/WSDL-method-parameter-names--tf4147851.html#a11799
> 651
> Sent from the cxf-user mailing list archive at Nabble.com.
> 
> 
> 

-- 
View this message in context:
http://www.nabble.com/WSDL-method-parameter-names--tf4147851.html#a11800
048
Sent from the cxf-user mailing list archive at Nabble.com.


RE: WSDL method parameter names?

Posted by Yeroc <cp...@gmail.com>.
Chris,

Thanks for your response.  The document you reference states: "The default
is to use the name of the parameter as it appears in the method's argument
list." which is exactly what I'm looking for as I don't really want to have
to annotate every single parameter on all my methods.  Is this a bug in the
code or the documentation or am I reading things wrong?  The default
documented above seems more reasonable to me than what's being generated
today.

Thanks again,
Corey


Christopher Moesel wrote:
> 
> Hi Corey,
> 
> If you are doing a JAX-WS Java-first service, you can use the @WebParam
> annotation to specify web parameter names.  It's in the documentation
> guide here:
> 
> http://cwiki.apache.org/CXF20DOC/developing-a-service.html#DevelopingaSe
> rvice-The{{@WebParam}}annotation
> 
> (tiny url: http://tinyurl.com/yr2q2w)
> 
> -Chris
> 
> -----Original Message-----
> From: Yeroc [mailto:cplists@gmail.com] 
> Sent: Wednesday, July 25, 2007 4:48 PM
> To: cxf-user@incubator.apache.org
> Subject: WSDL method parameter names?
> 
> 
> All...
> 
> I'm doing Java-first development on a service and the WSDL file being
> generated (I'm using Tomcat v5.5 as my container with the CXFServlet) is
> using arg0, arg1 etc. as the parameter names for my service methods
> rather
> than using the actual parameter name specified in my Java code.  Is this
> a
> known shortcoming or am I doing something wrong?  The WSDL isn't very
> self-documenting with parameter names like this!
> 
> Here's an example wsdl snippet:
> 
> <xs:element name="moveItem" type="tns:moveItem"/>
>   <xs:complexType name="moveItem">
>   <xs:sequence>
>     <xs:element minOccurs="0" name="arg0" type="xs:string"/>
>     <xs:element minOccurs="0" name="arg1" type="xs:string"/>
>     <xs:element minOccurs="0" name="arg2" type="xs:string"/>
>     <xs:element minOccurs="0" name="arg3" type="xs:dateTime"/>
>     <xs:element minOccurs="0" name="arg4" type="xs:string"/>
>     <xs:element minOccurs="0" name="arg5" type="xs:string"/>
>     <xs:element minOccurs="0" name="arg6" type="xs:string"/>
>   </xs:sequence>
> </xs:complexType>
> 
> Thanks,
> Corey
> -- 
> View this message in context:
> http://www.nabble.com/WSDL-method-parameter-names--tf4147851.html#a11799
> 651
> Sent from the cxf-user mailing list archive at Nabble.com.
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/WSDL-method-parameter-names--tf4147851.html#a11800048
Sent from the cxf-user mailing list archive at Nabble.com.


Re: WSDL method parameter names?

Posted by Daniel Kulp <dk...@apache.org>.
Just FYI:  this is per JAX-WS spec.

Section 3.6.1 states:
♦ Conformance (Parameter naming): The javax.jws.WebParam annotation (see 
7.11.4) MAY be used to specify the name of the wsdl:part or XML Schema 
element declaration corresponding to a Java parameter. If both the name 
and partName elements are used in the javax.jws.WebParam annotation then 
the partName MUST be used for the wsdl:part name attribute and the name 
element from the annotation will be ignored. If not specified, the 
default is “argN”, where N is replaced with the zero-based argument 
index. Thus, for instance, the first argument of a method will have a 
default parameter name of “arg0”, the second one “arg1”and so on.


Dan


On Wednesday 25 July 2007 16:56, Christopher Moesel wrote:
> Hi Corey,
>
> If you are doing a JAX-WS Java-first service, you can use the
> @WebParam annotation to specify web parameter names.  It's in the
> documentation guide here:
>
> http://cwiki.apache.org/CXF20DOC/developing-a-service.html#Developinga
>Se rvice-The{{@WebParam}}annotation
>
> (tiny url: http://tinyurl.com/yr2q2w)
>
> -Chris
>
> -----Original Message-----
> From: Yeroc [mailto:cplists@gmail.com]
> Sent: Wednesday, July 25, 2007 4:48 PM
> To: cxf-user@incubator.apache.org
> Subject: WSDL method parameter names?
>
>
> All...
>
> I'm doing Java-first development on a service and the WSDL file being
> generated (I'm using Tomcat v5.5 as my container with the CXFServlet)
> is using arg0, arg1 etc. as the parameter names for my service methods
> rather
> than using the actual parameter name specified in my Java code.  Is
> this a
> known shortcoming or am I doing something wrong?  The WSDL isn't very
> self-documenting with parameter names like this!
>
> Here's an example wsdl snippet:
>
> <xs:element name="moveItem" type="tns:moveItem"/>
>   <xs:complexType name="moveItem">
>   <xs:sequence>
>     <xs:element minOccurs="0" name="arg0" type="xs:string"/>
>     <xs:element minOccurs="0" name="arg1" type="xs:string"/>
>     <xs:element minOccurs="0" name="arg2" type="xs:string"/>
>     <xs:element minOccurs="0" name="arg3" type="xs:dateTime"/>
>     <xs:element minOccurs="0" name="arg4" type="xs:string"/>
>     <xs:element minOccurs="0" name="arg5" type="xs:string"/>
>     <xs:element minOccurs="0" name="arg6" type="xs:string"/>
>   </xs:sequence>
> </xs:complexType>
>
> Thanks,
> Corey

-- 
J. Daniel Kulp
Principal Engineer
IONA
P: 781-902-8727    C: 508-380-7194
daniel.kulp@iona.com
http://www.dankulp.com/blog

RE: WSDL method parameter names?

Posted by Christopher Moesel <Ch...@avid.com>.
Hi Corey,

If you are doing a JAX-WS Java-first service, you can use the @WebParam
annotation to specify web parameter names.  It's in the documentation
guide here:

http://cwiki.apache.org/CXF20DOC/developing-a-service.html#DevelopingaSe
rvice-The{{@WebParam}}annotation

(tiny url: http://tinyurl.com/yr2q2w)

-Chris

-----Original Message-----
From: Yeroc [mailto:cplists@gmail.com] 
Sent: Wednesday, July 25, 2007 4:48 PM
To: cxf-user@incubator.apache.org
Subject: WSDL method parameter names?


All...

I'm doing Java-first development on a service and the WSDL file being
generated (I'm using Tomcat v5.5 as my container with the CXFServlet) is
using arg0, arg1 etc. as the parameter names for my service methods
rather
than using the actual parameter name specified in my Java code.  Is this
a
known shortcoming or am I doing something wrong?  The WSDL isn't very
self-documenting with parameter names like this!

Here's an example wsdl snippet:

<xs:element name="moveItem" type="tns:moveItem"/>
  <xs:complexType name="moveItem">
  <xs:sequence>
    <xs:element minOccurs="0" name="arg0" type="xs:string"/>
    <xs:element minOccurs="0" name="arg1" type="xs:string"/>
    <xs:element minOccurs="0" name="arg2" type="xs:string"/>
    <xs:element minOccurs="0" name="arg3" type="xs:dateTime"/>
    <xs:element minOccurs="0" name="arg4" type="xs:string"/>
    <xs:element minOccurs="0" name="arg5" type="xs:string"/>
    <xs:element minOccurs="0" name="arg6" type="xs:string"/>
  </xs:sequence>
</xs:complexType>

Thanks,
Corey
-- 
View this message in context:
http://www.nabble.com/WSDL-method-parameter-names--tf4147851.html#a11799
651
Sent from the cxf-user mailing list archive at Nabble.com.