WebSphere中的Web服务解组响应错误

WebSphere中的Web服务解组响应错误,websphere,jax-ws,Websphere,Jax Ws,我正在开发一个web服务客户机消费者 客户机类是使用cxf wsdltojava代码生成器生成的 当我在tomcat中运行客户端时,一切正常,但当我将客户端部署到 在WebSphere 7.0中,我得到的解组器错误如下: org.apache.axis2.jaxws.wrapper.impl.JAXBWrapperException: An internal assertion error occurred. The com.mycompany.webservice.model.L

我正在开发一个web服务客户机消费者

客户机类是使用cxf wsdltojava代码生成器生成的

当我在tomcat中运行客户端时,一切正常,但当我将客户端部署到 在WebSphere 7.0中,我得到的解组器错误如下:

org.apache.axis2.jaxws.wrapper.impl.JAXBWrapperException: An internal assertion  
     error occurred. The com.mycompany.webservice.model.LoginResponse JAXB object does not have a LoginResponse xml property.
at org.apache.axis2.jaxws.wrapper.impl.JAXBWrapperToolImpl.unWrap(JAXBWrapperToolImpl.java:83)
at org.apache.axis2.jaxws.marshaller.impl.alt.DocLitWrappedMethodMarshaller.demarshalResponse(DocLitWrappedMethodMarshaller.java:144)
... 16 more
wsdl如下所示:

<xsd:schema elementFormDefault="qualified" targetNamespace="http://tempuri.org/">
...
<xsd:element name="LoginResponse">
    <xsd:complexType>
        <xsd:sequence>
            <xsd:element minOccurs="1" maxOccurs="1" name="LoginResult" type="xsd:boolean"/>
            <xsd:element minOccurs="0" maxOccurs="1" name="ticketID" type="xsd:string"/>
        </xsd:sequence>
    </xsd:complexType>
</xsd:element>
服务类别为:

@WebService(targetNamespace = "http://tempuri.org/", name = "AuthenticationSoap")
@XmlSeeAlso({ObjectFactory.class})
public interface AuthenticationSoap {

@RequestWrapper(localName = "Login", targetNamespace = "http://tempuri.org/", className = "com.mycompany.webservice.model.Login")
@WebMethod(operationName = "Login", action = "http://tempuri.org/Login")
@ResponseWrapper(localName = "LoginResponse", targetNamespace = "http://tempuri.org/", className = "com.mycompany.webservice.model.LoginResponse")
@WebResult(name = "LoginResponse", targetNamespace = "http://tempuri.org/")
public LoginResponse login(
    @WebParam(mode = WebParam.Mode.IN, name = "username", targetNamespace = "http://tempuri.org/")
    java.lang.String username,
    @WebParam(mode = WebParam.Mode.IN, name = "password", targetNamespace = "http://tempuri.org/")
    java.lang.String password,
    @WebParam(mode = WebParam.Mode.INOUT, name = "ticketID", targetNamespace = "http://tempuri.org/")
    javax.xml.ws.Holder<java.lang.String> ticketID,
    @WebParam(mode = WebParam.Mode.OUT, name = "LoginResult", targetNamespace = "http://tempuri.org/")
    javax.xml.ws.Holder<java.lang.Boolean> loginResult
);
}
@WebService(targetNamespace=”http://tempuri.org/,name=“AuthenticationSoap”)
@XmlSeeAllow({ObjectFactory.class})
公共接口身份验证SOAP{
@RequestWrapper(localName=“Login”,targetNamespace=”http://tempuri.org/,className=“com.mycompany.webservice.model.Login”)
@WebMethod(operationName=“Login”,action=”http://tempuri.org/Login")
@响应包装器(localName=“LoginResponse”,targetNamespace=”http://tempuri.org/,className=“com.mycompany.webservice.model.LoginResponse”)
@WebResult(name=“LoginResponse”,targetNamespace=”http://tempuri.org/")
公共登录响应登录(
@WebParam(mode=WebParam.mode.IN,name=“username”,targetNamespace=”http://tempuri.org/")
java.lang.String用户名,
@WebParam(mode=WebParam.mode.IN,name=“password”,targetNamespace=”http://tempuri.org/")
java.lang.String密码,
@WebParam(mode=WebParam.mode.INOUT,name=“ticketID”,targetNamespace=”http://tempuri.org/")
javax.xml.ws.tid,
@WebParam(mode=WebParam.mode.OUT,name=“LoginResult”,targetNamespace=”http://tempuri.org/")
javax.xml.ws.Holder登录结果
);
}
有人知道我的定义有什么问题吗


真的

问题在于wsdl2java没有将属性“endpointInterface”添加到@WebService注释中。您需要确保您的WSDL包含WSDL:portType

IBM有一篇很好的文章解释了WSDL到Java的映射:


我建议您检查.wsdl是否具有complexType name=“LoginResponse”格式的complexType。如果没有,您可能希望尝试添加complexType name=“LoginResponse”。。。
我建议的第二件事是,您可以切换websphere运行模式。如果以开发模式运行,请松开该框,或者如果在没有开发模式的情况下运行,请选中该框,然后重试。我认为这是一个缺陷。一旦您想升级您的websphere,可能需要一个补丁包。

谢谢您的回复,但问题不在于此。我的wsdl文件中有portType。调用web服务并返回成功响应。但在解开谜团的回应中,我面临着这个问题。我跟踪它,发现在tomcat中,mule CxfMessageDispatcher类使用JaxWsClientProxy作为代理类,但在WebSphere中,它使用JaxWsProxyHandler作为代理类。我将project的类装入属性更改为parent last,还通过在project的清单文件中放置标志“DisableIBMJAXWSEngine:true”来禁用websphereweb服务,但没有任何更改。真的,我理解。我建议这样做的原因是我见过其他人也有同样的问题,这是因为webservice注释上的endpointInterface属性丢失了。解组后,它无法确定类型。为了理智起见,您是否可以尝试手动将endpointInterface属性添加到您的webservice注释中?
@WebService(targetNamespace = "http://tempuri.org/", name = "AuthenticationSoap")
@XmlSeeAlso({ObjectFactory.class})
public interface AuthenticationSoap {

@RequestWrapper(localName = "Login", targetNamespace = "http://tempuri.org/", className = "com.mycompany.webservice.model.Login")
@WebMethod(operationName = "Login", action = "http://tempuri.org/Login")
@ResponseWrapper(localName = "LoginResponse", targetNamespace = "http://tempuri.org/", className = "com.mycompany.webservice.model.LoginResponse")
@WebResult(name = "LoginResponse", targetNamespace = "http://tempuri.org/")
public LoginResponse login(
    @WebParam(mode = WebParam.Mode.IN, name = "username", targetNamespace = "http://tempuri.org/")
    java.lang.String username,
    @WebParam(mode = WebParam.Mode.IN, name = "password", targetNamespace = "http://tempuri.org/")
    java.lang.String password,
    @WebParam(mode = WebParam.Mode.INOUT, name = "ticketID", targetNamespace = "http://tempuri.org/")
    javax.xml.ws.Holder<java.lang.String> ticketID,
    @WebParam(mode = WebParam.Mode.OUT, name = "LoginResult", targetNamespace = "http://tempuri.org/")
    javax.xml.ws.Holder<java.lang.Boolean> loginResult
);
}