Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsForumForumHow to consume WCF service in DNN module?How to consume WCF service in DNN module?
Previous
 
Next
New Post
12/2/2014 6:39 PM
 

I have a WCF service that I want to consume from a DNN module. I have consumed asmx web services before from a DNN module without issues. All it required was adding a web reference to the module.

With my WCF service, I have added a service reference to the project. But in addition to that, endpoint definitions are required in the web.config file. I can add them manually for now, but how do I ensure these settings will be added to web.config of any DNN installation that this module is installed on?

Is there a different approach required for consuming WCF services from a DNN module?

All of my searches lead me to articles for creating WCF services inside DNN - could not find anything for calling WCF service from DNN module.

Thanks.

 
New Post
12/2/2014 8:34 PM
 
I never had any problems adding WCF services to DNN - they could be consumed by any app/mobile or portal?

Can you browse to your .SVC file? If not, what is the error?

Any reason why you are not using WebAPI?

Entrepreneur

PokerDIY Tournament Manager - PokerDIY Tournament Manager<
PokerDIY Game Finder - Mobile Apps powered by DNN
PokerDIY - Connecting Poker Players

 
New Post
12/3/2014 6:40 PM
 
Thanks for the reply.
Adding WCF service to my dev was not that problematic. After adding the service reference, I also had to add some config to the web.config file. I was wondering how I can ensure this on a client system. The solution I found was that I can include config in the manifest file of a module, so that it gets copied to the client system at time of installation.
I have not implemented and tested it yet, but that seems to be the answer to my question.
 
New Post
12/7/2014 4:32 PM
 
Hmm - I consumed them in a Mobile App (PhoneGap) so I was not using .NET for the client (Javascript/HTML) - hence I could not use a Service Reference - I just hit the service with js code.

Entrepreneur

PokerDIY Tournament Manager - PokerDIY Tournament Manager<
PokerDIY Game Finder - Mobile Apps powered by DNN
PokerDIY - Connecting Poker Players

 
New Post
12/8/2014 2:01 PM
 

You can add the necessary configuration to the .dnn file: 

1) Be carefull that you do not step on another service though!

2) There can be only one System.ServiceModel section:

3) My example WILL step on other services (so this needs to be modified to not do so.

       

 

 

        <component type="Config">

          <config>

            <configFile>web.config</configFile>

            <install>

              <configuration>

                <nodes>

                  <node path="/configuration" action="update" key="name" collision="overwrite">

                    <system.serviceModel>

                      <bindings>

                        <basicHttpBinding>

                          <binding name="BasicHttpBinding_IUser" closeTimeout="00:01:00"

                            openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"

                            allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"

                            maxBufferPoolSize="100000000" maxBufferSize="100000000" maxReceivedMessageSize="100000000"

                            textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="true"

                            messageEncoding="Text">

                            <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"

                              maxBytesPerRead="4096" maxNameTableCharCount="16384" />

                            <security mode="None">

                              <transport clientCredentialType="None" proxyCredentialType="None"

                                realm="" />

                              <message clientCredentialType="UserName" algorithmSuite="Default" />

                            </security>

                          </binding>

                        </basicHttpBinding>

                      </bindings>

                      <behaviors>

                        <endpointBehaviors>

                          <behavior name="endpointBehavior">

                            <dataContractSerializer maxItemsInObjectGraph="2147483647"/>

                          </behavior>

                        </endpointBehaviors>

                      </behaviors>

                      <client>

                        <endpoint address="your endpointaddress"

                            binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IUser"

                            contract="WWWUser.IUser" name="BasicHttpBinding_IUser" behaviorConfiguration="endpointBehavior" />

                      </client>

                    </system.serviceModel>

                  </node>

                 

                </nodes>

              </configuration>

            </install>

            <uninstall>

              <configuration>

                <nodes>

                  <node path="/configuration" action="remove" />

                  <system.serviceModel>

                    <bindings>

                      <basicHttpBinding>

                        <binding name="BasicHttpBinding_IUser" closeTimeout="00:01:00"

                          openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"

                          allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"

                          maxBufferPoolSize="100000000" maxBufferSize="100000000" maxReceivedMessageSize="100000000"

                          textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="true"

                          messageEncoding="Text">

                          <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"

                            maxBytesPerRead="4096" maxNameTableCharCount="16384" />

                          <security mode="None">

                            <transport clientCredentialType="None" proxyCredentialType="None"

                              realm="" />

                            <message clientCredentialType="UserName" algorithmSuite="Default" />

                          </security>

                        </binding>

                      </basicHttpBinding>

                    </bindings>

                    <behaviors>

                      <endpointBehaviors>

                        <behavior name="endpointBehavior">

                          <dataContractSerializer maxItemsInObjectGraph="2147483647"/>

                        </behavior>

                      </endpointBehaviors>

                    </behaviors>

                    <client>

                      <endpoint address="your endpointaddress"

                          binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IUser"

                          contract="WWWUser.IUser" name="BasicHttpBinding_IUser" behaviorConfiguration="endpointBehavior" />

                    </client>

                  </system.serviceModel>

                </nodes>

              </configuration>

            </uninstall>

          </config>

        </component>

    

     

 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsForumForumHow to consume WCF service in DNN module?How to consume WCF service in DNN module?


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out