2016-09-30 43 views
0

在我以前的问题here (Contains all the source information)我问过为什么我的WSDL不包含我的方法的参数。 我再叫,它是在WSDL可用可用下BIRT不适用于Java 1.6 JAX-WS方法参数

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

望着那定义我可以清楚地看到该方法我的参数定义:

<!-- 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> 

当我使用WDSL作为数据源对于BIRT,它显示了方法名称,但参数选择对话框是空的。

它只是不适用于Java 1.6 API,应该使用axis2吗?

回答

0

好了,我终于找到了如何得到它的工作,基本上我添加了以下注释,以我的@WebService类:

@SOAPBinding(style = SOAPBinding.Style.RPC) 

完整的示例:

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; 
    } 

} 
相关问题