web-services - 发现 Java 模型和 WSDL 模型不匹配,对于 wsdl 操作 [英] web-services - Mismatch between Java model and WSDL model found, For wsdl operation

查看:28
本文介绍了web-services - 发现 Java 模型和 WSDL 模型不匹配,对于 wsdl 操作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

@WebServiceClient(name = "SalesCustomerSelectService", wsdlLocation = "abc.wsdl", targetNamespace = "url path + api=SalesCustomerSelect") 
public class SalesCustomerSelectService extends Service {
public final static URL WSDL_LOCATION;
public final static QName SERVICE = new QName("sx url + &api=SalesCustomerSelect", "SalesCustomerSelectService");
public final static QName SalesCustomerSelect = new QName("sx url + &api=SalesCustomerSelect", "SalesCustomerSelect");
static {
    URL url = null;
    try {
        url = new URL("url path + SalesCustomerSelect.wsdl");
    } catch (MalformedURLException e) {
        java.util.logging.Logger.getLogger(SalesCustomerSelectService.class.getName())
            .log(java.util.logging.Level.INFO, 
                 "Can not initialize the default wsdl from {0}", "url pathSalesCustomerSelect.wsdl");
    }
    WSDL_LOCATION = url;
}
@WebEndpoint(name = "SalesCustomerSelect")
public SalesCustomerSelect getSalesCustomerSelect() {
    return super.getPort(SalesCustomerSelect, SalesCustomerSelect.class);
    }
}


@WebService(targetNamespace = "url path + api=SalesCustomerSelect", name = "SalesCustomerSelect")
@XmlSeeAlso({ObjectFactory.class})
@SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
public interface SalesCustomerSelect {

@WebMethod(operationName = "SalesCustomerSelect", action = "url path + api=SalesCustomerSelect")
@Action(input = "https://gwws.greywolf.com/sx/ws.aspx?result=ws&v=1&api=SalesCustomerSelect", output = "https://gwws.greywolf.com/sx/ws.aspx?result=ws&v=1&api=SalesCustomerSelect", fault = {})
@WebResult(name = "SalesCustomerSelectResponseContainerList", targetNamespace = "url path + api=SalesCustomerSelect", partName = "parameters")
public SalesCustomerSelectResponseContainerList salesCustomerSelect(
    @WebParam(partName = "parameters", name = "SalesCustomerSelectRequestContainer", targetNamespace = "url path + api=SalesCustomerSelect")
    SalesCustomerSelectRequestContainer parameters) throws FaultMsg;
}

在我的主类中,我将本门户中建议的端点 url 更改为

In my main class I am changing the endpoint url as suggested in this portal as

this.erpUrl 其实就是一个url路径

this.erpUrl is actually an url path

final QName SERVICE_NAME = new QName(this.erpUrl+"api=SalesCustomerSelect", "SalesCustomerSelectService");
final QName SERVICE_NAME1 = new QName(this.erpUrl+"api=SalesCustomerSelect", "SalesCustomerSelect");

try{
    wsdlURL = new URL(this.erpWsdl + "api=SalesCustomerSelect");
}
catch(Exception e){}

SalesCustomerSelectService customerService = new SalesCustomerSelectService(wsdlURL, SERVICE_NAME);
SalesCustomerSelect customerPort = customerService.getPort(SERVICE_NAME1, SalesCustomerSelect.class);

我收到错误

2017-05-01 17:44:27.248  WARN 8904 --- [io-8080-exec-20] c.s.x.internal.ws.model.JavaMethodImpl   : Input Action on WSDL operation SalesCustomerSelect and @Action on its associated Web Method salesCustomerSelect did not match and will cause problems in dispatching the requests
2017-05-01 17:44:27.248  WARN 8904 --- [io-8080-exec-20] c.s.x.internal.ws.model.JavaMethodImpl   : Mismatch between Java model and WSDL model found, For wsdl operation {https://gwws.greywolf.com/sxtest/ws.aspx?result=ws&v=1&api=SalesCustomerSelect}SalesCustomerSelect,There is no matching wsdl fault with detail QName {https://gwws.greywolf.com/sx/ws.aspx?result=ws&v=1&api=SalesCustomerSelect}FaultContainer

推荐答案

你能把 Java 模型和 WSDL 的代码贴出来让我们破译.我觉得缺少一些有助于破译问题的细节.我希望像这样的内容作为问题的完整陈述.

Can you post the code for the Java model and the WSDL for us to decipher. I feel some detail is missing that would assist to decipher the problem. I would expect something like this as the full statement of the problem.

Mismatch between Java model and WSDL model found, For wsdl operation {http://www.csapi.org/wsdl/parlayx/sms/send/v2_2/interface}sendSms,There is no matching wsdl fault with detail QName {http://www.csapi.org/schema/parlayx/common/v2_1}PolicyException_type

在我上面的例子中,错误是由于 Java 模型的名称不匹配,其名称为 @XmlType(name = "PolicyException_type"以及 WSDL 中的操作名称.

In my example above the error would due to a mistmatch in the names of the Java model whose name is, @XmlType(name = "PolicyException_type" and the operation name in the WSDL.

计数器检查 ObjectFactory 类,它显然不匹配,因为 Java 模型引用 PolicyException_type 作为名称,而对象工厂中的操作名称对操作名称是:PolicyException 如下所示.

Counter checking the ObjectFactory class , it clearly has a mismatch since the Java model refers to PolicyException_type as the name where as the operation name in Object factory to the operation name is: PolicyException as seen below.

@XmlElementDecl(namespace = "http://www.csapi.org/schema/parlayx/common/v2_1", name = "PolicyException")

我希望这会有所帮助.

这篇关于web-services - 发现 Java 模型和 WSDL 模型不匹配,对于 wsdl 操作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆