I have a wcf service (not self hosted).
When I deleted the section from web.config
<services>
<service name="Namespace.A">
<endpoint address="" binding="basicHttpBinding" name="A_EndpointBinding" contract="A" />
</service>
</services>
it works.
How could that be possible ? Does it occur any problem without that ?
If you can successfully connect and use the service (Namespace.A) using HTTP, then you should have nothing to worry about!
What's happening is either the above is misconfigured or its interfering with other settings and/or hard-coded functionality.
Related
Trying to set up second web site in IIS 7, most/all of the mirrored services function except ones configured for net.tcp. Trying to access the .svc url, I receive the following error:
Could not find a base address that matches scheme net.tcp for the endpoint with binding NetTcpBinding. Registered base address schemes are [http].
IIS binding configuration:
Advanced Settings:
Trying to follow answers found on Stack Overflow, none seem to work.
Content of the service's web.config:
<system.serviceModel>
<services>
<service name="ServiceName">
<endpoint address="basic" binding="basicHttpBinding" bindingConfiguration=""
name="basic" contract="ServiceName.IService" />
<endpoint address="nettcp" binding="netTcpBinding" bindingConfiguration=""
name="netTCP" contract="ServiceName.IService" />
<host>
<baseAddresses>
<add baseAddress="http://staging.localhost/ServiceName" />
<add baseAddress="net.tcp://localhost:8033/ServiceName" />
</baseAddresses>
</host>
</service>
</services>
Is there a trick to the net.tcp bindings? What is correct configuration needed in the web.config?
Thanks!
A screenshot is worth a 1,000 words sometimes. In IIS manager, right-click on the application "ServiceName" and select Manage Application->Advanced Settings. In the advanced settings dialog box, check to see if you've added net.tcp to the Enabled Protocols:
I have following settings
<services>
<service name="HelloWCFServiceClass.clsHelloWCFServiceClass" >
<host>
<baseAddresses>
<add baseAddress="http://localhost:6789/IISHosting/HelloWorldISSHostedService.svc"/>
</baseAddresses>
</host>
<endpoint address="" binding="wsHttpBinding" contract="HelloWCFServiceContract.IHelloWCFServiceContract" />
<endpoint address="/test" binding="basicHttpBinding"
contract="HelloWCFServiceContract.IHelloWCFServiceContract"/>
</service>
</services>
I can open
http://{ServerName}:6789/HelloWorldISSHostedService.svc
But I'm getting an error
The webpage cannot be found
while trying to access through end point like this
http://{ServerName}:6789/HelloWorldISSHostedService.svc/test
You're using BasicHttpBinding - that's a SOAP binding, you cannot just use your browser to browse to that endpoint.
You'll need to use something like SoapUI to test your SOAP services.
If you want a service that's testable in your browser (by just navigating to an URL), you need to use the webHttpBinding instead (REST service)
If your service is part of an MVC project, you need to configure your routing table
http://www.asp.net/mvc/tutorials/older-versions/controllers-and-routing/asp-net-mvc-routing-overview-cs
I'm somewhat new to web development, so I'm unsure of the terminology to use here. I have a wcf web service that I've build for windows azure. I would like to have multiple endpoints that resolve to the same service, however I'm not entirely sure how to configure this.
This may help explain what I'm wanting a little better:
Currently, I have a service at https://myapp.cloudapp.net/service.svc
I would like to have the following url point to the same service in the application:
https://myapp.cloudapp.net/myapp/service.svc
I'm sure this is something easy to do, I just haven't been able to find a solution yet.
Edit:
I found this documentation on MSDN:
http://msdn.microsoft.com/en-us/library/ms734786.aspx
However, I can't seem to get it to work.
Here is is how my endpoint is defined in my web.config:
<services>
<service behaviorConfiguration="MetadataEnabled" name="myProject.myApp.myService">
<host>
<baseAddresses>
<add baseAddress="https://localhost/myService/" />
</baseAddresses>
</host>
<endpoint address="" binding="wsHttpBinding" bindingConfiguration="wsBinding" name="wsBase" contract="myProj.myApp.IServ" />
<endpoint address="mex" binding="mexHttpsBinding" bindingConfiguration="mexBinding" name="HttpMetadata" contract="IMetadataExchange" />
<endpoint address="myApp/" binding="wsHttpBinding" bindingConfiguration="wsBinding" name="WsPlain" contract="myProj.myApp.IServ" />
</service>
</services>
It's still not working, but hopefully it's getting close. Would love any suggestions!
I just found out the answer. I just needed to create a folder in the project "myApp", and make copy the .svc file (not the .svc.cs file) to that folder. This allowed the following to work:
myapp.cloudapp.net/service.svc
myapp.cloudapp.net/myapp/service.svc
This is trivial and probably you already do, but are you defining InputEndpoints in ServiceDefinition.csdef?
There's a WCF Routing Service that might be of use (or might be overkill).
See also Supporting Multiple IIS Site Bindings and Endpoint Addresses.
I am using CSLA.NET. It works realy nice with the wsHttpBinding. Now, I have my own Windows-Service and search the solution, that I can use this Windows-Service as the CSLA-Server and using nettcpbinding. Can someone give me a tip how to going on? Perhaps someone has a sample how I can do that.
Thank you!
Best Regards, Thomas
Basically, you need to do two things:
change your server-side configuration to include an endpoint with the netTcpBinding (this can be in addition to the existing wsHttpBinding endpoint - no problem)
add the netTcpBinding to your client's config file as well and selecting that endpoint when you connect
You should have something like this in your server side config:
<services>
<service name="YourService">
<endpoint name="something"
address=""
binding="wsHttpBinding"
contract="IYourService" />
</service>
</services>
Just add an endpoint for the netTcpBinding:
<services>
<service name="YourService">
<endpoint name="something"
address=""
binding="wsHttpBinding"
contract="IYourService" />
<endpoint name="something"
address="net.tcp://YourServer:7171/YourService"
binding="netTcpBinding"
contract="IYourService" />
</service>
</services>
Now if you're hosting in IIS, you might run into some problems - you need to configure IIS7 (Win2008 or Win2008R2 server), and in IIS6, you won't be able to host your netTcp service in IIS6 :-(
Same thing on the client side - add a second endpoint for netTcp:
<client>
<endpoint name="something"
address="http://YourServer/SomeVirtDir/YourServiceFile.svc"
binding="wsHttpBinding"
contract="IYourService" />
<endpoint name="netTcpEndpoint"
address="net.tcp://YourServer:7171/YourService"
binding="netTcpBinding"
contract="IYourService" />
</client>
and now when you create your endpoint in code, use the named endpoint:
YourServiceClient client = new YourServiceClient("netTcpEndpoint");
That should be all, really (unless CSLA requires something extra which I wouldn't know about.... I know "plain-vanilla" WCF)
I have been told that wsHttpBinding does not support older clients that still need to use older version of SOAP. I want to add a BasicHttpBinding endpoint in the same WCF Service Application so that clients can use either endpoint depending on their technology they are running. I am confused as to what the address to use for each of them. The default wsHttpBinding has no address set. What should the address be for BasicHttpBinding endpoint? Shouldn't the address for the wsHttpBinding be (for my example) http://localhost/WcfService1/Service1.svc ?
There's two things you need to consider here:
if your hosting in IIS (or WAS as part of IIS7), you cannot set a base address - the base address for your service will be the virtual directory where the MyService.svc file lives. You can still set relative addresses, though
if you self-host, you typically will add base addresses in your config, so you can spare yourself having to spell out the entire address all the time (but you can - if you wish to do so).
So if you have your MyService.svc inside a virtual directory called MyApp on your localhost machine, and then use this config:
<service name="MyService" behaviorConfiguration="Default">
<endpoint
address="wsHttp"
binding="wsHttpBinding"
contract="IMyService" />
<endpoint
address="basic"
binding="basicHttpBinding"
contract="IMyService" />
</service>
then your "old-style" basicHttp service will be reachable at:
http://localhost/MyApp/MyService.svc/basic
and your new wsHttp driven service will be reachable at:
http://localhost/MyApp/MyService.svc/wsHttp
You can name those relative addresses (anything after .../MyApp/MyService.svc) anything you like - just make sure they're different from one another.
Hosting in IIS --> location (virtual directory) of your *.svc file becomes your base address.
If you self-host your service inside a console app or a Windows NT Service, you get to set your base addresses yourself:
<services>
<service name="MyService" behaviorConfiguration="Default">
<host>
<baseAddresses>
<add baseAddress="http://localhost:8185/Services/" />
</baseAddresses>
</host>
</service>
</services>
Now in this case, your "old-style" basicHttp service will be reachable at:
http://localhost:8185/Services/basic
and your new wsHttp driven service will be reachable at:
http://localhost:8185/Services/wsHttp
You can define a base address for each of the transports, e.g. one for http://, one for net.tcp:// and so on.
And of course, if you really must, you can also define your complete addresses inside your <endpoint> element for each of the service endpoints - this gives you total flexibility (but only works in self-hosting scenarios).
Marc
In WCF you have a base address and an enpoint address, in your case you can do something like this:
<service name="WcfEndpoints.Service1" behaviorConfiguration="WcfEndpoints.Service1Behavior">
<!-- Service Endpoints -->
<endpoint address="new" binding="wsHttpBinding" contract="WcfEndpoints.IService1" />
<endpoint address="old" binding="basicHttpBinding" contract="WcfEndpoints.IService1" />
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
</service>
Note you will need additional work for the basicHttpBinding endpoint to work with older (asmx) clients
http://msdn.microsoft.com/en-us/library/ms751433.aspx