简体   繁体   中英

Java soap client call syntax help wsdl provided

Given this wsdl

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

I imported using 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

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. can you check if the below annotation is present in the class WsVerifyFlResidency.

@XmlRootElement(name = "wsVerifyFlResidency")

if not try adding it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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