.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Generation of proxy class using svcutil

Posted By:      Posted Date: October 28, 2010    Points: 0   Category :WCF

Hello All,

I created a simple host application for hosting a class of mine. I have created endpoint, address binding and contract.

I am able to use svcutil to generate a proxy class. I am able to connect to the host application from my client, when both are put up onthe same machine. But when I try to host the application on my PC and try to obtain proxy class by running svcutil on someo ther machine, I am not able to generate the .cs and .config file.

Can u pls help.. as to what setting i have to change in order to generate the config file on the other machine.



Error Message - The document at the url ________ (request URL) was not recognized as a known document type.

-Report from the url __________ is ' The document format is not recognised ( the content type is text/htmll charset  = utf-8)

- Report from Disco Document = there was an error downloading ____ url ? disco

View Complete Post

More Related Resource Links

How do I generate proxy class for webservice with no WSDL published?

 Hello, I need to utilize following web service: https://www.icds.att.com/xmlrequest Service publishes 2 XML files (one for Request and another for Response) https://www.icds.att.com/schemas/XMLRequest.xsd and https://www.icds.att.com/schemas/XMLResponse.xsd. I generated classes for those manually, but my question is how do I actually utilize web service (generate proxy file) in this case. Do I have to code everything manually?

Deserializing Problem when build proxy by svcutil from WSDL

Hi, I got a WSDL from a third-party company and have to build a proxy to fetch data. I used svcutil *.wsdl to generate code and config file. Using the proxy I wondered why I got unexpected results: The return value is alway 0 and the string field CTWS_ReturnMsg always empty even if the server sent values. Could anybody help me? Here the WSDL and afterwards the http-traffic (from Wireshark): <?xml version="1.0" encoding="utf-8"?> <wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="http://CEITONWebService.org/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://CEITONWebService.org/">     <wsdl:types>         <xs:schema xmlns="http://CEITONWebService.org/" xmlns:mstns="http://CEITONWebService.org/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://CEITONWebService.org" targetNamespace=&q

WCF proxy generation encapsulates original method using MessageContracts

I am having an issue generating the client proxy for a set of WCF services. I am sending a MessageContract as a parameter to the service and returning a MessageContract. The generated proxy has the resulting method as private and generates another public method that accepts all the properties of the message as individual parameters, then assembles the MessageContract, and calls the private method. I can’t seem to figure out how to get it to generate a proxy with original signature for the method.   My message contracts are thus:      [MessageContract(IsWrapped=false)]    public class FlashFileMessage    {       [MessageHeader]       public string Filename { get; set; }         [MessageHeader]       public long FileSize { get; set; }         [MessageBodyMember]       public Stream Data { get; set; }    }      [MessageContract(IsWrapped=false)]    public class TransferFileToInstrumentResponse    {       [MessageHeader]       public bool Success { get; set; }         [MessageBodyMember]       public string Message { get; set; } &n

Unable to create instance of proxy class in WCF

Hello, I created proxy class using svcutil.exe and added it in App_Webreference folder. I want to access objects and methods from this proxy. But I am unable to create instance of this proxy class. In inellisence, it is not showing this proxy class. What could be the problem ? I am using VS 2008 and Visual Basic.   Thanks in advance.  Amit Lohakare

Proxy Authentication in svcutil

Hi, i want to use svcutil (or VS2008 Add Service Reference) to generate a proxy client class for a internet public wcf service, the thing is im behind a proxy, and svcutil fails:    Error de la solicitud con el código de estado HTTP 407: Proxy Authentication Required ( The ISA Server requires authorization to fulfill the request. Access to the Web Proxy filter is denied.  ).And VS2008 also fails:The remote server returned an unexpected response: (407) Proxy Authentication Required ( The ISA Server requires authorization to fulfill the request. Access to the Web Proxy filter is denied.  ).Error en el servidor remoto: (407) Se requiere autorización del proxy.How can i add a service reference or create a proxy class thru the proxy server ?Thanks!!

Serializing / Storing VS2010 generated WCF Proxy Class reference in SQL SessionState



I have a WCF 4 service being consumed by an ASP.NET 3.5 (SharePoint 2010 actually) application.

Because we have implemented session support in the WCF service (ws2007HttpBinding) to maintain some objects that are very expensive to intialize, I'm also trying to keep my service client reference persisted on the ASP.NET consumer-side. However in order to persist it across post-backs, I need to add it to the session (using SharePoint's SQL SessionState provider), and this causes serialization (binary serialization) of the WCF service referece.

The ASP.NET application is throwing an error, because it cannot serialize the WCF service reference.

Any thoughts?

Looking for third party class libs for FTP, FTP proxy, and FTPS

I'm looking for thrid party class lib(s) to do FTP, FTP proxy, and FTPS with .NET.

We have been using the classes that come with .NET but have been running into intermittant problems where it looks like connections are not been closed when they should be.  We want to look into some of the other FTP class libs that are out there to see what options we have.

Does anyone have any suggestions, noteworthly experiences, etc... with any FTP products (other than the .NET classes)?

thank you,
Julia Filho

SSIS calling proxy class but need to add soap header (?)

Hi guys I am a bit of newbie to both web services and SSIS.....
I have a SSIS 2005 (not 2008!) package that consumes a WCF Web service which was written by another company.  This company generated a proxy class in VB for me and I copied and pasted the code into my SSIS VB script task.
Here is the beginning of the proxy class:
Namespace abc.xxx.xxxxxxx.Client.xxxxx
    <System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038"), _
     System.Diagnostics.DebuggerStepThroughAttribute(), _
     System.ComponentModel.DesignerCategoryAttribute("code"), _
     System.Web.Services.WebServiceBindingAttribute(Name:="BasicHttpBinding_Idkdkdkdkdkdk", [Namespace]:="http://blah/"), _
     System.Xml.Serialization.XmlIncludeAttribute(GetType(dddddddddd))> _
    Partial Public Class class1
It appears to be fine but when I tried to call any web service method, it returns a soap error "username is not in HTTP header".  I asked the company that wrote the Web service and

proxy generation from nettcpbinding



How can i generate proxy for a servie with nettcpbiding.

when i try to add service referene to my service which only have nettcpbinding, it fails with message "metadata contains a reference that can't be resolved. There was no endpoint listening at that could accept the message".

My service config has

<endpoint address="mex" binding="netTcpBinding" contract="IMetadataExchange" bindingConfiguration="mexTcp" />

Add Service Reference changing list to arrays in proxy class


I'm trying to consume an asmx service in a console app. When I add the service reference to my project i'm noticing that in the proxy class the lists are replaced with arrays. Also, the default constructors are missing. This is causing problems when i'm attempting to build the request object using the proxy classes. I've generated some classes using xsdobjectgen which i'm using as parameters to my web method. I've tried changing the Collection type in the settings but its still not working. Any ideas on whats going wrong?


Add Service Reference changing list to arrays in proxy class


I'm trying to consume an asmx service in a console app. When I add the service reference to my project i'm noticing that in the proxy class the lists are replaced with arrays. Also, the default constructors are missing. This is causing problems when i'm attempting to build the request object using the proxy classes. I've generated some classes using xsdobjectgen which i'm using as parameters to my web method. I've tried changing the Collection type in the settings but its still not working. Any ideas on whats going wrong?


xsd to class generation when there are refererence xsds



I have question regarding that short post http://bembengarifin.wordpress.com/2009/07/14/generate-net-class-from-xsd-with-references-to-other-xsd-using-xsd-exe/

I wrote my question also there but I would like to share with you too, here is my question.

there is a small problem when you run that you get 1 class instead of 2 classes. Ok you may say what is the matter with that? I give you a scenario below.
there are 2 root xsd and 3 reference xsds
root: xsd 1 xsd 2 references: xsd A xsd B xsd C
1 has reference A,B,C
2 has reference A,B,C

when you create classes using the way you illustrated you end up with 2 class both having same properties (property definitions of A,B and C). then if you try to create a WSDL using these 2 classes, Visual Studio will warn you by saying multiple property declarations. Therefore you need to separate them in a common/shared classes again. thats a tired way of doing if you have too many xsds with same references combined.
ok, now the question is "is there anyway I can accoplish 2+3 classes generated rather than 2 classes for the scenario above?" I know some 3rd party programs doing that but they do sometimes wrong classes. good program suggestion will be appreciated too.


XMLSerializer: Losing data from a generated web service proxy using svcutil


I generated a proxy using svcutil with the option ser:XmlSerializer.  When trying to serialize the object I am losing data.  The wsdl came from a .asmx web service.

create proxy client with SvcUtil from service using https+cert authentication


Hi all,

I have build two web services one is wcf hosted in iis and the other one is java web service (jax-ws ri) hsted on tomcat. Both of the services uses https and certificate authentication.The certificates are valid and when I check the wsdl's from the browser I can see them without any warning.

So I want to create a wcf client for the services with svcutil. I have created the necessary config file for svcutil (svcutil.exe.config).

When I try to create the proxy files for the java service (svcutil http://JavaServiceIpAddress/service?wsdl) I receive

"metadata contains a reference that cannot be resolved .

<Fault xmlns="http://schemas.xmlsoap.org/soap/envelope/" >
   <faultcode xmlns:a="http://www.w3.org/2003/05/soap-envelope" xmlns="">a:Client</faultcode>
   <faultstring xmlns="">Cannot find dispatch method for {}</faultstring>

the request was aborted: Could not create ssl/tls secure channel"


When I execute svcutil http://WcfServiceIpAddress/service.svc the proxy and configs file are created smoothly. When I try svcutil http://WcfServiceIpAddress/service.svc?wsdl

"error: cannot obtain metadata from http://WcfServiceIpAddress/service.svc?wsdl


Dynamically Generate a WCF Proxy class at runtime and Callling web methods via reflection



I'm busy writing an application where the user will have to specify the location of a ?wsdl file for asmx and/or svc type services.

My application will have to :

1. Deduce from the wsdl what methods (with parameters and return types) are available on the service.

2. Provide a way to either generate a Proxy class in memory to execute methods against with e.g: Reflection

    for instanse : genericProxy.Invoke("HelloWorldMethod",parameter1,parameter2);

    I want to avoid using something like this : notSoGenericProxy.HelloWorldMethod(parameter1,parameter2); seeing that my application will have no 

    idea what service it will have to work with at runtime.

Is there a way to achieve this?

Thank you for any help in advance!

Adding IServiceClient interface to generated proxy service client class

would it be possible to add a service client interface to a generated service client class in a generated service proxy in order to achieve easier testability?
Here's an example of what I am asking the way I do it manually http://blog.vuscode.com/malovicn/archive/2009/11/01/design-for-testability-wcf-proxies.aspx

This would not break backward compatibility (safe to be added)

Is this question more for Connect? :)


WCF Proxy Class with callback



I think it is an easy question for experts.


   [ServiceContract(CallbackContract = typeof(IMessageCallback))]
    public interface IMessage
        void AddMessage(string message);

        bool Subscribe();

        bool Unsubscribe();

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend