How to call web services from oracle database 10g
Hi all ,
How can i call web services from oracle database 10g ?
thanks ...
abdou123 wrote:
but how can i get complex result
for example
i pass input parameter like National Id Number
and get the person details ( name , age , date of birth , ............ ) .Basic approach to web services using UTL_HTTP explained in {message:id=10448611}.
An example of using a pipeline table function as a data transformation process (turning web data into rows and columns) in {message:id=10158148}.
Similar Messages
-
Calling web service from oracle forms 10g
Problem Description:
I'm following the steps as per the doc:
http://www.oracle.com/technology/products/forms/htdocs/10gr2/howto/webservicefromforms/ws_10_1_3_from_forms.html
to create a java stub to call external web service and then use java importer in oracle forms to call this web service from oracle forms.
WSDL for external web service used is http://gend:83/DesignService.svc?wsdl
The service was developed by us.
Calling the web service using JDeveloper works fine but when I complie in Oracle Forms it returns wrong number of types of arguments in call SENDHELLO.
The code from oracle form to call web service is as below:
DECLARE
jo ora_java.jobject;
xo ora_java.jobject;
rv varchar2(2000);
ex ora_java.jobject;
str varchar2(100);
BEGIN
jo := GendServiceClient.new;
rv := GendServiceClient.sendHello('Nora');
EXCEPTION
WHEN ORA_JAVA.JAVA_ERROR then
message('Unable to call out to Java, ' ||ORA_JAVA.LAST_ERROR);
WHEN ORA_JAVA.EXCEPTION_THROWN then
ex := ORA_JAVA.LAST_EXCEPTION;
message(Exception_.toString(ex));
END;
Any help/ideas on this is greatly appreciated. Thanks.
Edited by: KE Nora Loera on Jun 1, 2012 1:24 PMMy primary skill is PL/SQL but the only information I found on Oracle's site to call a web service from a 10g Form was creating a jar file and importing the java class. Since I don't want to ask our corporate IT to make changes on the UNIX box for the jar files I went a different route.
I use UTL_HTTP.BEGIN_REQUEST to call a URL then load I load the data to a table as a CLOB since we have more than 4000 characters. Now I need to parse the XML and load it into a form. I have never done this so if there is a helpful site please let me know. I have looked at several sites but none do what I want.
Thanks -
Exception when calling web service from Oracle forms 10g
Hi All,
I am trying to integrate Oracle Forms 10g(V 10.1.2.0.2.) with Web Services.
There is a java class named 'authenticate' which is generated using Oracle JDeveloper.
This class is included in the forms application by using "Import Java Class" feature.
Forms built the following funtion based on that class:
-- Method: authenticate (Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
FUNCTION authenticate(
obj ORA_JAVA.JOBJECT,
a0 VARCHAR2,
a1 VARCHAR2) RETURN VARCHAR2 IS
BEGIN
args := JNI.CREATE_ARG_LIST(2);
JNI.ADD_STRING_ARG(args, a0);
JNI.ADD_STRING_ARG(args, a1);
message('here1');
RETURN JNI.CALL_STRING_METHOD(FALSE, obj, 'mypackage/AuthenticatorWebServiceServiceStub',
'authenticate', '(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;', args);
message('here2');
END;
However when the above code is invoked it shows the message 'here1' on the form and then throws the following exception: java.lang.Exception: java.lang.ClassCastException
Please suggest me what's wrong with the code. I appreciate your time and help.
Thanks,
Scott.My primary skill is PL/SQL but the only information I found on Oracle's site to call a web service from a 10g Form was creating a jar file and importing the java class. Since I don't want to ask our corporate IT to make changes on the UNIX box for the jar files I went a different route.
I use UTL_HTTP.BEGIN_REQUEST to call a URL then load I load the data to a table as a CLOB since we have more than 4000 characters. Now I need to parse the XML and load it into a form. I have never done this so if there is a helpful site please let me know. I have looked at several sites but none do what I want.
Thanks -
Calling web service from oracle application framework r12
Hi Techies
Is anybody know How to call web service from oracle application framework r12(step by step procedure),because i searched in net but i could not understand that one
Thanks
Dillibabu B
Edited by: 962005 on 28 Sep, 2012 12:11 AMHi,
Check below links:
http://oracle.anilpassi.com/oa-framework-with-captcha-webservice.html
http://oracle.anilpassi.com/integrate-oa-framework-with-web-service.html
https://blogs.oracle.com/ebusinesssuiteintegration/entry/r121_-invokingweb_service_fr
--Sushant -
How to call WEB Service From SAP
Hi Friends,
How to call WEB Service From SAP.
Thanks in advance,
Murali Krishna KHi,
if you mean calling a web service in Web Dynpro ABAP, see the <a href="http://help.sap.com/saphelp_nw70/helpdata/en/d7/951b42f828df2ce10000000a1550b0/frameset.htm">documentation</a>, if you mean calling a web service in general, this is not the correct forum. This here is the Web Dynpro ABAP forum, for general questions on ABAP, use the ABAP forum.
Regards, Heidi -
How to call web services from HTML
Hi All,
Does anybody have an idea on how to call web services from HTML using axis and i am using jboss-4.0.5 as the application server.What did your Google search return?
-
How to call web services from PL/SQL?
Hi,
Can one help in how to call web services from PL/SQL? Steps, pros and cons, etc....
Thanks in advanceHere's some example skeleton code to get you started...
PROCEDURE p_soap_request(p_username IN VARCHAR2, p_password IN VARCHAR2, p_proxy IN VARCHAR2) IS
soap_request VARCHAR2(30000);
soap_respond CLOB;
http_req utl_http.req;
http_resp utl_http.resp;
resp XMLType;
soap_err exception;
v_code VARCHAR2(200);
v_msg VARCHAR2(1800);
v_len number;
v_txt Varchar2(32767);
BEGIN
UTL_HTTP.SET_PROXY(p_proxy);
-- Define the SOAP request according the the definition of the web service being called
soap_request:= '<?xml version = "1.0" encoding = "UTF-8"?>'||
'<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">'||
' <SOAP-ENV:Body>'||
' <m:DownloadRequest xmlns:m="http://www.website.net/messages/GetDetails">'||
' <m:UserName>'||p_username||'</m:UserName>'||
' <m:Password>'||p_password||'</m:Password>'||
' </m:DownloadRequest>'||
' </SOAP-ENV:Body>'||
'</SOAP-ENV:Envelope>';
http_req:= utl_http.begin_request
( 'http://www.website.net/webservices/GetDetailsService.asmx'
, 'POST'
, 'HTTP/1.1'
utl_http.set_header(http_req, 'Content-Type', 'text/xml');
utl_http.set_header(http_req, 'Content-Length', length(soap_request));
utl_http.set_header(http_req, 'Download', ''); -- header requirements of particular web service
utl_http.write_text(http_req, soap_request);
http_resp:= utl_http.get_response(http_req);
utl_http.get_header_by_name(http_resp, 'Content-Length', v_len, 1); -- Obtain the length of the response
FOR i in 1..CEIL(v_len/32767) -- obtain response in 32K blocks just in case it is greater than 32K
LOOP
utl_http.read_text(http_resp, v_txt, case when i < CEIL(v_len/32767) then 32767 else mod(v_len,32767) end);
soap_respond := soap_respond || v_txt; -- build up CLOB
END LOOP;
utl_http.end_response(http_resp);
resp:= XMLType.createXML(soap_respond); -- Convert CLOB to XMLTYPE
END;Using secure web services (https)...
Web serivces call in Plsql
As for 'pros and cons'... there's nothing to compare against... either you want to call a web service or you don't. -
How to call WEB Service From SAP 4.6 c
Hi Friend,
How to call WEB Service From SAP 4.6 c Report
Thanks in advance.It is not possible to directly call a web service from SAP 4.6c.
Indeed, web service enablement is available as from Web AS 6.20, thus as from SAP R/3 4.7
So as described above, the solution is indeed to make use of PI(XI) for this.
Rgds,
Karim -
How I enable network service of Oracle database 10g XE ?
Hi,
How I enable network service of Oracle database 10g XE ?
Following error occurs when printing:
ORA-20001: The printing engine could not be reached because either
the URL specified is incorrect or a proxy URL needs to be specified.ORA-20001 is a user defined error. So you will have to find out where it comes from.
Regards
Marcus -
Calling web service from oracle forms fails with ORA_JAVA.JAVA_ERROR
Problem Description:
I'm following the steps as per the doc:
http://www.oracle.com/technology/products/forms/htdocs/10gr2/howto/webservicefromforms/ws_10_1_3_from_forms.html
to create a java stub to call external web service and then use java importer in oracle forms to call this web service from oracle forms.
WSDL for external web service used is http://www.webservicex.net/CurrencyConverter.asmx?wsdl
Calling the web service using JDeveloper works fine but from Oracle Forms returns ORA_JAVA.JAVA_ERROR; Unable to call out to Java, Invalid object type for argument 1
The code from oracle form to call web service is as below:
DECLARE
jo ora_java.jobject;
rv ora_java.jobject;
ex ora_java.jobject;
outString varchar2(2000);
BEGIN
jo:= CurrencyConvertorStub.new;
--This will get the exchange rate from US Dollars to UK Sterling.
rv:= CurrencyConvertorStub.ConversionRate(jo,'CAD','USD');
message (float_.floatValue(RV));
EXCEPTION
WHEN ORA_JAVA.JAVA_ERROR then
message('Unable to call out to Java, ' ||ORA_JAVA.LAST_ERROR);
WHEN ORA_JAVA.EXCEPTION_THROWN then
ex := ORA_JAVA.LAST_EXCEPTION;
outString := Exception_.toString(ex);
message(outString);
END;
Any help/ideas on this is greatly appreciated. Thanks.Yes, it is the message line - so basically this call fails => rv:= CurrencyConvertorStub.ConversionRate(jo,'CAD','USD'); and control goes in the exception block
WHEN ORA_JAVA.JAVA_ERROR then
message('Unable to call out to Java, ' ||ORA_JAVA.LAST_ERROR);
Below is the code from java stub that was generated using JDeveloper by using web services stub/skeleton and associating the WSDL
public Double ConversionRate(String FromCurrency, String ToCurrency) throws Exception
URL endpointURL = new URL(endpoint);
Envelope requestEnv = new Envelope();
Body requestBody = new Body();
Vector requestBodyEntries = new Vector();
String wrappingName = "ConversionRate";
String targetNamespace = "http://www.webserviceX.NET/";
Vector requestData = new Vector();
requestData.add(new Object[] {"FromCurrency", FromCurrency});
requestData.add(new Object[] {"ToCurrency", ToCurrency});
requestBodyEntries.addElement(toElement(wrappingName, targetNamespace, requestData));
requestBody.setBodyEntries(requestBodyEntries);
requestEnv.setBody(requestBody);
Message msg = new Message();
msg.setSOAPTransport(m_httpConnection);
msg.send(endpointURL, "http://www.webserviceX.NET/ConversionRate", requestEnv);
Envelope responseEnv = msg.receiveEnvelope();
Body responseBody = responseEnv.getBody();
Vector responseData = responseBody.getBodyEntries();
return (Double)fromElement((Element)responseData.elementAt(0), java.lang.Double.class);
} -
How to access web service from Oracle ?
Database version: Oracle Database 10g Enterprise Edition Release 10.2.0.3.0
I am trying to make a call to a web service through a procedure/function...
I tried to use
CREATE OR REPLACE PROCEDURE Call_Rest_Webservice
AS
t_Http_Req Utl_Http.Req;
t_Http_Resp Utl_Http.Resp;
t_Request_Body VARCHAR2(30000);
t_Respond VARCHAR2(30000);
t_Start_Pos INTEGER := 1;
t_Output VARCHAR2(2000);
BEGIN
/*Construct the information you want to send to the webservice.
Normally this would be in a xml structure. But for a REST-
webservice this is not mandatory. The webservice i needed to
call excepts plain test.*/
t_Request_Body := 'the data you want to send to the webservice';
/*Telling Oracle where the webservice can be found, what kind of request is made
and the version of the HTTP*/
t_Http_Req := Utl_Http.Begin_Request('**webservice address**',
'GET',
'HTTP/1.1');
/*In my case the webservice used authentication with a username an password
that was provided to me. You can skip this line if it's a public webservice.*/
--Utl_Http.Set_Authentication(t_Http_Req, 'username', 'password');
/*Describe in the request-header what kind of data is send*/
Utl_Http.Set_Header(t_Http_Req, 'Content-Type', 'text/xml charset=UTF-8');
/*Describe in the request-header the lengt of the data*/
Utl_Http.Set_Header(t_Http_Req, 'Content-Length', Length(t_Request_Body));
/*Put the data in de body of the request*/
Utl_Http.Write_Text(t_Http_Req, t_Request_Body);
/*make the actual request to the webservice en catch the responce in a
variable*/
t_Http_Resp := Utl_Http.Get_Response(t_Http_Req);
/*Read the body of the response, so you can find out if the information was
received ok by the webservice.
Go to the documentation of the webservice for what kind of responce you
should expect. In my case it was:
<responce>
<status>ok</status>
</responce>
Utl_Http.Read_Text(t_Http_Resp, t_Respond);
/*Some closing?1 Releasing some memory, i think....*/
Utl_Http.End_Response(t_Http_Resp);
END;But it gave me ORA-29272: HTTP request failed
ORA-06512: at "SYS.UTL_HTTP", line 1029
ORA-12545: Connect failed because target host or object does not exist
But I can link to the web server by going to **webservice address** through my browser.
Is there any ACL should be open in order to have this capability? I asked my DBA but she asked me I will need to give her username/password/ip in order to open an ACL...
however there is no username/password required while visiting the web service...
Any help would be highly appreciated..
Thanks,
Edited by: 986006 on Mar 4, 2013 8:38 AMY.L wrote:
That is because the database was unable to connect to the specified server. Wrong hostname or IP specified. Failure to resolve the hostname into an IP. Firewall blocking. Etc.The hostname I put there can be visit through my browser. I think it should not be the host server's issue... So it could be a firewall on my database side that needs to be open in order to visit the hostserver?The "web browser" code (your PL/SQL code using UTL_HTTP) runs on the Oracle database server. It needs the same type of network access that your browser on your PC enjoys. (firewalls opened, proxy authentication if required, etc).
On 11g. Not on 10g.I saw the example code you post through the link you provided... will those only work on 11g?
If it can work on 10g, what package or what steps I need to follow in order to have that working on me?The code I've posted will work on both versions. My comment was regards to ACLs. No ACLs existed on 10g. So you only need execute privs on the relevant packages (e.g. UTL_HTTP, etc).
ACLs were introduced with 11g - so on 11g you also need the DBA to create an ACL for you that will allow UTL_HTTP access to the network. -
How to call Web Service from Servlet !
Dear All,
I am in dire need to understand how to call a web service from Servlet.
I need to develop a web service which will read LDAP Directory server to retreive information.
How I should call that web service from a Servlet? What Servlet actions do I need to write etc.
I need guidance about design of the above task please.
I would higly appreciate any help and guidance in this regard.
Thanks.
Regards,
WaqarYou can use java.net.URLConnection for that.
-
Calling Web Service From Oracle PL/SQL do not invoke the webservice in SOA Server
Hi ,
Trying to call the webservice from oralce pl/sql Function
created a Function
Not able to invoke the web service of SOA Server .
CREATE OR REPLACE FUNCTION HelloWorld_WebServices(S_STRING Varchar2) RETURN VARCHAR2 AS
service_ sys.utl_dbws.SERVICE;
call_ sys.utl_dbws.CALL;
service_qname sys.utl_dbws.QNAME;
port_qname sys.utl_dbws.QNAME;
response sys.XMLTYPE;
request sys.XMLTYPE;
BEGIN
sys.utl_dbws.set_http_proxy('Host name : Port');
service_qname := sys.utl_dbws.to_qname('ns1', 'process');
service_ := sys.utl_dbws.create_service(service_qname);
call_ := sys.utl_dbws.create_call(service_);
sys.utl_dbws.set_target_endpoint_address(call_, 'http:/host name : port/soa-infra/services/OFS/HelloWorld/helloworld_client_ep');
sys.utl_dbws.set_property( call_, 'OPERATION_STYLE', 'process');
request := sys.XMLTYPE('<ns1:process xmlns:ns1="http://xmlns.oracle.com/OFSOrderServices/HelloWorld/HelloWorld"><ns1:input></ns1:input></ns1:process>');
response := sys.utl_dbws.invoke(call_, request);
return response.extract('//HelloWorld/child::text()', 'http://xmlns.oracle.com/OFSOrderServices/HelloWorld/HelloWorld').getstringval();
DBMS_OUTPUT.PUT_LINE ('Values of OutputsVariables8');
-- Return 'S';
END;
Execute----the below code:
Select HelloWorld_WebServices('Hi') from dual;
Error:
ORA-29532: Java call terminated by uncaught Java exception: java.lang.NoClassDefFoundError
ORA-06512: at "SYS.UTL_DBWS", line 403
ORA-06512: at "SYS.UTL_DBWS", line 400
ORA-06512: at "APPS.HELLOWORLD_WEBSERVICES", line 74
29532. 00000 - "Java call terminated by uncaught Java exception: %s"
*Cause: A Java exception or error was signaled and could not be
resolved by the Java code.
*Action: Modify Java code, if this behavior is not intended.Well, you should first test if your webservice is reachable with a simple WS - Client or a Browser - Plugin, then verify the respones of the web service and after that you can take further investigations on your problem domain. The error - message refers to a line in your function, obviously, but I can't see which line and because there is more than one call to sys.utl_dbws I don't see at what point the script fails. NULL - Pointer - Execptions usually indicate that a method was invoked on a variable which should contain an object reference but is NULL.
-
How to call web services from Acrobat API using VC++
Hi,
I have api plugin which installs custom menu and tool bar to adobe acrobat. In this plugin once user installs this plugin, he need to activate this tool by entering key value. this limites to limited number of users (which is decided by client while buying).
I am using javascript and VC++ with Visual studio 2008.
So can some one suggest me how can i achive this.
Thanks
ShivaFirst, this is the scripting forum. You want the SDK forum.
Second, this isn't an Acrobat issue. It's a C++ programming issue. If you want to connect to a web service you'll need to use the windows or mac socket interface. If you're doing this using MFC then there is a library for internet interactions. If not, I'm sure there is still a library for it, I know there is a system API, you'll just have to look around. But the main point is that it's completely outside the Acrobat SDK.
Thom Parker
The source for PDF Scripting Info
pdfscripting.com
The Acrobat JavaScript Reference, Use it Early and Often
http://www.adobe.com/devnet/acrobat/javascript.html
Then most important JavaScript Development tool in Acrobat
The Console Window (Video tutorial)
The Console Window(article) -
How do i call web services from SAP ABAP
Hello,
Ian working with .net team. they are using sap .net Connector to connect SAP. But my job is In SAP side when Purchase Requisition is created, I have to call web services from ABAP and i have to pass the Purchase Requisition number to web service(.net Program). Please help me how to call web services from ABAP and how to pass value. Any one help me with example.
Thanks
RaviKumarHi Ravi,
If you can call EJB from ABAP and from EJB call Web service which you want to call. I am giving code to write in EJB business method processFunction.
public void processFunction(Function function) {
IRepository repository;
repository = new Repository("TestRepository");
JCO.MetaData fmeta = new JCO.MetaData("ZTEST_EJB");
fmeta.addInfo("REQUTEXT", JCO.TYPE_CHAR, 255, 0, 0,
JCO.IMPORT_PARAMETER, null);
fmeta.addInfo("ECHOTEXT", JCO.TYPE_CHAR, 255, 0, 0,
JCO.EXPORT_PARAMETER, null);
fmeta.addInfo("RESPTEXT", JCO.TYPE_CHAR, 255, 0, 0,
JCO.EXPORT_PARAMETER, null);
repository.addFunctionInterfaceToCache(fmeta);
JCO.ParameterList input =
function.getImportParameterList();
JCO.ParameterList output =
function.getExportParameterList();
JCO.ParameterList tables =
function.getTableParameterList();
if (function.getName().equals("ZTEST_EJB")) {
output.setValue(input.getCharArray("REQUTEXT"),"ECHOTEXT");
output.setValue("This is a response " + table.getString("E_NAME") +" " + output.getName(1), "RESPTEXT");
else if (function.getName().equals("STFC_STRUCTURE")) {
JCO.Structure sin = input.getStructure("IMPORTSTRUCT");
JCO.Structure sout = (JCO.Structure)sin.clone();
try {
System.out.println(sin);
catch (Exception ex) {
System.out.println(ex);
output.setValue(sout,"ECHOSTRUCT");
output.setValue("This is a response from Example5.java","RESPTEXT");
}//if
Here REQUTEXT, ECHOTEXT are import parameter and RESPTEXT is the Export parameter of Function module ZTEST_EJB in SAP.
Here from this bisuness method you can call web service which you want and give back the result of webservice to ABAP F.M.
Regards,
Bhavik
Maybe you are looking for
-
Different currency symbols in report
Hi All! Can anybody show me how to create international reports. I need to show different currency symbols in the same report but for different clients. I try to use set_nls function, but no luck. Any suggestions will be appreciated! It's urgent. Mik
-
hi all, Requirement is to diplay todays date in MM.DD.YYYY format in a smartform layout. We have used the command /:SET DATE MASK = 'MM.DD.YYYY' /:SET COUNTRY 'US' &sy-datum& But the date appears in the user format DD.MM.YYYY. Whys the set date com
-
Why doesn't Editor open either from organizer or on the start screen?
In Elments 11, all worked well after install. Now, weeks later, Editor will not open. Suggestions please! Thanks much
-
Guys, I am trying to run the image capture wizard on a surface tablet running 64 but Windows 8.1 My failure code is 0x00004005 which is happening during the sysprep stage. I have set the values below but I still continue to have this problem. Any i
-
Another form over web thread - please help -
okay, been having trouble with this one and installing/uninstalling oracle software a little too much. I want to make sure I am 100% clear what to do before I continue. Tell me if I have this right: My situation: I want to serve my fmx files down to