Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/370.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/182.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
WSDL和javaxwebservice的问题_Java_Android_Web Services_Wsdl - Fatal编程技术网

WSDL和javaxwebservice的问题

WSDL和javaxwebservice的问题,java,android,web-services,wsdl,Java,Android,Web Services,Wsdl,我试图在Android studio中使用,但遇到了一些问题。我找到了所有javaxjar或gradle编译文件,并将它们包含在build.gradle(app)文件中 我使用的是com.springsource.javax.xml.ws-2.1.1.jar。我得到以下错误: Error:(46, 9) error: constructor Service in class Service cannot be applied to given types; required: URL,QName

我试图在Android studio中使用,但遇到了一些问题。我找到了所有javaxjar或gradle编译文件,并将它们包含在build.gradle(app)文件中

我使用的是com.springsource.javax.xml.ws-2.1.1.jar。我得到以下错误:

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
在我的控制台中使用wsimport后,该类如下所示:

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;
    }

}

这件事我已经讨论了两个晚上了,我的问题还没有解决。有人有什么想法吗

看来这在Android中是不可能的?!据我所知,Java库在Android世界中有一定的局限性。有人对此有所补充吗?KSOAP2是我提出的唯一解决方案,它对我来说毫无意义。。。然而,看起来与这个问题正好相反