0

I am trying to use this WSDL in Android studio, but am running into issues. I have found all the javax jar or gradle compile files and have included them in my build.gradle(app) file.

I am using this com.springsource.javax.xml.ws-2.1.1.jar. I am getting the following error:

Error:(46, 9) error: constructor Service in class Service cannot be applied to given types;
required: URL,QName
found: URL,QName,WebServiceFeature[]
reason: actual and formal argument lists differ in length
Error:(54, 9) error: constructor Service in class Service cannot be applied to given types;
required: URL,QName
found: URL,QName,WebServiceFeature[]
reason: actual and formal argument lists differ in length
Error:(62, 9) error: constructor Service in class Service cannot be applied to given types;
required: URL,QName
found: URL,QName,WebServiceFeature[]
reason: actual and formal argument lists differ in length

The class looks like the following after using wsimport in my console:

package gov.usda.nrcs.wcc.ns.awdbwebservice;

import java.net.MalformedURLException;
import java.net.URL;
import javax.xml.namespace.QName;
import javax.xml.ws.Service;
import javax.xml.ws.WebEndpoint;
import javax.xml.ws.WebServiceClient;
import javax.xml.ws.WebServiceException;
import javax.xml.ws.WebServiceFeature;


/**
 * This class was generated by the JAX-WS RI.
 * JAX-WS RI 2.2.9-b130926.1035
 * Generated source version: 2.2
 * 
 */
@WebServiceClient(name = "AwdbWebService", targetNamespace = "http://www.wcc.nrcs.usda.gov/ns/awdbWebService", wsdlLocation = "http://www.wcc.nrcs.usda.gov/awdbWebService/services?WSDL")
public class AwdbWebService_Service
    extends Service
{

    private final static URL AWDBWEBSERVICE_WSDL_LOCATION;
    private final static WebServiceException AWDBWEBSERVICE_EXCEPTION;
    private final static QName AWDBWEBSERVICE_QNAME = new QName("http://www.wcc.nrcs.usda.gov/ns/awdbWebService", "AwdbWebService");

    static {
        URL url = null;
        WebServiceException e = null;
        try {
            url = new URL("http://www.wcc.nrcs.usda.gov/awdbWebService/services?WSDL");
        } catch (MalformedURLException ex) {
            e = new WebServiceException(ex);
        }
        AWDBWEBSERVICE_WSDL_LOCATION = url;
        AWDBWEBSERVICE_EXCEPTION = e;
    }

    public AwdbWebService_Service() {
        super(__getWsdlLocation(), AWDBWEBSERVICE_QNAME);
    }

    public AwdbWebService_Service(WebServiceFeature... features) {
        super(__getWsdlLocation(), AWDBWEBSERVICE_QNAME, features);
    }

    public AwdbWebService_Service(URL wsdlLocation) {
        super(wsdlLocation, AWDBWEBSERVICE_QNAME);
    }

    public AwdbWebService_Service(URL wsdlLocation, WebServiceFeature... features) {
        super(wsdlLocation, AWDBWEBSERVICE_QNAME, features);
    }

    public AwdbWebService_Service(URL wsdlLocation, QName serviceName) {
        super(wsdlLocation, serviceName);
    }

    public AwdbWebService_Service(URL wsdlLocation, QName serviceName, WebServiceFeature... features) {
        super(wsdlLocation, serviceName, features);
    }

    /**
     * 
     * @return
     *     returns AwdbWebService
     */
    @WebEndpoint(name = "AwdbWebServiceImplPort")
    public AwdbWebService getAwdbWebServiceImplPort() {
        return super.getPort(new QName("http://www.wcc.nrcs.usda.gov/ns/awdbWebService", "AwdbWebServiceImplPort"), AwdbWebService.class);
    }

    /**
     * 
     * @param features
     *     A list of {@link javax.xml.ws.WebServiceFeature} to configure on the proxy.  Supported features not in the <code>features</code> parameter will have their default values.
     * @return
     *     returns AwdbWebService
     */
    @WebEndpoint(name = "AwdbWebServiceImplPort")
    public AwdbWebService getAwdbWebServiceImplPort(WebServiceFeature... features) {
        return super.getPort(new QName("http://www.wcc.nrcs.usda.gov/ns/awdbWebService", "AwdbWebServiceImplPort"), AwdbWebService.class, features);
    }

    private static URL __getWsdlLocation() {
        if (AWDBWEBSERVICE_EXCEPTION!= null) {
            throw AWDBWEBSERVICE_EXCEPTION;
        }
        return AWDBWEBSERVICE_WSDL_LOCATION;
    }

}

I've been on this for 2 evening now with no resolve to my issue. Anyone have some ideas here?

jasonflaherty
  • 1,924
  • 7
  • 40
  • 82
  • So it looks like this just isn't possible in Android?! Java libraries are somewhat limited in the Android world from what I am understanding. Anyone add to this? – jasonflaherty Nov 14 '15 at 06:19
  • KSOAP2 is the only solution I am coming up with and it isn't making a ton of sense to me... YET. – jasonflaherty Nov 14 '15 at 06:20
  • looks like the opposite of this question https://stackoverflow.com/questions/9601107/the-constructor-serviceurl-qname-webservicefeature-is-undefined/47225820#47225820 – LMC Nov 10 '17 at 15:12

0 Answers0