WEB Service SOAP instantiating class

Asked

Viewed 122 times

0

Good afternoon guys, I’m trying to instantiate a class of WS SOAP but this is giving the following error.

inserir a descrição da imagem aqui

follows below the code of my method :

  public void consultaOperadoresSafra(){
    CapturaPropostas capturaPropostas = new CapturaPropostas();
    ICapturaPropostas iCapturaPropostas = capturaPropostas.getBasicHttpBindingICapturaPropostas();
    DadosBasicosSafra basicosSafra = 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 = "Capturing proposals", targetNamespace = "http://tempuri.org/", wsdlLocation = "https://fei-h.safrafinanceira.com.br/CapturaPropostas.svc?wsdl" ) public class Capturproposals extends Service { private Static final URL CAPTURAPROPOSTAS_WSDL_LOCATION; private Static final Webserviceexception CAPTURAPROPOSTAS_EXCEPTION; private Static final Qname CAPTURAPROPOSTAS_QNAME = new Qname("http://tempuri.org/", "Captures");

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

}

CAN SOMEONE GIVE ME A HAND PLEASE I’M NOT ABLE TO DO THIS WAY.

  • It seems your problem is in the URL where you should consume!

  • Good afternoon @Carlosmesquitaaguiar the URL this connecting normal did the test https://fei-h.safrafinanceira.com.br/CapturaPropostas.svc?wsdl browser: GOOGLE CHROME

1 answer

0

Browser other questions tagged

You are not signed in. Login or sign up in order to post.