GeneBe
asked on
changing the xml tag on the web service result
public int Calculator(int fristno, int secondno)
{
return(fristno + secondno);
}
this will give int as an element tag. how do I customized that?
{
return(fristno + secondno);
}
this will give int as an element tag. how do I customized that?
Post a concise and complete example. The important parts are missing. Also post your XML.
ASKER
source code:
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(Conform sTo = WsiProfiles.BasicProfile1_ 1)]
[System.ComponentModel.Too lboxItem(f alse)]
// To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.
// [System.Web.Script.Service s.ScriptSe rvice]
public class Calculator : System.Web.Services.WebSer vice
{
[WebMethod]
public int WSCalculator(int fristno, int secondno)
{
return (fristno + secondno);
}
}
entered: fristno = 10 and secondno = 30
WebService response:
<?xml version="1.0" encoding="UTF-8"?>
<int xmlns="http://tempuri.org/">40</int>
I want to change the "int" to "Sum" like so <int xmlns="http://tempuri.org/">40</int>
to <Sum xmlns="http://tempuri.org/">40</Sum>
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(Conform
[System.ComponentModel.Too
// To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.
// [System.Web.Script.Service
public class Calculator : System.Web.Services.WebSer
{
[WebMethod]
public int WSCalculator(int fristno, int secondno)
{
return (fristno + secondno);
}
}
entered: fristno = 10 and secondno = 30
WebService response:
<?xml version="1.0" encoding="UTF-8"?>
<int xmlns="http://tempuri.org/">40</int>
I want to change the "int" to "Sum" like so <int xmlns="http://tempuri.org/">40</int>
to <Sum xmlns="http://tempuri.org/">40</Sum>
ASKER
this is the xml response:
<?xml version="1.0" encoding="UTF-8"?>
<string xmlns="http://tempuri.org/">
<Member>
<LastName>Gabriel</LastNam e>
<FirstName>Julian</FirstNa me>
<AltKey>000011101</AltKey>
<HCFANbr>000011101</HCFANb r>
<ContractNbr>0000111</Cont ractNbr>
<BirthDate>2001-06-14T00:0 0:00</Birt hDate>
</Member>
</string>
<?xml version="1.0" encoding="UTF-8"?>
<string xmlns="http://tempuri.org/">
<Member>
<LastName>Gabriel</LastNam
<FirstName>Julian</FirstNa
<AltKey>000011101</AltKey>
<HCFANbr>000011101</HCFANb
<ContractNbr>0000111</Cont
<BirthDate>2001-06-14T00:0
</Member>
</string>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.