Webservices

  • Thread starter Thread starter devjnr
  • Start date Start date
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.
 
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!
*************************************************
 
Back
Top