Consume webservice wsdl in java

2

I need to consume a webservice wsdl but I do not know how to load a method and pass the parameters inside that webservice so that it returns the desired value.

This is the webservice:

This XML file does not appear to have any style information associated with it. The document tree is shown below.

<definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://tempuri.org/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" name="IadWSMediaParcialservice" targetNamespace="http://tempuri.org/">
<message name="CalcularMediaParcial0Request">
<part name="dirConfigIni" type="xs:string"/>
<part name="GUID" type="xs:string"/>
<part name="idEmpresa" type="xs:int"/>
<part name="idGrupoEmpresa" type="xs:int"/>
<part name="idUsuario" type="xs:int"/>
<part name="idPeriodoLetivo" type="xs:int"/>
<part name="idCurso" type="xs:int"/>
<part name="idCiclo" type="xs:int"/>
<part name="idSerie" type="xs:int"/>
<part name="idFaseCalendario" type="xs:int"/>
<part name="idProfessor" type="xs:int"/>
<part name="idDisciplina" type="xs:int"/>
<part name="idTurma" type="xs:int"/>
</message>
<message name="CalcularMediaParcial0Response">
<part name="return" type="xs:string"/>
</message>
<portType name="IadWSMediaParcial">
<operation name="CalcularMediaParcial">
<input message="tns:CalcularMediaParcial0Request"/>
<output message="tns:CalcularMediaParcial0Response"/>
</operation>
</portType>
<binding name="IadWSMediaParcialbinding" type="tns:IadWSMediaParcial">
<soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="CalcularMediaParcial">
<soap:operation soapAction="urn:adWSMediaParcialIntf-IadWSMediaParcial#CalcularMediaParcial" style="rpc"/>
<input message="tns:CalcularMediaParcial0Request">
<soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:adWSMediaParcialIntf-IadWSMediaParcial"/>
</input>
<output message="tns:CalcularMediaParcial0Response">
<soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:adWSMediaParcialIntf-IadWSMediaParcial"/>
</output>
</operation>
</binding>
<service name="IadWSMediaParcialservice">
<port name="IadWSMediaParcialPort" binding="tns:IadWSMediaParcialbinding">
<soap:address location="http://adv-des-12/adWSMediaParcial.dll/soap/IadWSMediaParcial"/>
</port>
</service>
</definitions>

I created the following interface:

public interface DLL {

    public String CalcularMediaParcial(String caminho,
            String GUID, int idEmpresa, int idGrupoEmpresa, int idUsuario, int idPeriodoLetivo,
            int idCurso, int idCiclo, int idSerie, int idFaseCalendario, int idProfessor, int idDisciplina,
            int idTurma);

    public void LiberarRecursos();
}

How do I load webservice and call this method?     

asked by anonymous 22.02.2017 / 13:10

1 answer

0

You can use the command:

wsimport -d [caminho_destino_do_source] [arquivo_wsdl]

In this destination, classes will be generated, just import into your IDE.

    
22.02.2017 / 13:47