Quantcast
Channel: WCF, ASMX and other Web Services
Viewing all articles
Browse latest Browse all 555

WCF SOAP Service with .net 4.5

$
0
0

I have created very simple soap service and it is working good but I want to add some attributes to the soap envelop My Code

Interface

namespace SOAPService
{
[ServiceContract]
public interface IService
{
[OperationContract]
double AddNumbers(double number1, double number2);
}
}

svc code

namespace SOAPService
{

public class Service : IService
{
public double AddNumbers(double number1, double number2)
{
double result = number1 + number2;
return result;
}
}
}

When open request in SOAPUI It looks like

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/"><soapenv:Header/><soapenv:Body><tem:AddNumbers><!--Optional:--><tem:number1>1</tem:number1><!--Optional:--><tem:number2>1</tem:number2></tem:AddNumbers></soapenv:Body></soapenv:Envelope>



But I was looking output like this

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xmlns:xsd="http://www.w3.org/1999/XMLScheme><soapenv:Header/><soapenv:Body><tem:AddNumbers><!--Optional:--><tem:number1>1</tem:number1><!--Optional:--><tem:number2>1</tem:number2></tem:AddNumbers></soapenv:Body></soapenv:Envelope>



How can I add those xmlns:xsi and xmlns:xsd attributes


Viewing all articles
Browse latest Browse all 555

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>