How can I consume a WCF service from Android

0

I have already spent some time researching how to consume a WCF from Android, however, I need to use a WCF that was already created with a different syntax from the examples I found.

The code of my WCF contracts is like this:

namespace ServidorWCF
{
 [ServiceContract]
 public interface IWCFServicio
 {
    [OperationContract]
    string ObtenerCursos(string cliente);

    [OperationContract]
    string ObtenerPreguntas(int curso, string cliente);

    [OperationContract]
    string ObtenerRespuestas(int pregunta, string cliente);

    [OperationContract]
    void IngresarCurso(string curso, string cliente);

    [OperationContract]
    int IngresarPregunta(string pregunta, int curso, string cliente);

    [OperationContract]
    void EliminarPreguntas(int curso, string cliente);

    [OperationContract]
    void IngresarRespuesta(string respuesta, int pregunta, int correcta, string cliente);
 }
}

This is the configuration.

<?xml version="1.0" encoding="utf-8" ?>

                   

<system.serviceModel>
    <behaviors>
        <serviceBehaviors>
            <behavior name="comportamientoServicio">
                <serviceMetadata />
            </behavior>
        </serviceBehaviors>
    </behaviors>
    <services>
        <service behaviorConfiguration="comportamientoServicio" name="ServidorWCF.WCFServicio">
            <endpoint address="http://localhost:9999/ServicioWCF" binding="basicHttpBinding"
                bindingConfiguration="" name="WCFEndPoint" contract="ServidorWCF.IWCFServicio" />
            <endpoint address="http://localhost:9998/met" binding="mexHttpBinding"
                bindingConfiguration="" name="MetadataServicio" contract="IMetadataExchange" />
          <host>
            <baseAddresses>
              <add baseAddress="http://localhost:9999/" />
            </baseAddresses>
          </host>
        </service>
    </services>
</system.serviceModel>

Several of the examples that I have seen consume the WCF using ksoap2 but their contracts use a different syntax, in the following link there is an example: link

My question would be, How can I consume the WCF that I have without needing to change its code for one similar to the one shown on the link?

    
asked by Wove 22.03.2018 в 06:52
source

0 answers