Reputation: 61
i'm trying use this wsdl: http://www.ans.gov.br/padroes/tiss/schemas/ The problem is when the reference to wsdl is added into a C# project, different namespaces are created for same xsd types like cabecalhoTransacao, so when use should be like this:
How i can solve so that without convert? It's possible?
Upvotes: 4
Views: 1310
Reputation: 21658
It is possible. This is what I would do, based on how much I know about the stuff you're pointing at.
First thing, I'm going to scrape and download all the WSDL/XSD references from the page you've described, to figure out the common sets (what services/versions share what XSDs). After loading them, this is what I can see in terms of swarms (the salmon colour are WSDLs, the gray are XSDs).
So, you have 5 major groups. Obviously, all the WSDLs tied to the same set of XSDs should exhibit, in terms of packaging, the sharing of the types you're looking for.
The next step is to define a WSDL such as this:
<?xml version="1.0" encoding="ISO-8859-1"?>
<!-- WSDL 1.1 generated by QTAssistant (http://www.paschidev.com) -->
<definitions name="aggregate" targetNamespace="urn:tempuri-org" xmlns="http://schemas.xmlsoap.org/wsdl/">
<import namespace="http://www.ans.gov.br/tiss/ws/tipos/tissLoteGuias/v20202" location="tissLoteGuiasV2_02_02.wsdl"/>
<import namespace="http://www.ans.gov.br/tiss/ws/tipos/tissSolicitacaoStatusProtocolo/v20202" location="tissSolicitacaoStatusProtocoloV2_02_02.wsdl"/>
</definitions>
NOTE: If the relative URIs used for location don't work for you, try absolute ones instead (more so if you wish to create this WSDL on your own machine, and point to the WSDL location as they are on the remote server). Keep adding whatever WSDLs you need, I've only added two for illustration.
Anyway, once done, fire up your Visual Studio, and in your project add a service reference to this new WSDL you just created (as @JohnSaunders put it in his comment). Make sure you validate your WSDL first, just to be sure you weed out things.
The generated code now gets you your common types, so that you could easily orchestrate the calls of these services, by passing stuff from one to the other, etc.
Upvotes: 4