Accessing WCF-Webservice from Outlook-Plugin

Add-in Express™ Support Service
That's what is more important than anything else

Accessing WCF-Webservice from Outlook-Plugin
 
Ruthardt Frank




Posts: 3
Joined: 2009-08-07
We're trying to access a webservice implemented with WCF and wsHttpBinding from an Add-In-Express-Outlook-Plugin. The Webservice requires Session-Mode.

The first try was to add a service reference in the project.
First problem was, that the app.config was not configured to be copied to the output folder. After that it seemed that the webservice is requested.

There are always errors like problems with channel or similar.
The webservice seems not to be connected because the errors are the same when the service goes offline.

Is there a simple tutorial to access webservices? Is this a security-problem and the runtime security doesnt allow that?

I would be glad to get further information.

Frank
Posted 09 Feb, 2011 15:16:35 Top
Eugene Astafiev


Add-in Express team


Posts: 8540
Joined: 2007-07-25
Hi Ruthardt,

You can read more about web services in MSDN. Anyway, I have prepared a sample add-in project for you. You can download it from our web site. Does it work for you?

FYI I didn't notice any security problem on my way.
.NET, Extended MAPI, Windows Phone & RT
Posted 10 Feb, 2011 07:54:16 Top
Ruthardt Frank




Posts: 3
Joined: 2009-08-07
Hi Eugene,

Thank you for your answer. The problem seems to be the wsHttpBinding. But I need that binding because of the use of the sessions.

The good news is that I think its no problem with addin-express. Bad news is that the problem is still there ;-)

The exact exception is:
An exception of type 'System.ServiceModel.Security.SecurityNegotiationException' occurred in mscorlib.dll but was not handled in user code

The app.config from the addin is:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.serviceModel>
<bindings>
<wsHttpBinding>
<binding name="WSHttpBinding_ICrmService" closeTimeout="00:01:00"
openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"
maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true"
allowCookies="false">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<reliableSession ordered="true" inactivityTimeout="00:10:00"
enabled="false" />
<security mode="Message">
<transport clientCredentialType="Windows" proxyCredentialType="None"
realm="" />
<message clientCredentialType="Windows" negotiateServiceCredential="true"
algorithmSuite="Default" />
</security>
</binding>
</wsHttpBinding>
</bindings>
<client>
<endpoint address="http://www.xxxx.ch:81/CrmService/" binding="wsHttpBinding"
bindingConfiguration="WSHttpBinding_ICrmService" contract="ServiceReference1.ICrmService"
name="WSHttpBinding_ICrmService">
<identity>
<dns value="www.xxx.ch" />
</identity>
</endpoint>
</client>
</system.serviceModel>
</configuration>

If you want to debugg with the real service, please contact me directly.

Frank
Posted 10 Feb, 2011 16:39:36 Top
Eugene Astafiev


Add-in Express team


Posts: 8540
Joined: 2007-07-25
Hi Ruthardt,

Are you able to reproduce the issue with a regular windows forms application?
.NET, Extended MAPI, Windows Phone & RT
Posted 11 Feb, 2011 04:23:43 Top