473,378 Members | 1,372 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,378 software developers and data experts.



I am newbie in xslt.

I have some problem in my current project.

I have to call web service from xslt. I have to use HTTP Post method to access webservice.

I have got a guideline but not understanding fully....

Please let me know how can I write the xslt.

Nov 16 '08 #1
6 8151
8,658 Expert Mod 8TB
you picked up quite a difficult topic for your start....

well, the mentioned <post:message> was a self written extension (...) by the author, so without that, we can't help you there. The discussion went then about server interactions of xml/xslt.

Is it absolutely necessary, that you call your webservice (SOAP?) from within XSLT? there may be other ways including other techniques, but I can't say that for sure (I don't use websevices yet).

Nov 17 '08 #2

Thanx for your reply.......

I need to call webservice from xslt.

I have implemented the get method:

The sample is a addition program.

The xslt is.....

<?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,'&amp;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"/>


The Web method is......

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

//public string HelloWorld()
// return "Hello World";
public int WebAdd(int x, int y)
return x + y;
public int WebMultiply(int x, int y)
return x * y;
public void testmethod(XmlDocument xd)


Now i want to call webservice using post method. The soap is written below. Please tell me how can pass this soap message from xslt to the webservice?

<?xml version="1.0" encoding="utf-8" ?>
- <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
- <soap:Body>
- <AddTwoNumbers xmlns="http://localhost/wwwroot/addnumbers/Service1">
Nov 17 '08 #3
8,658 Expert Mod 8TB
first, please use [code] tags (or select your code, then click on the # button in the message editor menu) when posting code.

I suppose your calculation service is just an example for something else (why add two numbers remotely except for testing something more complex...)

also I do not see the point for the need of xslt yet. if you could be a bit more specific about the background I could be of more help.


PS: which XSLT version are you using?
PPS: found XSLT 2.0 SOAP extension
Nov 17 '08 #4
Actually i need to call many functions one by one And have to use XSLT for that.

I use microsoft processor. Not the saxon one...
Nov 17 '08 #5
8,658 Expert Mod 8TB
that's the best I could find... but maybe it gives you a little push in the right direction (the idea there was to call soap via java)

Nov 17 '08 #6
2,057 Expert 2GB
XSLT can only access an xml document as if it was a static document. You really need to do this coding in C# or another language.
Nov 17 '08 #7

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

Similar topics

by: Gary Petersen | last post by:
For the benefit of others, I want to show how to do an HTTP POST request using fsockopen(). I banged my head against a wall for two days trying to figure this out. I even went to http://php.net/...
by: Geoff | last post by:
I have been asked to add postal rates to a web page shopping cart checkout procedure. After contacting the post office I discovered that they used XML to receive postal rate requests and send back...
by: WIWA | last post by:
Hi, I want to login to a password protected website and fetch the content of the page behind. I have based my code on http://weblogs.asp.net/jdennany/archive/2005/04/23/403971.aspx. When I use...
by: Patrick Fogarty | last post by:
I am programming what is to be a web service client that will use an HTTP-POST to request and retrieve data. The remote server (written in java for what it's worth) requires basic authentication...
by: JansenH | last post by:
We have implemented a 'HTTP Post' client in C# that posts Xml documents to a webserver. This is working fine if the post rate is one post for every 20 seconds. But if the post rate is increased to...
by: Arfeen | last post by:
Hi All, I need help again ..... I have an asp.net web page which I hit using the "HTTP POST" method. My ASP.NET page is a basic hello world example with the following code: private void...
by: =?Utf-8?B?cGhlbmdsYWk=?= | last post by:
I am not sure really how to explain this but here goes. I am creating some new web services and I want to be able to post data like the following: <Data> <some value>1</some value> <more...
by: Brybot | last post by:
I am trying to allow HTTP POST file uploads to my web service. Currently I have it working perfectly for a SOAP/XML request reading in a byte using MemoryStream/FileStream but I cannot figure out...
by: MDANH2002 | last post by:
Hi From VB.NET I want to simulate the POST request of the following HTML form <html> <title>HTTP Post Testing</title> <body> <form action=http://www.example.com/postdata ...
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...

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.