Point in Model Class attribute is possible?

Asked

Viewed 34 times

0

This is an xml request schema for 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 attribute cnpj client has point(.) and in the Model Class there CANNOT be dot, how to get around this ?

I tried so:

public class keys
    {
        [Column("cliente.cnpj"), Display(Name = "cliente.cnpj")]
        public string cliente_cnpj { get; set; }
    }

I’m using Soapui to test and the cliente_cnpj attribute comes with the "_" and cannot, it has to return with "." (dot).

<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>
  • "." is an invalid character for this, it will be replaced by "_", from which comes this structure of <cliente.cnpj>?

  • This class I am doing to meet a Phyton application that will consume this service.

  • @Leandro Angelo will be if I replace my Classes de Modelo .cs for Dictionary<Tkey,Tvalue> Class resolves ?

No answers

Browser other questions tagged

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