autofac wcf integration have /basic at the end of the soap address - wcf

We had an old wcf service not using Autofac. The wsdl generated from it looks like this
<wsdl:service name="WebSite.Service.WebSiteService">
<wsdl:port name="BasicHttpBinding_IWebSiteService" binding="tns:BasicHttpBinding_IWebSiteService">
<soap:address location="http://localhost/WebSiteService.svc/basic"/>
</wsdl:port>
</wsdl:service>
However the new webservice I created with autofac wcf integration(did it following the example from autofac wcf webpage) doesn't have the word basic at the end of the soap address url (as in ...localhost/WebSiteService.svc/basic). It is causing some old mobile application and websites failing... I was just wondering if anyone know how I can get the word basic appearing in the soap address section?
Thanks

Related

Microsoft WCF - SOAP messaging protocol

is that correct that the default Web Service created using WCF will have WSDL but the message transmission required should not have SOAP tags like
<soap:envelope>, <soap:header>, <soap:body> ?
Are they still using SOAP 1.1 in this case then?
And then, how can I create another web service using JAX-WS that is following this standard?
Thanks a bunch,
Robert
It's not clear to me what you're asking but if you're trying to invoke java based services (Apache, Metro, etc...) with a WCF client, take a look at the WCF Express Interop bindings.

WCF services by default are restful or soap based?

I am new to WCF and just have made a sample service. Please guide me by default WCF services are soap or restful if we not specify anywhere ? I tried to run URL of my services and got this page. I am feeling it is SOAP based. Kindly guide.
Thanks
WCF services by default are SOAP - unless you use the webHttpBinding which is REST (and this for now is the only RESTful binding). To test your SOAP based services, you cannot just navigate to an URL in your browser - you need to use a SOAP test app, like SoapUI or the WCF Test Client.
WCF Data Services and WCF RIA Services are based on webHttpBinding and thus are REST-based. REST services can be tested by just browsing to the URL - you'll get back XML that can be shown in your browser (or JSON which you can store to a file and look at)
By default, WCF services are soap based if you use the project item "WCF Service" in visual studio.

Problems connecting to an authenticated downstream netTcp endpoint

In a related post, I am having trouble connecting to a basicHttp endpoint and it seems that it is due to WCF impersonation issues when connecting to a downstream service. The funny thing is that it works fine when I replace the basicHttp WCF service with an ASMX web service. Both services use <identity impersonate="true" userName=".." password=".." /> from ASP.NET web.config file, but the ASMX service works while the basicHttp WCF service doesn't.
Does this seem likely to be some sort if Kerberos delegation issue between ASP.NET and WCF?
Or is there something that I can add to my WCF configuration to pass this impersonated user (note I am using framework 4, so I currently have almost no configurtation)?
Finally worked out that I needed to add <serviceHostingEnvironment aspNetCompatibilityEnabled="true"/> to the WCF part of the web.config file, and an AspNetCompatibilityRequirementsMode attribute to the implementation of the basicHttp endpoint. This will then call the downstream netTcp endpoint using the credentials defined in <identity impersonate="true" userName=".." password=".." />.

WCF (svc) Service but client wants to connect as if it was ".asmx"

I have this scenario. Client requested us to have a WebService. I created a WCF Service. After we sent them our url to the web service description, client says
As it is we cannot consume a WCF
service, can you publish it a web
service?
Now i am wondering, they are asking me for a asmx... right?
Is there any way that i can "offer" my WCF service as an asmx service so i don't have to rewrite the whole thing?
my first "solution" is to have an .asmx file calling my .svc files directly... i don't know. I havent tried but i am heading on that direction.
Any ideas would be highly appreciated.
Tony
It is completely do-able. Just use an endpoint that exposes the service using basicHttpBinding or wsHttpBinding. The "file extension" of the URL doesn't make any difference to the client, only the content of the rerquest/response.
Here's a reference to another SO question:
REST / SOAP endpoints for a WCF service
It's very much possible.Follow the steps mentioned below and you'll be able to expose WCF service as ASMX endpoint.
Add new web service file (.asmx)
Now open the node of web .asmx file and delete .asmx.cs file
Once .cs file is deleted. You will find wcfasasmx.asmx file.
I have WCF class name as Service1(from the basic WCF service) and this class is present in current NameSpace. So I changed class name as mynamespace.Service1
Some changes is code as shown below-
In web.config in Tag add following code
<system.web>
<webServices>
<conformanceWarnings>
<remove name='BasicProfile1_1'/>
</conformanceWarnings>
</webServices>
</system.web>
Add following 2 attribute on interface(on servicecontract of WCF)
[WebService(Name = "Service1")]
[WebServiceBinding(Name = "Service1", ConformsTo = WsiProfiles.BasicProfile1_1, EmitConformanceClaims = true)]
Add [WebMethod] attribute on each operation contract.
[OperationContract]
[WebMethod]
string GetData(int value);
your service can now be consumed by asmx client too.

WCF and HTTP GET

My WCF service exposes this function
public SerialNumberInfo GetSerialNumberInfo(string serialNumber) { }
Is there a way to enable HTTP GET on my WCF service? Example:
http://localhost:8004/MyService/GetSerialNumberInfo?serialNumber=4
yes, you need to use the webHttpBinding on your WCF service.
See the WCF REST Starter Kit for more information on REST Support in WCF.
REST in WCF
Overview of REST in WCF
Series of screencasts on how to use REST in WCF
If you're hosting your service in IIS, you need to create a separate *.svc file for the REST service (let's call it RESTService.svc), which contains:
<%# ServiceHost Service="YourServiceName" Language="C#" debug="False"
Factory="System.ServiceModel.Activation.WebServiceHostFactory" %>
Now you should be able to connect to the URL
http://localhost:8004/MyService/RESTService.svc
and get your data RESTfully.
Marc
What you want to do sounds like building a RESTful service with WCF. Check out the following article on MSDN, it has all the details:
A Guide to Designing and Building RESTful Web Services with WCF 3.5