简体   繁体   中英

BIRT not working with Java 1.6 JAX-WS method parameters

In my previous question here (Contains all the source information) I have asked why my WSDL does not contain the parameter for my methods. I got then told that it is available in the WSDL available under

http://localhost:8080/hello?xsd=1

Looking at that definition I can clearly see my parameter definition for the method:

<!-- Published by JAX-WS RI at http://jax-ws.dev.java.net. RI's version is JAX-WS RI 2.2.4-b01. 
-->
<xs:schema version="1.0" targetNamespace="http://soap.webapp.mobile.product.com/">
    <xs:element name="sayMyName" type="tns:sayMyName"/>
    <xs:element name="sayMyNameResponse" type="tns:sayMyNameResponse"/>
    <xs:complexType name="sayMyName">
        <xs:sequence>
            <xs:element name="name" type="xs:string" minOccurs="0"/>
        </xs:sequence>
    </xs:complexType>
    <xs:complexType name="sayMyNameResponse">
        <xs:sequence>
            <xs:element name="return" type="xs:string" minOccurs="0"/>
        </xs:sequence>
    </xs:complexType>
</xs:schema>

When I use the WDSL as datasource for BIRT it shows me the method name but the parameter selection dialog is empty.

Does it simply not work with the Java 1.6 API and should I use axis2 instead?

Okay so I finally found out how to get it working, basically I added the following annotation to my @WebService class:

@SOAPBinding(style = SOAPBinding.Style.RPC)

Full example:

import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebService;
import javax.jws.soap.SOAPBinding;
import javax.xml.ws.BindingType;

@WebService
@BindingType(value = "http://java.sun.com/xml/ns/jaxws/2003/05/soap/bindings/HTTP/")
@SOAPBinding(style = SOAPBinding.Style.RPC)
public class WSHello {

    @WebMethod
    public String sayMyName(@WebParam(name = "name") String name) {
        return "Hello, ... " + name;
    }

}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM