Web服务中的输入和输出参数

时间:2011-09-05 12:34:53

标签: java web-services

我在ServiceEndPointInterface(SEI)中使用Inout和Out参数。 这是方法签名。

import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebResult;
import javax.jws.WebService;
import javax.jws.WebParam.Mode;
import javax.jws.Oneway;
import javax.xml.rpc.holders.*;

@WebMethod
@Oneway
public  @WebResult void TestDomainCls( @WebParam (mode=Mode.INOUT)   IntegerWrapperHolder inpuInt ); 

我在EJBBean中实现了这个方法。我已经使用注释将此EJBBean公开为Web服务。

在JBOSS 5中部署此EAR时,它会抛出错误,如

Caused by:  java.lang.IllegalStateException: 
Cannot synchronize to any of these methods:
public abstract java.lang.String MURCOMP.MURCOMP_SEI.serv_20_search1(java.lang.String,javax.xml.rpc.holders.StringHolder)

OperationMetaData:
qname={http://MURCOMP/}serv_20_search1
javaName=serv_20_search1
style=rpc/literal
oneWay=false
soapAction=
ParameterMetaData:
xmlName=arg0
partName=arg0
xmlType={http://www.w3.org/2001/XMLSchema}string
javaType=java.lang.String
mode=IN
inHeader=false
index=0
ParameterMetaData:
xmlName=arg1
partName=arg1
xmlType={http://www.w3.org/2001/XMLSchema}anyType
javaType=java.lang.Object
mode=OUT
inHeader=false
index=1
ReturnMetaData:
xmlName=return
partName=return
xmlType={http://www.w3.org/2001/XMLSchema}string
javaType=java.lang.String
mode=OUT
inHeader=false
index=-1
at   org.jboss.ws.metadata.umdm.OperationMetaData.eagerInitialize(OperationMetaData.java:491)
    at org.jboss.ws.metadata.umdm.EndpointMetaData.eagerInitializeOperations(EndpointMetaData.java:559)
    at org.jboss.ws.metadata.umdm.EndpointMetaData.initializeInternal(EndpointMetaData.java:543)
    at org.jboss.ws.metadata.umdm.EndpointMetaData.eagerInitialize(EndpointMetaData.java:533)
    at org.jboss.ws.metadata.umdm.ServiceMetaData.eagerInitialize(ServiceMetaData.java:433)
    at org.jboss.ws.metadata.umdm.UnifiedMetaData.eagerInitialize(UnifiedMetaData.java:194)
    at org.jboss.wsf.stack.jbws.EagerInitializeDeploymentAspect.start(EagerInitializeDeploymentAspect.java:48)
    at org.jboss.wsf.framework.deployment.DeploymentAspectManagerImpl.deploy(DeploymentAspectManagerImpl.java:129)
    at org.jboss.wsf.container.jboss50.deployer.ArchiveDeployerHook.deploy(ArchiveDeployerHook.java:76)
    at org.jboss.wsf.container.jboss50.deployer.AbstractWebServiceDeployer.internalDeploy(AbstractWebServiceDeployer.java:60)
    at org.jboss.wsf.container.jboss50.deployer.WebServiceDeployerEJB.internalDeploy(WebServiceDeployerEJB.java:113)
    at org.jboss.deployers.spi.deployer.helpers.AbstractRealDeployer.deploy(AbstractRealDeployer.java:50)
    at org.jboss.deployers.plugins.deployers.DeployerWrapper.deploy(DeployerWrapper.java:171)
    ... 30 more
17:40:12,483 ERROR [ProfileServiceBootstrap] Failed to load profile: Summary of incomplete deployments (SEE PREVIOUS ERRORS FOR DETAILS):

只有在我的方法中使用inout或out参数时才会出现此错误。

任何人都可以建议我。,我出错了或者Web服务中的INOUT和OUT参数有什么缺失

enter code here

1 个答案:

答案 0 :(得分:0)

我有解决方案。我使用了javax.xml.ws.Holder而不是javax.xml.rpc.holders。 代码如下     @WebMethod         public @WebResult String testINout(@WebParam Holder holder);

但我没有得到实际的解决方案,为什么如果我使用javax.xml.rpc.holders发生了这样的异常。无论如何,我发现了另一种工作方式......