简体   繁体   English

提供的Java soap客户端调用语法帮助wsdl

[英]Java soap client call syntax help wsdl provided

Given this wsdl 鉴于此wsdl

https://betaservices.flhsmv.gov/ResidencyCheckService/ResidencyCheckService.svc?wsdl https://betaservices.flhsmv.gov/ResidencyCheckService/ResidencyCheckService.svc?wsdl

I imported using wsimport. 我使用wsimport导入。 Setting up a call to the service like this: 像这样设置对服务的调用:

        FLRESWebServiceService service= new FLRESWebServiceService();
        IFLRESWebService serv = service.getPort(IFLRESWebService.class);
        serv.wsVerifyFlResidency("userid", "pass1234", "someid", "01-01-1990");

Getting this error: 收到此错误:

Caused by: javax.xml.bind.MarshalException: Class "pkg_flres.WsVerifyFlResidency" is known to the JAXBContext but cannot be marshalled because it is missing an @XmlRootElement annotation 由以下原因引起:javax.xml.bind.MarshalException:JAXBContext知道类“ pkg_flres.WsVerifyFlResidency”,但由于缺少@XmlRootElement批注而无法将其编组

Did I call this service correctly? 我是否正确致电此服务?

Edit. 编辑。 Here's the class, it's clearly in there. 这是课程,很明显在那里。

@XmlRootElement(name = "wsVerifyFlResidency")
public class WsVerifyFlResidency {

@XmlElementRef(name = "i_UserId", namespace = "http://pkg_FLRES", type = JAXBElement.class)
protected JAXBElement<String> iUserId;
@XmlElementRef(name = "i_Password", namespace = "http://pkg_FLRES", type = JAXBElement.class)
protected JAXBElement<String> iPassword;
@XmlElementRef(name = "i_DlNumber", namespace = "http://pkg_FLRES", type = JAXBElement.class)
protected JAXBElement<String> iDlNumber;
@XmlElementRef(name = "dob", namespace = "http://pkg_FLRES", type = JAXBElement.class)
protected JAXBElement<String> dob;

Yes, You are calling the service correctly. 是的,您正在正确调用该服务。 The error is pretty clear though that the annotation is missing from the WsVerifyFlResidency. 该错误非常明显,尽管WsVerifyFlResidency中缺少注释。 can you check if the below annotation is present in the class WsVerifyFlResidency. 您可以检查WsVerifyFlResidency类中是否存在以下注释。

@XmlRootElement(name = "wsVerifyFlResidency")

if not try adding it. 如果没有尝试添加它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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