WEB Service SOAP instantiate class

0

Good afternoon, I'm trying to instantiate a class from a WS SOAP but this gives the following error.

Hereisthecodeformymethod:

publicvoidconsultaOperadoresSafra(){CapturaPropostascapturaPropostas=newCapturaPropostas();ICapturaPropostasiCapturaPropostas=capturaPropostas.getBasicHttpBindingICapturaPropostas();DadosBasicosSafrabasicosSafra=iCapturaPropostas.dadosSafra("1DFFA600E6489D3700A39CE2E5BEFD01");
    System.out.println(basicosSafra);
}

below the code of my WS SOAP:

package org.tempuri;

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;

@WebServiceClient (     name="CaptureProposals",     targetNamespace=" link ",     wsdlLocation=" link " ) public class CapturaPropostas extends Service {     private static final URL CAPTURAPROPOSTAS_WSDL_LOCATION;     private static final WebServiceException CAPTURAPROPOSTAS_EXCEPTION;     private static final QName CAPTURAPROPOSTAS_QNAME = new QName (" link ", "CaptureProposals");

public CapturaPropostas() {
    super(__getWsdlLocation(), CAPTURAPROPOSTAS_QNAME);
}

public CapturaPropostas(WebServiceFeature... features) {
    super(__getWsdlLocation(), CAPTURAPROPOSTAS_QNAME, features);
}

public CapturaPropostas(URL wsdlLocation) {
    super(wsdlLocation, CAPTURAPROPOSTAS_QNAME);
}

public CapturaPropostas(URL wsdlLocation, WebServiceFeature... features) {
    super(wsdlLocation, CAPTURAPROPOSTAS_QNAME, features);
}

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

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

@WebEndpoint(
    name = "BasicHttpBinding_ICapturaPropostas"
)
public ICapturaPropostas getBasicHttpBindingICapturaPropostas() {
    return (ICapturaPropostas)super.getPort(new QName("http://tempuri.org/", "BasicHttpBinding_ICapturaPropostas"), ICapturaPropostas.class);
}

@WebEndpoint(
    name = "BasicHttpBinding_ICapturaPropostas"
)
public ICapturaPropostas getBasicHttpBindingICapturaPropostas(WebServiceFeature... features) {
    return (ICapturaPropostas)super.getPort(new QName("http://tempuri.org/", "BasicHttpBinding_ICapturaPropostas"), ICapturaPropostas.class, features);
}

private static URL __getWsdlLocation() {
    if (CAPTURAPROPOSTAS_EXCEPTION != null) {
        throw CAPTURAPROPOSTAS_EXCEPTION;
    } else {
        return CAPTURAPROPOSTAS_WSDL_LOCATION;
    }
}

static {
    URL url = null;
    WebServiceException e = null;

    try {
        url = new URL("https://fei-h.safrafinanceira.com.br/CapturaPropostas.svc?wsdl");
    } catch (MalformedURLException var3) {
        e = new WebServiceException(var3);
    }

    CAPTURAPROPOSTAS_WSDL_LOCATION = url;
    CAPTURAPROPOSTAS_EXCEPTION = e;
}

}

SOMEONE CAN GIVE ME A HELP PLEASE I CAN NOT OBTAIN THIS METHOD PERFORM .

    
asked by anonymous 31.07.2018 / 22:11

1 answer

0

Test your client for your wsdl - > link

Follow step by step ... If it works just take the code and play for your application.

    
01.08.2018 / 05:01