how to customize soap body using asp.net C# 2005?

hemant s

New member
our client using java platform for this we need customize soap body during serialization

my code is following


[WebService(Namespace = "srijanrozgaar.com/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
public class Srijan_Hughes : System.Web.Services.WebService {

public Srijan_Hughes () {

}

[WebMethod]
[SoapDocumentMethod(ResponseElementName = "ns10checkVLEDataResponseElement")]
[return: XmlText("ns0:result")]
public string checkVLEDataElement(string vleId, string srvcCharge, string serviceName,string amountToBeDeducted)
{

string _status = "";
clsHughes ObjTransDetails = new clsHughes();
ObjTransDetails.VLEID = vleId;
ObjTransDetails.ServiceAmt = srvcCharge;
ObjTransDetails.ServiceName = serviceName;
ObjTransDetails.AmountToBeDeducted = amountToBeDeducted;
if (serviceName == "Railway-Booking")
{
_status = ObjTransDetails.HUGHESMoneyTransactionDetails();
}
if (serviceName == "Railway-Cancellation")
{
_status = ObjTransDetails.HUGHES_VLE_WC_ReimbursementDetails();
}
return _status;

}


}


soap


POST /SrijanRozgaar_SVN/Srijan_Hughes.asmx HTTP/1.1
Host: localhost
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://tempuri.org/confirmVLEDataElement"

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="w3.org/2001/XMLSchema-instance" xmlns:xsd="w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<confirmVLEDataElement xmlns="http://tempuri.org/">
<tempTranId>string</tempTranId>
<vleId>string</vleId>
<confirmFlag>string</confirmFlag>
<amountDeductedOrRefunded>string</amountDeductedOrRefunded>
</confirmVLEDataElement>
</soap:Body>
</soap:Envelope>

HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="w3.org/2001/XMLSchema-instance" xmlns:xsd="w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<ns0_x003A_confirmVLEDataResponseElement xmlns="http://tempuri.org/">
<ns0_x003A_result>string</ns0_x003A_result>
</ns0_x003A_confirmVLEDataResponseElement>
</soap:Body>
</soap:Envelope>




but i need


<ns0:confirmVLEDataResponseElement xmlns="http://tempuri.org/">
<ns0:result>string</ns0:result>
</ns0:confirmVLEDataResponseElement>



please help me
 
Back
Top