Webservices

D

devjnr

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.
 
C

Cowboy \(Gregory A. Beamer\)

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,566
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top