Connect Infopath 2007 and WCF

I'm having trouble connecting the Infopath 2007 form to the WCF web service. I see that Infopath only wants to communicate via SOAP 1.0 message. To get around the problem at the moment, I created the .asmx web service. Should I consider continuing this workaround or figure out a way to get WCF to distribute SOAP 1.0 1.1 messages?

+4
source share
3 answers

You get WCF to work with InfoPath using basicHttpBinding instead of wsHttpBinding in webconfig.

+4
source

Just to help with the answer on xanax, this is what I did in the web.config file. this is part of the default configuration that is generated when a new WCF service is created. I commented on one endpoint and added a new one whose only change is the binding from wsHttpBinding to basicHttpBinding, and it worked.

<system.serviceModel> <services> <service name="Service" behaviorConfiguration="ServiceBehavior"> <!-- Service Endpoints --> <!--<endpoint address="" binding="wsHttpBinding" contract="IService">--> <endpoint address="" binding="basicHttpBinding" contract="IService"> <identity> <dns value="localhost"/> </identity> </endpoint> <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/> </service> </services> ...Other Config Here.... <system.serviceModel> 
+1
source

InfoPath only works with basicHttpBinding by default. When using webservice with InfoPath, the webservice URL is usually placed in the UDX file. There is no way in this file to specify a binding for the target service. Usually you do not create a proxy server for your service, InfoPath does this behind the scenes, and the proxy server uses only basicHttpBinding.

If you want your InfoPath forms to work with a WCF service that does not use basicHttpBinding, you can do this by creating a proxy server yourself programmatically in the form of an InfoPath form . When you create a proxy programmatically, you can specify the target binding of the WCF service in the proxy constructor. There are no restrictions when using a programmatically created proxy server. Of course, .NET 3.5 should already have been installed so that WCF libraries are available to your code to create these proxies with the correct bindings. When you install InfoPath, only .NET 2 is available.

I tried this with wsHttpBinding and it worked without problems. Of the many articles and posts, many people believe that InfoPath can only work with basicHttpBinding. This is only partially true, because it applies only when you yourself do not create your proxies.

+1
source

All Articles