Subscribe to Subscribers
Talk to Webmaster Tony John


Resources » .NET programming » WCF/Webservices

WCF Proxy Creation and Known Issues with Solution


Posted Date:     Category: WCF/Webservices    
Author: Member Level: Gold    Points: 25


When developing wcf service and creating proxy of that wcf service many users will may face some issues like Getting a common error while creating proxy or adding service reference, add service reference not working, user not able to create metadata (wsdl) so in this article we will discuss about how to create proxy and how to resolve known issues.



 


Create proxy by using svcutil




Go to Visual Studio Command Prompt and run as administrator if you are working on windows 7 machines and make sure you will have svcutil.exe in your .net framework.

Run your service or view your service in browser and Go to C:\\ prompt and type Svcutil.exe "URL of Your Wcf Service" e.g.


C:\svcutil.exe http://localhost:10650/Service1.svc?wsdl


Note : Make sure you should have sufficient rights to create file on the specified path because svcutil will create your proxy class on the given path.

Known Issue:

1 Not having svcutil.exe in your framework.
2 Access to path is denied.
3 Error: Cannot obtain Metadata from service has been exceeded quota.
4 SvcUtil having timeout limit of 5 minute to get the metadata.

Framework specific tool will work with their own classes' mean we cannot generate proxy from the SDK 3.5 using 4.0 SvcUtil tool and i.e. technically called multi targeting.

Solution to Known Issues:
1. Install Svcutil.exe from the msdn or Microsoft framework SDK
2 Give Admin or Read/Write Access to User from which you login.
3 Set readerQuotas maxDepth="2147483647" and other settings as well.


Note : For more known advance issues you can refer this link given below
http://msdn.microsoft.com/en-us/library/ee517280.aspx


Adding Service Reference / Update Service Reference



Run your service or view your service in browser go to client project where you want to add service reference then right click on project and click on Add Service Reference Menu Item popup will open then if the service is running within the same solution then discover it and click on ok button to add service reference.

While Adding Reference we can do following things:
1. We can generate asynchronous operation / methods.
2. We can generate message contract if required
3. We can set Data type we need it from service default is Array and Dictionary as Collection

Known Issue With Solution:
1. Abstract class referenced as known types or used as a data contract will not able to add service reference or can't create proxy for the same.
2. Partial class never to be derived from the FaultBase class.
3. Type sharing between XmlSerializer and DataContract will not work here we have to force to tool to skip that we can use svcutil Option : /serializer:DataContractSerializer.
4. Point to remember we have to specify endpoint configuration name properly.


Note: Most of the time seen the error in data type or contract only some time we forget to put some attributes over the methods or data member and some time we will have issue with fault contract. I will keep on adding the known issue with solution in this article.





Did you like this resource? Share it with your friends and show your love!


Responses to "WCF Proxy Creation and Known Issues with Solution"
Author: Siva Prasad    27 Jun 2012Member Level: Gold   Points : 0
Very informative, Thanks for info.


Feedbacks      

Post Comment:




  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name:   Sign In to fill automatically.
    Email: (Will not be published, but required to validate comment)



    Type the numbers and letters shown on the left.


    Next Resource: Handling Exceptions in WCF Applications
    Previous Resource: How to create web services in ASP.NET?
    Return to Resources
    Post New Resource
    Category: WCF/Webservices


    Post resources and earn money!
     
    More Resources
    Popular Tags   Tag posting guidelines   Search Tags  
    Add/Update Service Reference Errors  .  Known Issues  .  Proxy Generation Errors  .  Common Error while Creating Proxy of Wcf Service  .  



    Follow us on Twitter: https://twitter.com/dotnetspider

    Active Members
    TodayLast 7 Daysmore...

    Awards & Gifts
    Copyright © SpiderWorks Technologies Pvt Ltd., Kochi, India
    2005 - 2012 All Rights Reserved.
    .NET and other trademarks mentioned in this site belong to Microsoft and other respective trademark owners.
    Articles, tutorials and all other content offered here is for educational purpose only.
    We are not associated with Microsoft or its partners.