Jdev 11g Web Service WSDL Parameter Name

Posted by Steve Racanovic | Posted in , | Posted on 11:01 AM

2


With Jdev 11g, after generating a Web Service from a java class, the WSDL contains the following
parameter names:

...
<xsd:complexType name="sayHello">
<xsd:sequence>
<xsd:element name="arg0" type="xsd:string"/>
<xsd:element name="arg1" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
...

My java code function looks like:
...
public String sayHello(String firstname, String lastname) {
return "Hello " + firstname + " " + lastname;
}
...

With Jdev 10g , the same code generates the appropriate values:
...
<xsd:complexType name="sayHello">
<xsd:sequence>
<xsd:element name="firstname" type="xsd:string"/>
<xsd:element name="lastname" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
...

To workaround this in 11g, I need to create my java class as follows:

package project1;

import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebService;

@WebService
public class Class1 {
@WebMethod
public String sayHello(@WebParam(name = "fname") String firstname,
@WebParam(name = "lname") String lastname) {
return "Hello " + firstname + " " + lastname;
}
}

And now my generated WSDL looks like:
...
<xsd:complexType name="sayHello">
<xsd:sequence>
<xsd:element name="fname" type="xsd:string"/>
<xsd:element name="lname" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
...

http://java.sun.com/javaee/5/docs/api/javax/jws/WebParam.html

Comments (2)

Hi there!
I found this interesting page, after I had the same problem but with.. 10g.. I've tried to import the javax libraries but it couldn't be found.. any hints?

Thanks in advance
Carlos Sampaio

Hi there!
I found this interesting page, after I had the same problem but with.. 10g.. I've tried to import the javax libraries but it couldn't be found.. any hints?

Thanks in advance
Carlos Sampaio