wcf

WCF Sending object from MessageInspector to operation method

白昼怎懂夜的黑 提交于 2021-02-11 14:37:48
问题 I'm working with a very complicated and nested web service. The messages don't always deserialize properly at the operation and the vendor has suggested I use MessageInspectors to correctly get the data. This has been working correctly for some time but I'm starting to see issues because in the MessageInspector I'm setting a static XElement variable in the class as a work-around for not being able to pass the XElement object to the instance of the class that gets started for this call. I'm

UsernameTokenHeader for WCF service

喜夏-厌秋 提交于 2021-02-11 14:33:02
问题 I am new WCF service. Here I am trying to add wsse:Security UsernameToken Header in wcf request message but I don't know how to do that and the rest of the things. It would be much appreciated if someone could help on this. Thanks in advance. 回答1: You can add a custom header by implementing the IDispatchMessageInspector interface. IDispatchMessageInspector is the interface implemented by the server. The client needs to implement the IClientMessageInspector interface. Here is my Demo: public

What is the Java Apache CXF equivalent of C# WCF AddressHeader?

。_饼干妹妹 提交于 2021-02-11 13:53:58
问题 I'm trying to access an old SOAP based system written in C# from a Java backend service. This C# application is looking for an AddressHeader to be populated with a specific value on every request. I'm using Apache CXF to create the requests to this service. Unfortunately, for the life of me, I cannot find out how to add this address header to each of the requests. Does anyone know what the equivalent in Java is and how to add it using Apache CXF? 回答1: The address header is the same as the

How to fetch value from an ExtensionDataObject of a wcf reponse

て烟熏妆下的殇ゞ 提交于 2021-02-11 13:53:52
问题 I have a WCF service which returns ExtensionDataObject during runtime as attached snapshot: Im struck with fetching value for these objects. Could anyone please help here: Have tried with below code using reflection, which throws Parameter count missing exception List<System.Runtime.Serialization.ExtensionDataObject> extData = temp.Select(x => x.ExtensionData).ToList(); var GetCountry = extData.GetType().GetProperties(); string Country = string.Empty; foreach (var property in GetCountry) {

How to fetch value from an ExtensionDataObject of a wcf reponse

泄露秘密 提交于 2021-02-11 13:51:30
问题 I have a WCF service which returns ExtensionDataObject during runtime as attached snapshot: Im struck with fetching value for these objects. Could anyone please help here: Have tried with below code using reflection, which throws Parameter count missing exception List<System.Runtime.Serialization.ExtensionDataObject> extData = temp.Select(x => x.ExtensionData).ToList(); var GetCountry = extData.GetType().GetProperties(); string Country = string.Empty; foreach (var property in GetCountry) {

What is the Java Apache CXF equivalent of C# WCF AddressHeader?

纵然是瞬间 提交于 2021-02-11 13:51:04
问题 I'm trying to access an old SOAP based system written in C# from a Java backend service. This C# application is looking for an AddressHeader to be populated with a specific value on every request. I'm using Apache CXF to create the requests to this service. Unfortunately, for the life of me, I cannot find out how to add this address header to each of the requests. Does anyone know what the equivalent in Java is and how to add it using Apache CXF? 回答1: The address header is the same as the

How to see the username on a WCF call trace

懵懂的女人 提交于 2021-02-11 12:41:02
问题 I have the following problem. I'm connecting to a Java SOAP service using WCF. On the java logs there seems to be a problem where the last user credentials are being sent instead of the current one, although just for the first call that the user makes. The problem is that I don't control the Java side and I don't know if the problem is with them as I can't find a place in my code where I think this may be happening. I want to confirm that the username that we are sending is the same one that

WCF service with entity framework(relationship between table)

时光总嘲笑我的痴心妄想 提交于 2021-02-11 12:32:18
问题 I am creating a server on a WCF server. I have a database in which there are several tables. For each of the tables, you need to create a WCF service. The WCF service has two files, an interface where I implement my REST architecture and a microwave file where I implement the methods that I call on this interface. When working with the database, EF, database first was used. This means that the data was imported from MySQL by the framework itself and automatically established connections. 1st

Get Client's Mac address at server side in WCF service C#\ [duplicate]

陌路散爱 提交于 2021-02-11 06:53:28
问题 This question already has answers here : Obtaining client IP address in WCF 3.0 (3 answers) Closed 2 hours ago . I have WCF service hosted as windows service, I am trying to get clients (WPF client) Mac address at server end (WCF side). I have tried using following line of code but it gives me IP address of client that too in ::1 format. RemoteEndpointMessageProperty prop = OperationContext.Current.IncomingMessageProperties[RemoteEndpointMessageProperty.Name] as RemoteEndpointMessageProperty;

Get Client's Mac address at server side in WCF service C#\ [duplicate]

爷,独闯天下 提交于 2021-02-11 06:53:19
问题 This question already has answers here : Obtaining client IP address in WCF 3.0 (3 answers) Closed 2 hours ago . I have WCF service hosted as windows service, I am trying to get clients (WPF client) Mac address at server end (WCF side). I have tried using following line of code but it gives me IP address of client that too in ::1 format. RemoteEndpointMessageProperty prop = OperationContext.Current.IncomingMessageProperties[RemoteEndpointMessageProperty.Name] as RemoteEndpointMessageProperty;