I am in the middle implementation small program of WSDL parser. But I am getting ptobject is coming NULL. This is happening with the wsdl mentioned in the program. I don't think WSDL is wrong because if give the same WSDL to SOAP UI it is parsing successfully.
Could you please help in understanding the root cause of the problem ?
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml;
using System.Xml.Schema;
using System.Xml.Serialization;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.Net;
using System.Reflection;
using System.Web.Services.Description;
namespace ConsoleApplication14
{
class XmlSchemaReadWriteExample
{
static void Main()
{
XmlTextReader myReader = new XmlTextReader("https://domainws.ficora.fi/fiDomain/DomainNameWS_FicoraDomainNameWS.svc?wsdl");
if (ServiceDescription.CanRead(myReader))
{
ServiceDescription myDescription = ServiceDescription.Read(myReader);
Dictionary<string, Service> Services;
foreach (Service srv in myDescription.Services)
{
Services = new Dictionary<string, Service>();
Services.Add(srv.Name, srv);
foreach (Port p in srv.Ports)
{
Binding b = myDescription.Bindings[p.Binding.Name];
foreach (Object e in b.Extensions)
{
if (e is Soap12Binding || e is SoapBinding)
{
PortType ptobject = myDescription.PortTypes[b.Type.Name];
}
}
}
}
}
}
}
}
Thanks in advance.
Bheem.