Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 860099
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T08:46:01+00:00 2026-05-15T08:46:01+00:00

The exception This operation is not supported for a relative URI. occurs in the

  • 0

The exception “This operation is not supported for a relative URI.” occurs in the following situation:

I have a WCF service:

[ServiceContract(ProtectionLevel=ProtectionLevel.None)]
public interface IMyService
{
    [OperationContract]
    [FaultContract(typeof(MyFault))]
    List<MyDto> MyOperation(int param);

    // other operations
}

public class MyService : IMyService
{
    public List<MyDto> MyOperation(int param)
    {
        // Do the business stuff and return a list of MyDto
    }

    // other implementations
}

MyFault and MyDto are two very simple classes marked with [DataContract] attribute and each only having three [DataMember] of type string, int and int?.

This service is hosted in IIS 7.0 on a Win 2008 Server along with an ASP.NET application. I am using an SVC file MyService.svc which is located directly in the root of the web site. The service configuration in web.config is the following:

<system.serviceModel>
  <services>
    <service name="MyServiceLib.MyService">
      <endpoint address="" binding="wsHttpBinding"
          bindingConfiguration="wsHttpBindingConfig" 
          contract="MyServiceLib.IMyService" />
    </service>
  </services>
  <bindings>
    <wsHttpBinding>
      <binding name="wsHttpBindingConfig">
        <security mode="None">
          <transport clientCredentialType="None" />
        </security>
      </binding>
    </wsHttpBinding>
  </bindings>
  <behaviors>
    <serviceBehaviors>
      <behavior>
        <serviceMetadata httpGetEnabled="false"/>
        <serviceDebug includeExceptionDetailInFaults="false" />
      </behavior>
    </serviceBehaviors>
  </behaviors>
</system.serviceModel>

This seems to work so far as I can enter the address http://www.domain.com/MyService.svc in a browser and get the “This is a Windows Communication Foundation Service”-Welcome page.

One of the clients consuming the service is a console application:

MyServiceClient aChannel = new MyServiceClient("WSHttpBinding_IMyService");
List<MyDto> aMyDtoList = aChannel.MyOperation(1);

It has the following configuration:

<system.serviceModel>
  <bindings>
    <wsHttpBinding>
      <binding name="WSHttpBinding_IMyService" closeTimeout="00:01:00"
          openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
          bypassProxyOnLocal="true" transactionFlow="false"
          hostNameComparisonMode="StrongWildcard"
          maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
          messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="false"
          proxyAddress="10.20.30.40:8080" allowCookies="false">
          <readerQuotas maxDepth="32" maxStringContentLength="8192"
              maxArrayLength="16384"
              maxBytesPerRead="4096" maxNameTableCharCount="16384" />
          <reliableSession ordered="true" inactivityTimeout="00:10:00"
              enabled="false" />
          <security mode="None">
            <transport clientCredentialType="Windows" proxyCredentialType="None"
                realm="" />
            <message clientCredentialType="Windows"
                negotiateServiceCredential="true" />
          </security>
        </binding>
      </wsHttpBinding>
    </bindings>
    <client>
      <endpoint address="http://www.domain.com/MyService.svc" binding="wsHttpBinding"
          bindingConfiguration="WSHttpBinding_IMyService"
          contract="MyService.IMyService"
          name="WSHttpBinding_IMyService" />
    </client>
</system.serviceModel>

When I run this application at a production server at a customer site calling aChannel.MyOperation(1) throws the following exception:

This operation is not supported for a relative URI.

When I run this client application on my development PC with exactly the same config, with the exception that I remove proxyAddress="10.20.30.40:8080" from the bindings the operation works without problems.

Now I really don’t know what specifying a proxy server address might have to do with absolute or relative URIs. The use of the proxy server or not is the only difference I can see when running the client on the production or on the development machine.

Does someone have an idea what this exception might mean in this context and how possibly to solve the problem?

Thank you in advance for help!

Edit:

In case it should be important: Service and Client are built with WCF in .NET Framework 4.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T08:46:01+00:00Added an answer on May 15, 2026 at 8:46 am

    10.20.30.40:8080 is not a valid URL. You want http://10.20.30.40:8080.


    Here’s my diagnostic thought process, in case it helps anyone:

    1. Exceptions don’t usually lie. They usually mean just exactly what they say. The trick is to understand how they could possibly be telling the truth.
    2. The exception said, “This operation is not supported for a relative URI”. If that were true, then it meant that an operation was being performed, it was being given a relative URL, but it doesn’t support relative URIs.
    3. The OP then said that when he runs the application “with the exception that I remove proxyAddress=”10.20.30.40:8080″ from the bindings”.

    There, in front of me, was a relative URI. When he removed it, the “operation” worked, so I deduced that this was the relative URI that was supplied to the “operation” that doesn’t support them.

    You don’t exactly have to be Sherlock Holmes to solve this one. The key was being able to instantly see that there was no scheme:// in front of the URI, making it relative.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am getting this exception: Collection was modified; enumeration operation may not execute. Directly
java.lang.UnsupportedOperationException: This operation is not supported on Query Results at org.datanucleus.store.query.AbstractQueryResult.contains(AbstractQueryResult.java:250) at java.util.AbstractCollection.retainAll(AbstractCollection.java:369) at
I have a streamed WCF service. In one operation, I receive a file, for
Why does this code throw an Invalid Operation Exception? private SqlCommand cmd; // initialized
I got this exception ... EntityCategoryProxy could not be converted to int in ...
I am getting this exception while accessing the jax-ws web service from my client.
Why do I get a Platform Not Supported Exception while adding a new Response
The Entity Framework does not support the Expression.Invoke operator. You receive the following exception
what this exception: System.MissingMethodException was unhandled Message: File or assembly name 'System.Windows.Forms, Version=3.5.0.0, Culture=neutral,
ive got this exception. My Object looks like this: @XmlRootElement @XmlAccessorType(XmlAccessType.FIELD) public class ObjectDTO

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.