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


Top 5 Contributors of the Month
david stephan
Asad Ali
Fauzul Azmi
Post New Web Links

Why WCF client proxy doesn't contain Specified suffix?

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

I have a simple DataContract, with an int DataMember (X), I can see the minOccurs is 0 in the wsdl, when I generated client proxy, I was expecting to see a property with the Specified suffix (XSpecified), but it's not.

Also, when I use "Add web references", XSpecified is generated, when I use "Add service references", it's not.

The service is hosted in a Console Application.

I have been looking at this for quite a while, cannot find any clue, any help is appreciated.

C# code:

 [ServiceContract(Namespace = "http://localhost/Calc")]
 public interface ICalc
 {
  [OperationContract]
  int Add(AddInputs inputs);
 }

 [DataContract]
 public class AddInputs
 {
  [DataMember]
  public Int32 X { get; set; }

  [DataMember]
  public int Y { get; set; }
 }

 public class C


View Complete Post


More Related Resource Links

Why WCF client proxy doesn't contain Specified suffix?

  

I have a simple DataContract, with an int DataMember (X), I can see the minOccurs is 0 in the wsdl, when I generated client proxy, I was expecting to see a property with the Specified suffix (XSpecified), but it's not.

Also, when I use "Add web references", XSpecified is generated, when I use "Add service references", it's not.

The service is hosted in a Console Application.

I have been looking at this for quite a while, cannot find any clue, any help is appreciated.

C# code:

  [ServiceContract(Namespace = "http://localhost/Calc")]
  public interface ICalc
  {
    [OperationContract]
    int Add(AddInputs inputs);
  }

  [DataContract]
  public class AddInputs
  {
    [DataMember]
    public Int32 X { get; set; }

    [DataMember]
    public int Y { get; set; }
  }

  public class Calc : ICalc
  {
    public int Add(AddInputs inputs)
    {
      return inputs.X + inputs.Y;
    }
  }

Configuration:

 <system.serviceModel>
  <services>
   <service name="ServerApp.Calc" behaviorConfiguration="CalcBehavior">
    <host>
     <baseAddresses>
      <add baseAddress="http://NT60:8000/WCF1/Service"/>
     </baseAddresses>
    </host>
    <endpoint address="Calc&q

Why WCF client proxy doesn't contain Specified suffix?

  

I have a simple DataContract, with an int DataMember (X), I can see the minOccurs is 0 in the wsdl, when I generated client proxy, I was expecting to see a property with the Specified suffix (XSpecified), but it's not.

Also, when I use "Add web references", XSpecified is generated, when I use "Add service references", it's not.

The service is hosted in a Console Application.

I have been looking at this for quite a while, cannot find any clue, any help is appreciated.

C# code:

 [ServiceContract(Namespace = "http://localhost/Calc")]
 public interface ICalc
 {
  [OperationContract]
  int Add(AddInputs inputs);
 }

 [DataContract]
 public class AddInputs
 {
  [DataMember]
  public Int32 X { get; set; }

  [DataMember]
  public int Y { get; set; }
 }

 public class Calc : ICalc
 {
  public int Add(AddInputs inputs)
  {
   return inputs.X + inputs.Y;
  }
 }

Configuration:

 <system.serviceModel>
 <services>
  <service name="ServerApp.Calc" behaviorConfiguration="CalcBehavior">
  <host>
   <baseAddresses>
   <add baseAddress="http://NT60:8000/WCF1/Service"/>
   </baseAddresses>
  </host>
  <endpoint address="Calc" binding="wsHttpBinding" contract="ServerApp.ICalc&q

Abort() method of wcf client proxy doesn't release session after catching FaultException

  

Hello,

I have created a simple wcf service hosted in IIS and wcf client and figured out that when u catch a FaultException from the wcf service and then call client.Abort() to release the session (as the microsoft samples said) it doesn't release the session and hangs up on the 11th call.

Here is example:

Wcf Service:

[ServiceContract]   
public interface IService1 
{ 
    [OperationContract] 
    string GetData(int value); 
} 
 
 
public class Service1 : <

Abort() method of wcf client proxy doesn't release session after catching FaultException

  

Hello,

I have created a simple wcf service hosted in IIS and wcf client and figured out that when u catch a FaultException from the wcf service and then call client.Abort() to release the session (as the microsoft samples said) it doesn't release the session and hangs up on the 11th call.

Here is example:

Wcf Service:

[ServiceContract]   
public interface IService1 
{ 
    [OperationContract] 
    string GetData(int value); 
} 
 
 
public class Service1 : <

COM Server process compiled with /clr option doesn't unload itself from memory when last COM client

  
I created Visual C++ ATL project in VS2010, exe type, imlemented COM object, then added /clr option to project. Project uses other C# dlls (WCF service). When last COM client disconnects and last COM object instance destroys, WCF service stopped, my COM server process doesn't unload itself from memory. All managed threads in C# dll are background, COM object doesn't create threads. How can I unload server process? Thank you in advance. 

WCF proxy client behind ISA Server

  

Hi

My client applcation using WCF client is behind ISA Server.When I call some WCF service method, the following exception occurs..

"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 service is denied" )"

Well, I got this post

http://social.msdn.microsoft.com/Forums/en-US/wcf/thread/83bafcd0-5bab-4cb9-96cf-a53ce132c7ab/

But not successful in my case..... :(

How to call WCF method behind ISA Server ???

Regards

Zee


Exception thrown on client proxy call to open

  
Exception thrown System.InvalidOperationException: The communication object cannot be modified while it is in the Opened state.


The following code throws this exception:

            try
            {
                if (dataAcesssProxy == null)
                {
                    dataAcesssProxy = new CompetellaDataAccessService.CompetellaDataAccessClient();
                    dataAcesssProxy.ClientCredentials.Windows.ClientCredential = new System.Net.NetworkCredential("someuser", "password", "domain");

                    dataAcesssProxy.InnerChannel.Faulted += new EventHandler(InnerChannel_Faulted);
                    da

Windows WCF client with internet proxy server showing error The server committed a protocol violatio

  

Our team trying to create a windows application(c#) to call a WCF service using internet proxy server

Showing exception "The server committed a protocol violation. Section=ResponseStatusLine" while calling WCF service

Please give suggestion to solve this problem/any alternative solution

 

//Code for creating proxy
public static DevicesServiceClient CreateProxy()
{
 
var proxy = new DevicesServiceClient("BasicHttpBinding_IDevicesService");

 
BasicHttpBinding binding = new BasicHttpBinding();
  binding
.Security.Mode = BasicHttpSecurityMode.None;
  binding

WCF client with internet proxy server showing error The server committed a protocol violation. Secti

  

Our team trying to create a windows application(c#) to call a WCF service using internet proxy server

Showing exception "The server committed a protocol violation. Section=ResponseStatusLine" while calling WCF service

when i tried to solve the problem using this code then showing the same error

 

<configuration>
   
<system.net>
       
<settings>
           
<httpWebRequest useUnsafeHeaderParsing="true" />
       
</settings>
   
</system.net>
</configuration>

 

Please give suggestion to solve this problem/any alternative solution

 

Client proxy - certificate gets loaded after the wcf has been "navigated to" via Internet explorer

  

We are having issues with our certificates assigned to the WCF-client proxy. If we issue a call to a WCF-service via basicHttpBinding with transport security using certificates we get an error stating "Could not establish secure channel for SSL/TLS with authority X". If we open internet explorer and navigate to the WCF-service and select the certificate, it works nicely and after that our WCF-client proxy works as well.

Ideas?

//Daniel


Recommendation for WCF client proxy caching

  

Today we add a service reference to the WCF endpoint from the client. Using that reference we  creating newMyServiceClient to get a client proxy to be able to access the endpoint.

I would like to cache the client proxy that will be shared amounts different threads, so I guess I need a ReaderWriterLock when creating a new instance of a proxy. I have seen several different examples on the net how to cache the client proxies, so I'm a little bit confused about that is the best practice.

Do anybody have any recommended example code for this caching?


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>
</:Fault>


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

....

.NET 4 Client Profile doesn't instal properly

  

I've tried to instal the following within Windows Update - Microsoft .NET Framework 4 Client Profile for Windows 7 x64-based Systems (KB982670).  Each time the instal fails, with no explanation why.  However, I have an application on my PC which seems to recognise the presence of .NET 4 and, as a consequence, stalls.  My Registry shows 3.5 SP1 as being installed, but not 4.  Control Panel doesn't show .NET 4.  Any ideas on how I can clean up, or why the v4 instal doesn't complete?


Adding IServiceClient interface to generated proxy service client class

  
Hi,
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? :)

Thanks,
Nikola

SOAP Client doesn't populate result object

  

When consuming a remote service XYZ ... XYZ_RESP = client.GET_XYZ_SERVICE(XYZ_REQUEST), the response object is set to null.  Using system.diagnostics, I can see that the results are being returned to .NET in the HttpWebResponse.

 

I have tried modifying the xsd as described by this link without success:

http://social.msdn.microsoft.com/forums/en-US/asmxandxml/thread/e33305c3-b5f6-4922-8a3f-df202088d25a

 

XYZ_RESP.xsd:

<?xml version="1.0" encoding="utf-8"?>
<xsd:schema xmlns="http://www.example.org" elementFormDefault="qualified" targetNamespace="http://xmlns.oracle.com/Enterprise/HCM/services" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <xsd:element name="XYZ_RESP">
    <xsd:complexType>
      <xsd:sequence maxOccurs="1">
        <xsd:element name="LOVS">
          <xsd:complexType>
            <xsd:sequence>
              <xsd:element name="LOV">
     &n

"Requested Service not found" on client when restart service with a .NET MarshalByRef remoting proxy

  

I have a client application that uses a single remoting entry point (a MarshalByRef class) to access a range of other MarshalByRef services on the server.

The server:

public class ServiceManager : MarshalByRefObject, IServiceManager
{
  IService1 service1;
  public ServiceManager(IService1 service1)
  {
    this.service1 = service1;
  }
  public override object InitializeLifetimeService()
  {
    return null; // never expire
  }

  public IService1 GetService1()
  {
    return service1;
  }
}

public class Service1 : MarshalByRefObject, IService1
{
  public override object InitializeLifetimeService()
  {
    return null; // never expire
  }
}

Ho

Use jQuery and ASP.NET AJAX to build a client side Repeater

  
By sending only data to the client, you can profoundly reduce the size of what you send and see a substantial increase in performance. You also allow yourself the ability to easily add features like light-weight sorting and paging on the client. This can not only improve your users' experience, but reduce server load and bandwidth requirements.
Categories: 
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