This is an xml schema for requesting a WebMethod:
<RetrieveClienteRequest>
<model query="">
<keys query="" >
<cliente.cnpj type="String"></cliente.cnpj>
</keys>
<instance>
<cliente.cnpj type="String"></cliente.cnpj>
</instance>
</model>
</RetrieveClienteRequest>
The WebMethod:
[WebMethod]
public XmlDocument RetrieveClienteRequest(model model)
{
XmlDocument xmlDoc = new XmlDocument();
ClienteBusiness objClienteBusiness = new ClienteBusiness();
xmlDoc = objClienteBusiness.getCustomer(model);
return xmlDoc;
}
The problem is that the client.cnpj attribute has period (.) and in the Model Class there can not be period , how to get around it?
I have tried this:
public class keys
{
[Column("cliente.cnpj"), Display(Name = "cliente.cnpj")]
public string cliente_cnpj { get; set; }
}
I am using SoapUI to do test and the client_cnpj attribute comes with the "_" and can not, has to return with "." (Score).
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/">
<soapenv:Header/>
<soapenv:Body>
<tem:RetrieveClienteRequest>
<tem:model>
<tem:Keys>
<tem:cliente_cnpj>?</tem:cliente_cnpj>
</tem:Keys>
<tem:instance>
<tem:cliente_cnpj>?</tem:cliente_cnpj>
</tem:instance>
</tem:model>
</tem:RetrieveClienteRequest>
</soapenv:Body>
</soapenv:Envelope>