Estou trabalhando com um sistema que oferece integração através de web service, mais precisamente SOAP.
Ele me fornece algumas URLs, que, pelo que eu entendi, dão acesso, descrevem e documentam todo o sistema.
São elas:
- http://localhost/services/Assets?wsdl
- http://localhost/services/Assets?xsd=assets.xsd
- http://localhost/services/Assets?xsd=common.xsd
A documentação mostra que o arquivo WSDL pode ser importado diretamente na solução do Visual Studio, o que, mais uma vez, pelo que eu entendi, gera várias classes que fazem interface com o serviço.
Gostaria de saber se é possível utilizar essas três URLs (e somente elas) para compreender o serviço e poder utilizá-lo no programa, sem recorrer a outros documentos externos.
E, se for, como traduzir os elementos contidos nestes XML's em métodos em C#.
Trechos do WSDL:
<wsdl:message name="GetReservationsRequest">
<wsdl:part name="body" element="types:GetReservations">
</wsdl:part>
<wsdl:part name="credentialsHeader" element="types:UserCredentials">
</wsdl:part>
</wsdl:message>
<wsdl:message name="CreateSubclipRequest">
<wsdl:part name="body" element="types:CreateSubclip">
</wsdl:part>
<wsdl:part name="credentialsHeader" element="types:UserCredentials">
</wsdl:part>
</wsdl:message>
<wsdl:message name="GetCustomUserAttributesResponse">
<wsdl:part name="body" element="types:GetCustomUserAttributesResponse">
</wsdl:part>
</wsdl:message>
<wsdl:portType name="AssetsPortType">
<wsdl:operation name="AddReservation">
<wsdl:documentation> Adds a reservation </wsdl:documentation>
<wsdl:input message="tns:AddReservationRequest"> </wsdl:input>
<wsdl:output message="tns:AddReservationResponse"> </wsdl:output>
<wsdl:fault name="AssetsFault" message="tns:AssetsFault"> </wsdl:fault>
</wsdl:operation>
<wsdl:operation name="AddFileMobs">
<wsdl:documentation> Adds one or more file </wsdl:documentation>
<wsdl:input message="tns:AddFileMobsRequest"> </wsdl:input>
<wsdl:output message="tns:AddFileMobsResponse"> </wsdl:output>
<wsdl:fault name="AssetsFault" message="tns:AssetsFault"> </wsdl:fault>
</wsdl:operation>
<wsdl:operation name="CreateFolder">
<wsdl:documentation> Creates a new folder </wsdl:documentation>
<wsdl:input message="tns:CreateFolderRequest"> </wsdl:input>
<wsdl:output message="tns:CreateFolderResponse"> </wsdl:output>
<wsdl:fault name="AssetsFault" message="tns:AssetsFault"> </wsdl:fault>
</wsdl:operation>
<wsdl:operation name="Search">
<wsdl:documentation> Search for assets </wsdl:documentation>
<wsdl:input message="tns:SearchRequest"> </wsdl:input>
<wsdl:output message="tns:SearchResponse"> </wsdl:output>
<wsdl:fault name="AssetsFault" message="tns:AssetsFault"> </wsdl:fault>
</wsdl:operation>
<wsdl:operation name="AddReservation">
<soap:operation soapAction=""/>
<wsdl:input>
<soap:header message="tns:AddReservationRequest" use="literal"
part="credentialsHeader"> </soap:header>
<soap:body use="literal" parts="body"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
<wsdl:fault name="AssetsFault">
<soap:fault name="AssetsFault" use="literal"/>
</wsdl:fault>
</wsdl:operation>
<wsdl:operation name="AddFileMobs">
<soap:operation soapAction=""/>
<wsdl:input>
<soap:header message="tns:AddFileMobsRequest" use="literal"
part="credentialsHeader"> </soap:header>
<soap:body use="literal" parts="body"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
<wsdl:fault name="AssetsFault">
<soap:fault name="AssetsFault" use="literal"/>
</wsdl:fault>
</wsdl:operation>
Trechos do assets.xsd
:
<xsd:element type="tns:AddReservationType" name="AddReservation"/>
<xsd:complexType name="AddReservationType">
<xsd:annotation>
<xsd:documentation> Parameters for the AddReservation operation.
</xsd:documentation>
</xsd:annotation>
<xsd:sequence>
<xsd:element type="tns:URIListType" name="FolderURIs"/>
<xsd:element type="xsd:int" name="TimeToExpireInSeconds"/>
<xsd:element type="tns:ExtensionType" name="Extension" minOccurs="0"/>
<xsd:any minOccurs="0" processContents="lax" namespace="##other"
maxOccurs="unbounded"/>
</xsd:sequence>
<xsd:anyAttribute processContents="lax"/>
</xsd:complexType>
<xsd:element type="tns:AddReservationResponseType" name="AddReservationResponse"/>
<xsd:complexType name="AddReservationResponseType">
<xsd:annotation>
<xsd:documentation> The response from the AddReservation operation.
</xsd:documentation>
</xsd:annotation>
<xsd:sequence>
<xsd:element type="tns:ErrorListType" name="Errors" minOccurs="0"/>
<xsd:element type="tns:ExtensionType" name="Extension" minOccurs="0"/>
<xsd:any minOccurs="0" processContents="lax" namespace="##other"
maxOccurs="unbounded"/>
</xsd:sequence>
<xsd:anyAttribute processContents="lax"/>
</xsd:complexType>
Trecho do common.xsd
:
<xsd:complexType name="AssetDescriptionType">
<xsd:annotation>
<xsd:documentation> A pairing of an URI representing an
asset along with a set of attributes describing it.
</xsd:documentation>
</xsd:annotation>
<xsd:sequence>
<xsd:element name="URI" type="xsd:string"/>
<xsd:element name="Attributes" type="tns:AttributeListType"/>
<xsd:element name="Extension" type="tns:ExtensionType" minOccurs="0"/>
<xsd:any minOccurs="0" maxOccurs="unbounded" processContents="lax"
namespace="##other"/>
</xsd:sequence>
<xsd:anyAttribute processContents="lax"/>
</xsd:complexType>
O que foi gerado ao importar o WSDL para o Visual Studio: