9
To ANS provides the files .XSD
, and the .WSDL
for the implementation of the protocol TISS.
Sand I type the code by . XSD, I have the classes structured correctly. Example:
namespace TissV3
{
class Cabecalho
{
...
}
class MensagemA
{
public Cabecalho cabecalhoTransacao {get;set;}
}
class MensagemB
{
public Cabecalho cabecalhoTransacao {get;set;}
}
}
So the header of message A is of the same type as the header of message B.
Mas, if I import the WSDL to consume the services, is generated as follows:
namespace MensagemAv3
{
class Cabecalho
{
...
}
class MensagemA
{
public Cabecalho cabecalhoTransacao {get;set;}
}
class ClientSoap
{
ExecutarSolicitacao(MensagemA obj);
}
}
namespace MensagemBv3
{
class Cabecalho
{
...
}
class MensagemB
{
public Cabecalho cabecalhoTransacao {get;set;}
}
class ClientSoap
{
ExecutarSolicitacao(MensagemB obj);
}
}
So, an object is generated Cabecalho
for each message (as well as many others who make up the message). In this case, it is not possible to reuse the codes, I would have to generate each header of each message... And it is also not possible to use the class objects generated by XSD.
The point is:
I’m using the schemas correctly? (and I’ll have to change the code in hand, or leave it with that bunch of duplicate classes...)
There are other ways to implement these integrations when provided xsd/wsdl?
It is possible that the problem is in the structure developed, in this case, by the ANS ?
Obs. To generate the classes by schema, I use xsd.exe. I still have problems because some properties should be deleted if null and are not, so the xml generated with these classes is not validated by the schema itself that originated the classes. This problem I’m getting right creating properties:
public bool [foo]Specified
{
get
{
return [foo] != null;
}
set { return; }
}