![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
|
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.
br> br> |
| |||||||
| | Thread Tools | Display Modes |
| | #1 (permalink) |
| 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 Specs![]() |
| | #2 (permalink) |
| 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 Specs![]() |
| | #3 (permalink) |
| 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 Specs![]() |
| | #4 (permalink) |
| 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 Specs![]() |
| | #5 (permalink) |
| 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 Specs![]() |
| Thread Tools | |
| Display Modes | |
| |