Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > Indigo

Vista - WCF Endpoints

 
 
Old 08-20-2007   #1 (permalink)
Craig


 
 

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


 
 

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


 
 

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


 
 

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


 
 

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



Vista Forums 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 Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46