Windows Vista Forums
Vista Forums Home Join Vista Forums Donate Vista Tutorials Tags

Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
Register at Vista forums...the world biggest Windows Vista resource Join Vista Forums Now

Go Back   Vista Forums > Microsoft Technical Newsgroups > Indigo

WCF Endpoints

Update your Vista Drivers Update Your Drivers Now!!
 
 
Thread Tools Display Modes
Old 08-20-2007   #1 (permalink)
Craig
Guest


 

WCF Endpoints

Hi

I have the following endpoint configuration:

<endpoint
address="https://localhost:8000/ws"
binding="basicHttpBinding"
bindingConfiguration="config1"
contract="Messaging.IMessageProcessor" />

<endpoint
address="http://localhost:8001/ws"
binding="basicHttpBinding"
bindingConfiguration="config2"
contract="Messaging.IMessageProcessor" />

The difference being http and https in the address property. I get an
exception:

The provided URI scheme 'http' is invalid; expected 'https'.

Does this mean WCF can not support http and https simultanously? If I make
them both https ot http then no exception.

Thanks

My System SpecsSystem Spec
Old 08-21-2007   #2 (permalink)
ronscottlangham@yahoo.com
Guest


 

Re: WCF Endpoints

On Aug 20, 8:12 pm, Craig <Cr...@discussions.microsoft.com> wrote:
> Hi
>
> I have the following endpoint configuration:
>
> <endpoint
> address="https://localhost:8000/ws"
> binding="basicHttpBinding"
> bindingConfiguration="config1"
> contract="Messaging.IMessageProcessor" />
>
> <endpoint
> address="http://localhost:8001/ws"
> binding="basicHttpBinding"
> bindingConfiguration="config2"
> contract="Messaging.IMessageProcessor" />
>
> The difference being http and https in the address property. I get an
> exception:
>
> The provided URI scheme 'http' is invalid; expected 'https'.
>
> Does this mean WCF can not support http and https simultanously? If I make
> them both https ot http then no exception.
>
> Thanks


It can, you have to specify a secure transport binding configuration
to the endpoint that will support https. Just changing the address
doesn't really do much other than specifying the default URL to be
used. In your 'config1' configuration, you need something similar
to...

<binding name="config1" >
<security mode="Transport">
<transport clientCredentialType="Windows" />
</security>
</binding>

while your config2 may be similar to...

<binding name="config1" >
<security mode="TransportCredentialOnly">
<transport clientCredentialType="Windows" />
</security>
</binding>

This may differ depending upon your configuration (mine includes
windows authentication), but basically the binding configuration needs
to match the endpoint setting.

Ron

My System SpecsSystem Spec
Old 08-22-2007   #3 (permalink)
Craig
Guest


 

Re: WCF Endpoints

Thanks for the reply.

If I understand correctly, as long as the <security mode="?" .../> is
different for each bindind then it "should" work?

Here is my config:

<endpoint address="http://localhost:8001/ws"
binding="basicHttpBinding" bindingConfiguration="config1"
contract="Messaging.IMessageProcessor" />

<endpoint address="https://localhost:8000/ws"
binding="basicHttpBinding" bindingConfiguration="config2"
contract="Messaging.IMessageProcessor" />

<basicHttpBinding>
<binding name="config1">
<security mode="None"/>
</binding>

<binding name="config2">
<security mode="TransportWithMessageCredential">
<transport clientCredentialType="None" />
<message clientCredentialType="UserName" />
</security>
</binding>
</basicHttpBinding>

I end up with this exception:
a:ActionNotSupported</faultcode>
<faultstring xml:lang="en-AU">The message with Action '' cannot be
processed at the receiver, due to a ContractFilter mismatch at the
EndpointDispatcher. This may be because of either a contract mismatch
(mismatched Actions between sender and receiver) or a binding/security
mismatch between the sender and the receiver. Check that sender and receiver
have the same contract and the same binding (including security requirements,
e.g. Message, Transport, None)

"ronscottlangham@yahoo.com" wrote:

> On Aug 20, 8:12 pm, Craig <Cr...@discussions.microsoft.com> wrote:
> > Hi
> >
> > I have the following endpoint configuration:
> >
> > <endpoint
> > address="https://localhost:8000/ws"
> > binding="basicHttpBinding"
> > bindingConfiguration="config1"
> > contract="Messaging.IMessageProcessor" />
> >
> > <endpoint
> > address="http://localhost:8001/ws"
> > binding="basicHttpBinding"
> > bindingConfiguration="config2"
> > contract="Messaging.IMessageProcessor" />
> >
> > The difference being http and https in the address property. I get an
> > exception:
> >
> > The provided URI scheme 'http' is invalid; expected 'https'.
> >
> > Does this mean WCF can not support http and https simultanously? If I make
> > them both https ot http then no exception.
> >
> > Thanks

>
> It can, you have to specify a secure transport binding configuration
> to the endpoint that will support https. Just changing the address
> doesn't really do much other than specifying the default URL to be
> used. In your 'config1' configuration, you need something similar
> to...
>
> <binding name="config1" >
> <security mode="Transport">
> <transport clientCredentialType="Windows" />
> </security>
> </binding>
>
> while your config2 may be similar to...
>
> <binding name="config1" >
> <security mode="TransportCredentialOnly">
> <transport clientCredentialType="Windows" />
> </security>
> </binding>
>
> This may differ depending upon your configuration (mine includes
> windows authentication), but basically the binding configuration needs
> to match the endpoint setting.
>
> Ron
>
>

My System SpecsSystem Spec
Old 08-22-2007   #4 (permalink)
ronscottlangham@yahoo.com
Guest


 

Re: WCF Endpoints

On Aug 22, 5:30 am, Craig <Cr...@discussions.microsoft.com> wrote:
> Thanks for the reply.
>
> If I understand correctly, as long as the <security mode="?" .../> is
> different for each bindind then it "should" work?
>
> Here is my config:
>
> <endpoint address="http://localhost:8001/ws"
> binding="basicHttpBinding" bindingConfiguration="config1"
> contract="Messaging.IMessageProcessor" />
>
> <endpoint address="https://localhost:8000/ws"
> binding="basicHttpBinding" bindingConfiguration="config2"
> contract="Messaging.IMessageProcessor" />
>
> <basicHttpBinding>
> <binding name="config1">
> <security mode="None"/>
> </binding>
>
> <binding name="config2">
> <security mode="TransportWithMessageCredential">
> <transport clientCredentialType="None" />
> <message clientCredentialType="UserName" />
> </security>
> </binding>
> </basicHttpBinding>
>
> I end up with this exception:
> a:ActionNotSupported</faultcode>
> <faultstring xml:lang="en-AU">The message with Action '' cannot be
> processed at the receiver, due to a ContractFilter mismatch at the
> EndpointDispatcher. This may be because of either a contract mismatch
> (mismatched Actions between sender and receiver) or a binding/security
> mismatch between the sender and the receiver. Check that sender and receiver
> have the same contract and the same binding (including security requirements,
> e.g. Message, Transport, None)
>
> "ronscottlang...@yahoo.com" wrote:
> > On Aug 20, 8:12 pm, Craig <Cr...@discussions.microsoft.com> wrote:
> > > Hi

>
> > > I have the following endpoint configuration:

>
> > > <endpoint
> > > address="https://localhost:8000/ws"
> > > binding="basicHttpBinding"
> > > bindingConfiguration="config1"
> > > contract="Messaging.IMessageProcessor" />

>
> > > <endpoint
> > > address="http://localhost:8001/ws"
> > > binding="basicHttpBinding"
> > > bindingConfiguration="config2"
> > > contract="Messaging.IMessageProcessor" />

>
> > > The difference being http and https in the address property. I get an
> > > exception:

>
> > > The provided URI scheme 'http' is invalid; expected 'https'.

>
> > > Does this mean WCF can not support http and https simultanously? If I make
> > > them both https ot http then no exception.

>
> > > Thanks

>
> > It can, you have to specify a secure transport binding configuration
> > to the endpoint that will support https. Just changing the address
> > doesn't really do much other than specifying the default URL to be
> > used. In your 'config1' configuration, you need something similar
> > to...

>
> > <binding name="config1" >
> > <security mode="Transport">
> > <transport clientCredentialType="Windows" />
> > </security>
> > </binding>

>
> > while your config2 may be similar to...

>
> > <binding name="config1" >
> > <security mode="TransportCredentialOnly">
> > <transport clientCredentialType="Windows" />
> > </security>
> > </binding>

>
> > This may differ depending upon your configuration (mine includes
> > windows authentication), but basically the binding configuration needs
> > to match the endpoint setting.

>
> > Ron


Well, I don't think it as simple as a "different" security mode, I
believe it has to be security modes that are different in that one has
transport and the other does not.

>From the error above, I thinking that you have not rebuilt your client

proxy or have it have the same web.config settings. They need to
match.

You may also see the following link...

http://msdn.microsoft.com/msdnmag/is...s/default.aspx

Other notes, you need to have HTTPS properly configured on your
server, and if the certificate is not a trusted one (e.g. Verisign),
then you have to explicitly enable the client to talk to this server.
See the link below regarding a helper PermissiveCertificatePolicy
class to be used to specify the certificate name on the server,
otherwise, you will get an error when trying to connect via the
client.

http://blogs.msdn.com/sajay/archive/...y-and-ssl.aspx

Ron

My System SpecsSystem Spec
Old 08-22-2007   #5 (permalink)
Craig
Guest


 

Re: WCF Endpoints



"ronscottlangham@yahoo.com" wrote:

> On Aug 22, 5:30 am, Craig <Cr...@discussions.microsoft.com> wrote:
> > Thanks for the reply.
> >
> > If I understand correctly, as long as the <security mode="?" .../> is
> > different for each bindind then it "should" work?
> >
> > Here is my config:
> >
> > <endpoint address="http://localhost:8001/ws"
> > binding="basicHttpBinding" bindingConfiguration="config1"
> > contract="Messaging.IMessageProcessor" />
> >
> > <endpoint address="https://localhost:8000/ws"
> > binding="basicHttpBinding" bindingConfiguration="config2"
> > contract="Messaging.IMessageProcessor" />
> >
> > <basicHttpBinding>
> > <binding name="config1">
> > <security mode="None"/>
> > </binding>
> >
> > <binding name="config2">
> > <security mode="TransportWithMessageCredential">
> > <transport clientCredentialType="None" />
> > <message clientCredentialType="UserName" />
> > </security>
> > </binding>
> > </basicHttpBinding>
> >
> > I end up with this exception:
> > a:ActionNotSupported</faultcode>
> > <faultstring xml:lang="en-AU">The message with Action '' cannot be
> > processed at the receiver, due to a ContractFilter mismatch at the
> > EndpointDispatcher. This may be because of either a contract mismatch
> > (mismatched Actions between sender and receiver) or a binding/security
> > mismatch between the sender and the receiver. Check that sender and receiver
> > have the same contract and the same binding (including security requirements,
> > e.g. Message, Transport, None)
> >
> > "ronscottlang...@yahoo.com" wrote:
> > > On Aug 20, 8:12 pm, Craig <Cr...@discussions.microsoft.com> wrote:
> > > > Hi

> >
> > > > I have the following endpoint configuration:

> >
> > > > <endpoint
> > > > address="https://localhost:8000/ws"
> > > > binding="basicHttpBinding"
> > > > bindingConfiguration="config1"
> > > > contract="Messaging.IMessageProcessor" />

> >
> > > > <endpoint
> > > > address="http://localhost:8001/ws"
> > > > binding="basicHttpBinding"
> > > > bindingConfiguration="config2"
> > > > contract="Messaging.IMessageProcessor" />

> >
> > > > The difference being http and https in the address property. I get an
> > > > exception:

> >
> > > > The provided URI scheme 'http' is invalid; expected 'https'.

> >
> > > > Does this mean WCF can not support http and https simultanously? If I make
> > > > them both https ot http then no exception.

> >
> > > > Thanks

> >
> > > It can, you have to specify a secure transport binding configuration
> > > to the endpoint that will support https. Just changing the address
> > > doesn't really do much other than specifying the default URL to be
> > > used. In your 'config1' configuration, you need something similar
> > > to...

> >
> > > <binding name="config1" >
> > > <security mode="Transport">
> > > <transport clientCredentialType="Windows" />
> > > </security>
> > > </binding>

> >
> > > while your config2 may be similar to...

> >
> > > <binding name="config1" >
> > > <security mode="TransportCredentialOnly">
> > > <transport clientCredentialType="Windows" />
> > > </security>
> > > </binding>

> >
> > > This may differ depending upon your configuration (mine includes
> > > windows authentication), but basically the binding configuration needs
> > > to match the endpoint setting.

> >
> > > Ron

>
> Well, I don't think it as simple as a "different" security mode, I
> believe it has to be security modes that are different in that one has
> transport and the other does not.
>
> >From the error above, I thinking that you have not rebuilt your client

> proxy or have it have the same web.config settings. They need to
> match.
>
> You may also see the following link...
>
> http://msdn.microsoft.com/msdnmag/is...s/default.aspx
>
> Other notes, you need to have HTTPS properly configured on your
> server, and if the certificate is not a trusted one (e.g. Verisign),
> then you have to explicitly enable the client to talk to this server.
> See the link below regarding a helper PermissiveCertificatePolicy
> class to be used to specify the certificate name on the server,
> otherwise, you will get an error when trying to connect via the
> client.
>
> http://blogs.msdn.com/sajay/archive/...y-and-ssl.aspx
>
> Ron
>
>


Hi Ron

Thanks for the reply.

I'm not why I'm getting the exeption. I thought having mulitple http and
http endpoints to the same cotnract would work. My https works fine, it's
when I browse the wsdl for the http url.

I reviewed my config in the service behaviour section and realized this is
where my error(s) are. I've removed the address attribute from the endpoint
element(s) moving the attribute value into the baseAddress in the <host>
section. Then make the http(s)GetUrl="" in the <serviceMetadata...> section.

Now I have https and http returning wsdl from the same contract binding.

My System SpecsSystem Spec
 

Thread Tools
Display Modes




Update your Vista Drivers Update Your Drivers Now!!

Vistax64.com is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media 2005-2008