Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Web services

Web services

From: <devjnr_at_gmail.com>
Date: 19 Oct 2006 01:15:22 -0700
Message-ID: <1161245721.931648.207040@e3g2000cwe.googlegroups.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. Received on Thu Oct 19 2006 - 03:15:22 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US