Hi,
Thanx for your update.. I am using visual studio 2005. I have written a webservice which adds two integer....
using System;
using System.Web;
using System.Collections;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.Xml;
/// <summary>
/// Summary description for WebService
/// </summary>
[WebService(Namespace = "http://www.tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
public class WebService : System.Web.Services.WebService {
public WebService () {
//Uncomment the following line if using designed components
//InitializeComponent();
}
//[WebMethod]
//public string HelloWorld()
//{
// return "Hello World";
//}
[WebMethod]
public int WebAdd(int x, int y)
{
return x + y;
}
[WebMethod]
public int WebMultiply(int x, int y)
{
return x * y;
}
[WebMethod]
public void testmethod(XmlDocument xd)
{
}
The XSLT passes the int value by GET method:
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:user="http://my_domain_name/my_namespace">
<xsl:output method="xml" omit-xml-declaration="yes"/>
<xsl:template match="/">
<xsl:variable name="params" select="concat('x=',10,'&y=',20)" />
<xsl:variable name="CallWebService" select="'http://localhost:1600/smaranika_test/WebService.asmx/WebAdd'" />
<xsl:variable name="docName" select="concat($CallWebService,'?',$params)" />
<xsl:variable name="returnvalue" select="document($docName)" />
<xsl:value-of select="$returnvalue"/>
</xsl:template>
</xsl:stylesheet>
It is running successfully.... Then why cant we call a web service using post method??
|