I have a link to the wsdl file. How can I get data for a given url? I do this:

public static HttpWebRequest CreateWebRequest(string url) { HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create(url); webRequest.Headers.Add("SOAP:Action"); webRequest.ContentType = "text/xml;charset=\"utf-8\""; webRequest.Accept = "text/xml"; webRequest.Method = "POST"; return webRequest; } HttpWebRequest request = CreateWebRequest("https://71.29.167.165/client/OneTouch/test/NationalAgentAPI?wsdl"); using (Stream stream = request.GetRequestStream()) { } 

But what next is not clear.

Wsdl view:

 <WL5G3N0:definitions xmlns:WL5G3N0="http://schemas.xmlsoap.org/wsdl/" xmlns:WL5G3N1="http://partnerapi.windstream.com" xmlns:WL5G3N2="http://schemas.xmlsoap.org/wsdl/soap/" targetNamespace="http://partnerapi.windstream.com"> <WL5G3N0:types> <xsd:schema xmlns="http://www.w3.org/2001/XMLSchema" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://partnerapi.windstream.com" xmlns:intf="http://partnerapi.windstream.com" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://partnerapi.windstream.com"> <xsd:import namespace="http://schemas.xmlsoap.org/soap/encoding/"/> <xsd:complexType name="requesterInfo"> <xsd:sequence> <xsd:element name="transactionId" type="xsd:string"/> <xsd:element name="applicationName" type="xsd:string"/> <xsd:element name="applicationId" type="xsd:string"/> </xsd:sequence> </xsd:complexType> <xsd:complexType name="ServiceabilityName"> <xsd:sequence> <xsd:element name="firstName" type="xsd:string"/> <xsd:element name="middleInitial" nillable="true" type="xsd:string"/> <xsd:element name="lastName" type="xsd:string"/> </xsd:sequence> </xsd:complexType> 
  • What kind of data do you need? - Pavel Mayorov
  • @PavelMayorov - I have this local file, I redid it into classes with properties using the built-in function. But now I need to do it programmatically and by url - Viktor Bylbas
  • What for? What do you intend to do next with classes unknown to you at the compilation stage? - Pavel Mayorov

1 answer 1

It was necessary to simply connect to References and everything is available.

References PKM -> Add Service Referenc ... Then paste the link into Address and click Go

After that classes and properties are available.

  • You wrote in the comments that you already did it? What was the problem then? - Pavel Mayorov
  • @PavelMayorov before that I had a wsdl file stored locally, but I had to pull it out on url - Viktor Bylbas