crichman

consume WCF Soap servce in an add-in extension?

Discussion created by crichman on Feb 6, 2012
Latest reply on Feb 18, 2015 by ebrimhall
Our test WCF service works just fine from a VS 2010 stand-alone Windows Form app but generates a run-time error whenever we try to instantiate an object via the generated proxy classes in a VS 2010 ArcGIS add-in project extension. 

In each case I added the WCF service as a new service reference.  The projects compile, and the Windows Forms app runs without error.  When I try to initialize an object to a new OPTrackingClient() in my add-in extension I get "Could not find default endpoint element that references contract OPTS.IOPTracking" in the ServiceModel client configuration section.  This might be because no configuration file was found for your application, or because no endpoint element matching this contract could be found in the client element."  I checked the relevant bits of the two app.config files and they appear to match: 

            <wsHttpBinding>
                <binding name="WSHttpBinding_IOPTracking" 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://opnas01.op.dcgov.priv/optoolsservices/OPTracking.svc"
                binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IOPTracking"
                contract="OPTS.IOPTracking" name="WSHttpBinding_IOPTracking">
                <identity>
                    <servicePrincipalName value="host/opnas01.op.dcgov.priv" />
                </identity>
            </endpoint>
        </client>

Is there some other bit of configuration I need to do to allow ArcMap (and my extension) to tap this WCF service successfully?  Can ArcMap make use of this config info effectively, or do I need a different approach?

Charlie Richman
District of Columbia Office of Planning

Attachments

Outcomes