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.

HTTP POST from XSLT

6
Hi,

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....
http://www.biglist.com/lists/xsl-list/archives/200212/msg00068.html


Please let me know how can I write the xslt.

Regards,
Smaranika
Nov 16 '08 #1
6 8151
Dormilich
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).

regards
Nov 17 '08 #2
neerom
6
Hi

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"/>
</xsl:template>


</xsl:stylesheet>


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
//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)
{

}
}


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">
<a>10</a>
<b>12</b>
</AddTwoNumbers>
</soap:Body>
</soap:Envelope>
Nov 17 '08 #3
Dormilich
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.

regards

PS: which XSLT version are you using?
PPS: found XSLT 2.0 SOAP extension
Nov 17 '08 #4
neerom
6
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
Dormilich
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)

regards
Nov 17 '08 #6
jkmyoung
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

4
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/...
3
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...
0
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...
3
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...
3
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...
1
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...
2
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...
6
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...
2
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 ...
0
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
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...
0
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...
0
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
0
BarryA
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
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...
0
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.