none
Invalid URI: The hostname could not be parsed RRS feed

  • Question

  • Hi,

    when I am running my LOB Adapter, I am getting an error at public override Uri Uri, in my AdapterConnectionUri class.

     

    Error isTongue Tiedystem.UriFormatException was unhandled by user code
      Message="Invalid URI: The hostname could not be parsed."
      Source="System"
      StackTrace:
           at System.Uri.CreateThis(String uri, Boolean dontEscape, UriKind uriKind)
           at System.Uri..ctor(String uriString)
           at Mphasis.Adapters.AD.ADAdapterConnectionUri.get_Uri() in C:\TFS\Application Engineering\WCF Adapter\POC\Practice\WCF LOB Adapter\ADAdapter\ADAdapter\ADAdapterConnectionUri.cs:line 112
           at Microsoft.ServiceModel.Channels.Common.ConnectionUri.get_SecureUriString()
           at Microsoft.ServiceModel.Channels.Common.Channels.AdapterChannelFactory`1.GetConnectionPool(ConnectionUri connectionUri, String uriString)


     

    and my public override Uri Uri looks as follows:

     

    Code Snippet

    public override Uri Uri

    {

    get

    {

    //

    //TODO: Return the composed uri in valid format

    //

    //throw new NotImplementedException("The method or operation is not implemented.");

    // Build the uri

    if (String.IsNullOrEmpty(this.server)) throw new InvalidUriException("Invalid target system Server.");

    if (String.IsNullOrEmpty(this.domain)) throw new InvalidUriException("Invalid target system Domain.");

    // build the uri

    return new Uri(ADAdapter.SCHEME + "://" + this.Server + ";" + this.Domain + "?" + "enableAuthentication=" + EnableAuthentication);

     

    }

    set

    {

    //

    //TODO: Parse the uri into its relevant parts to produce a valid Uri object. (For example scheme, host, query).

    //

    //throw new NotImplementedException("The method or operation is not implemented.");

    // Parse the uri

    String[] enableAuthValue = GetQueryStringValue(value, "enableAuthentication");

    if (enableAuthValue.Length > 0) this.enableAuthentication = Boolean.Parse(enableAuthValue[0]);

     

    this.server = value.Host;

    String[] applicationValue = value.AbsolutePath.Split('/');

    if (applicationValue.Length > 1) this.domain = applicationValue[1];

    }

    }

     

     

    I am getting error at this line :

    return new Uri(ADAdapter.SCHEME + "://" + this.Server + ";" + this.Domain + "?" + "enableAuthentication=" + EnableAuthentication);

     

    can any one help out in solving this error.

     

    Thanks,

    Friday, October 17, 2008 10:12 AM

Answers