473,405 Members | 2,187 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

I created a WcfService....

1,047 Expert 1GB
The result looks like this
Expand|Select|Wrap|Line Numbers
  1. <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
  2.    <s:Body>
  3.       <testResponse xmlns="http://tempuri.org/">
  4.          <testResult>
  5.             <resultaat xmlns="">
  6.                <Nummer>105095306</Nummer>
  7.             </resultaat>
  8.          </testResult>
  9.       </testResponse>
  10.    </s:Body>
  11. </s:Envelope>
I want to remove 2 out if 3 tags from the result from
<testResponse xmlns="http://tempuri.org/">
<testResult>
<resultaat xmlns="">

How should i do that?

My code looks likethis
Expand|Select|Wrap|Line Numbers
  1.  [ServiceContract]
  2.     public interface IService1
  3.     {
  4.         // TODO: Add your service operations here
  5.         [OperationContract(Name = "test")]
  6.         XmlElement GetData2(string value);
  7.  
  8.     }
May 14 '16 #1
4 2034
pod
298 100+
Look into regular expressions
May 31 '16 #2
Luuk
1,047 Expert 1GB
Can you explain how regular expressions would help in this case?

i.e. give an example of how this could be solved with regular expression?
May 31 '16 #3
pod
298 100+
yeah, I just looked a little more into WCFServices and the control seems to be somewhat limited over the output format, it is a bit more complicated than I thought, I need more experience since I will need to get some ready soon for my own purposes. Although I did try one tutorial, a MVC Web API and the output is very flexible; can be JSON upon request from a web page and XML by default...

It may be not what you are looking for but I hope it helps


check it out

tutorial-your-first-web-api


Expand|Select|Wrap|Line Numbers
  1. <EcProject xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/WebApi.Models">
  2.  <EcProjectID>6</EcProjectID>
  3.  <EcpDescriptionE>Something</EcpDescriptionE>
  4.  <EcpDescriptionF>Quelque chose</EcpDescriptionF>
  5.  <EcpEnd>2016-05-04T00:00:00</EcpEnd>
  6.  <EcpStart>2016-05-03T00:00:00</EcpStart>
  7.  <EcpSynopsisE>Little thing</EcpSynopsisE>
  8.  <EcpSynopsisF>Petite chose</EcpSynopsisF>
  9.  <EcpTitleE>Thing</EcpTitleE>
  10.  <EcpTitleF>Chose</EcpTitleF>
  11.  <FinCodeACT>21</FinCodeACT>
  12.  <ProgramID>3</ProgramID>
  13.  <ProjectBranch>My branch</ProjectBranch>
  14.  <ProjectGroup>MY Group</ProjectGroup>
  15.  <ProjectManager>My manager</ProjectManager>
  16.  <StatusID>3</StatusID>
  17.  <SubmissionID>11</SubmissionID>
  18.  <Username>pod</Username>
  19.  <created i:nil="true"/>
  20.  <modified>2016-05-25T08:58:39</modified>
  21. </EcProject>
  22.  
Jun 2 '16 #4
Luuk
1,047 Expert 1GB
WCF and ASP.NET Web API
"WCF is Microsoft’s unified programming model for building service-oriented applications"
...
"Web API is an ideal platform for building RESTful applications on the .NET Framework"

short conclusion: the difference is too big, I need SOAP, I do not know WCF good enough to solve my problem, it cannot be done using WebAPI
Jun 2 '16 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

21
by: André | last post by:
Short version of what I am looking for: Given a class "public_class" which is instantiated a few times e.g. a = public_class() b = public_class() c = public_class() I would like to find...
2
by: R Duke | last post by:
I have tried everything I can think of to change the visible property of a design time created control from a dynamically created control's command event handler. Here is the scenario. I have...
1
by: CS Wong | last post by:
Hi, I have a page form where form elements are created dynamically using Javascript instead of programatically at the code-behind level. I have problems accessing the dynamically-created...
1
by: Lalit | last post by:
Hi, My application has two methods which creates buttons at runtime. In one method I am able to handle the events of the buttons created at run time, but in other I am not. The code structure...
7
by: MariusI | last post by:
Are objects implicitly stored in the TLS of the currently running thread? When creating multithreaded applications i get errors when accessing data from a different thread than the thread used to...
9
by: Tushar | last post by:
Followup-To: microsoft.public.dotnet.general Does anyone know when is this event raised, is it: 1) When the file is created but may not have been closed 2) When the file is created AND it has...
3
by: Happy Man | last post by:
Why we created All praise is due to Allah and may His peace and blessings be upon his last messenger (saaw) and on all those who follow the path of righteousness until the last day. We have...
2
by: =?iso-8859-1?Q?Norbert_P=FCrringer?= | last post by:
Hello! Is it possible to use the object XMLNode as a parameter in an interface function of a WCF service? In my case I get the error message: XmlNode ProcessServiceRequest(XmlNode request);...
10
by: Jess | last post by:
Hello, If I create a temporary object using a dynamically created object's pointer, then when the temporary object is destroyed, will the dynamically created object be destroyed too? My guess...
16
by: Mike | last post by:
Hi, I have a form with some controls, and a different class that needs to modify some control properties at run time. Hoy can I reference the from so I have access to its controls and...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.