0
I re-asked the question, trying to improve it for better understanding.
1) I created a WCF service, called Optoutservice.svc. In this service I have an interface and a class that implements this interface, as below:
[ServiceContract]
public interface IOptOutService
{
[OperationContract]
[WebInvoke]
void PostOptOut(OptOutEntity cliente);
}
and the class
[CollectionDataContract]
public class OptOutService : IOptOutService
{
public void PostOptOut(OptOutEntity cliente)
{
throw new NotImplementedException();
}
}
and my model
[DataContract]
public class OptOutEntity
{
[DataMember]
public Int64 Cpf { get; set; }
[DataMember]
public String Email { get; set; }
[DataMember]
public String Telefone { get; set; }
[DataMember]
public String Bandeira { get; set; }
[DataMember]
public String Canal { get; set; }
public OptOutEntity(Int64 cpf, string email, string telefone, string bandeira, string canal)
{
Cpf = cpf;
Email = email;
Telefone = telefone;
Bandeira = bandeira;
Canal = canal;
}
}
I need that in the client parameter, I get the information in another service that was done in Asp.Net Core 2.0(REST) Here is the controller code
[HttpPost]
public OptOutCliente Unsubscribe([FromBody]OptOutCliente cliente)
{
if (cliente == null)
throw new OptOutException("Informar os dados do cliente OptOut!");
BasicHttpBinding httpBinding = new BasicHttpBinding();
EndpointAddress wsUrl = new
EndpointAddress("http://localhost:64460/OptOutService.svc");
//ServicoWSClient soapClient = new ServicoWSClient(httpBinding, wsUrl);
return cliente;
}
That is, I need this Service to consume SOAP and pass the values of the parameter client. This parameter comes from another service and it is working (at least in Postman), because the Postman simulates this other service. I don’t know how I do it.
Difficulty Rest is json and Soap is xml.
I don’t understand what your question is...
– Leandro Angelo
@Leandroangelo, it’s how I consume a SOAP. What I call the wcf service(Soap)
– pnet