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

Webservices

I have to call e NET web service via Oracle.

this is my asmx:
=========================================
<%@ WebService Language="C#" class="MyClass" %>

using System.Web.Services ;

public class MyClass
{
[WebMethod()]
public int Add ( int a, int b)
{
return a + b ;
}
}
=========================================
If I call http://localhost/TestWebService.aspx where
TestWebService.aspx is
=========================================
<html>

<body>
<form action="http://localhost/MyWebService.asmx/Add" method="POST">

<input name="a"></input>
<input name="b"></input>

<input type="submit" value="Enter"</input>
</form>

</body>
</html>
=========================================
and I fill input "a" with 2 and input "b" with 3 I obtain:

=========================================
<?xml version="1.0" encoding="utf-8"?>
<int xmlns="http://tempuri.org/">5</int>
=========================================
This web service works fine.
I have to call it from Oracle function and I found this script:

=========================================
CREATE OR REPLACE FUNCTION get_stock_price (p_stock_code IN VARCHAR2)
RETURN NUMBER
AS
l_request soap_api.t_request;
l_response soap_api.t_response;
l_price NUMBER;
BEGIN

l_request := soap_api.new_request(p_method ='ns1:getQuote',
p_namespace =>
'xmlns:ns1="urn:xmethods-delayed-quotes"');

soap_api.add_parameter(p_request =l_request,
p_name ='symbol',
p_type ='xsd:string',
p_value =p_stock_code);

l_response := soap_api.invoke(p_request =l_request,
p_url =>
'http://64.124.140.30:9090/soap',
p_action =>
'urn:xmethods-delayed-quotes#getQuote');

l_price := soap_api.get_return_value(p_response =l_response,
p_name ='Result',
p_namespace =>
'xmlns:ns1="urn:xmethods-delayed-quotes"');

RETURN l_price;
EXCEPTION
WHEN OTHERS THEN
RETURN NULL;
END;
/
=========================================
I don't figure out which parameters (of my asp net web service) I have
to replace to this last script to use web service.

Can you help me pls?

Thx.

Oct 19 '06 #1
1 2260
Have not worked with Oracle on web services before, but looking at the code,
you need to add two parameters, both of which are integers. Have you checked
out technet.oracle.com yet? It has samples and docs to help developers work
with Oracle.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
http://gregorybeamer.spaces.live.com

*************************************************
Think outside of the box!
*************************************************
<de****@gmail.comwrote in message
news:11**********************@h48g2000cwc.googlegr oups.com...
>I have to call e NET web service via Oracle.

this is my asmx:
=========================================
<%@ WebService Language="C#" class="MyClass" %>

using System.Web.Services ;

public class MyClass
{
[WebMethod()]
public int Add ( int a, int b)
{
return a + b ;
}
}
=========================================
If I call http://localhost/TestWebService.aspx where
TestWebService.aspx is
=========================================
<html>

<body>
<form action="http://localhost/MyWebService.asmx/Add" method="POST">

<input name="a"></input>
<input name="b"></input>

<input type="submit" value="Enter"</input>
</form>

</body>
</html>
=========================================
and I fill input "a" with 2 and input "b" with 3 I obtain:

=========================================
<?xml version="1.0" encoding="utf-8"?>
<int xmlns="http://tempuri.org/">5</int>
=========================================
This web service works fine.
I have to call it from Oracle function and I found this script:

=========================================
CREATE OR REPLACE FUNCTION get_stock_price (p_stock_code IN VARCHAR2)
RETURN NUMBER
AS
l_request soap_api.t_request;
l_response soap_api.t_response;
l_price NUMBER;
BEGIN

l_request := soap_api.new_request(p_method ='ns1:getQuote',
p_namespace =>
'xmlns:ns1="urn:xmethods-delayed-quotes"');

soap_api.add_parameter(p_request =l_request,
p_name ='symbol',
p_type ='xsd:string',
p_value =p_stock_code);

l_response := soap_api.invoke(p_request =l_request,
p_url =>
'http://64.124.140.30:9090/soap',
p_action =>
'urn:xmethods-delayed-quotes#getQuote');

l_price := soap_api.get_return_value(p_response =l_response,
p_name ='Result',
p_namespace =>
'xmlns:ns1="urn:xmethods-delayed-quotes"');

RETURN l_price;
EXCEPTION
WHEN OTHERS THEN
RETURN NULL;
END;
/
=========================================
I don't figure out which parameters (of my asp net web service) I have
to replace to this last script to use web service.

Can you help me pls?

Thx.

Oct 19 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Jinashe | last post by:
what do i need to enable accessing of webservices from a clients PC i'm hosting some webservices from my server in VB.NET. i've got some client windows applications done in VB.NET. what have i...
0
by: Erik P. Vinther | last post by:
Hi This might be slightly OT, but I couldn't find a better NG for this question The question is regarding versioning of webservices. A webservice end point URL basically consists of a base...
8
by: Allan Ebdrup | last post by:
I just had a discussion with one of my fellow programmers. We have a class for doing some logging and sending an email, it has 5 different scenarioes of loggin that are common enough to share a...
5
by: Stephanie Stowe | last post by:
Imagine that I had this <webServices> <soapExtensionTypes> <add type="Microsoft.Web.Services.WebServicesExtension, Microsoft.Web.Services, Version=1.0.0.0, Culture=neutral,...
1
by: Diffident | last post by:
Hello Guys, I have a question with regards to the efficiency and best practices in .NET framework. We are currently using Webservices as normal classes. The way we are invoking methods in...
5
by: cyberstrike | last post by:
Hi guys, my company was wondering if it's possible to develop ASP.NET/Webservices easily using a IIS installed on a server instead of installing IIS locally on the development boxes. Can you...
2
by: Antuane | last post by:
any one have any idea how transactions could be enabled in webservices. i.e., suppose i've got 2 methods - one to add a contact, & the other to set some miscellaneous details for the contact, in a...
1
by: Mike | last post by:
Hi all, I have written a webservice which I am using in my smartphone applicaiton. I have tried the webservice with a WinForms client and it works time and time again perfectly. When I include...
8
by: Komandur Kannan | last post by:
We have a smart device application running on handhelds(Symbol MC9000G). The backend is Oracle and a middle tier web services development done in Vb.net. We use pessimistic Locking due to...
5
by: ChrisM | last post by:
Hi, I have written a stand alone WinForms application with an MS Access back-end for the (small)company I work for. They are now talking about moving a part of their operations into a second...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.