Which versions of Oracle can consume web services
Hi there,
We have many versions of Oracle ranging from 7.3.4 to 9.2.0.4 and are looking at them talking to a central app via a web service. Does anybody know whether the following versions can consume a web service
7.3.4
8i
9i has a utl_http package which seems to be the method used in one example I have. This package also exists in 8i but I don't know whether it can be used for web services in that version.
Any help would be much appreciated.
Thx
Gary
Pl define "compatible" and "support up to that version" - if you are planning to use database links, then either version (XE or SE) will suffice. Pl note that XE cannot be patched and that functionality is limited - Oracle® Database Express Edition
Similar Messages
-
Complete newbie question - Can BI consume web services?
Post Author: Steve Lamont
CA Forum: Data Integration
I am working on a new client site working on integration between a whole slew of systems including CRM, billing, BI etc. The client is architecting a SOA oriented approach to all integration where it make sense. As part of the effort, a new BI database is being built and loaded via some ETL tool. The primary interface to access this new BI data will be business objects (BO). Now, in the current environments, there are multiple, disparate BI systems containing various data. The BO knowledge person (and he is not a business object employee) on this site is claiming that to access these other BI databases, he wants to do it by sending out requests via service calls. I fully understand that BO itself can be set up to be a service provider and provide services for other consumers to take advantage of, but how does BO itself consume services provided by other applications?
Obviously I don't fully understand BO, but my initial inclination is that this approach is wrong. If data is required from these other BI source, wouldn't they be configured as data sources within business objects? This BO guy claims that calling web services is more efficient that direct peer-to-peer calls via the database drivers.
Can any share some comments on this situation?Post Author: bhofmans
CA Forum: Data Integration
You posted your question to the wrong forum, please try to post it to one of the subforums in "Enterprise Reporting, Query & Analysis".
This forum is about Data Integrator, Business Objects ETL tool.
I'll try to answer your question anyway with my reporting background From what I know, YES we can consume web services in reports (Crystal reports), but for larger volumes of data a direct access to the database would be faster. A webservice approach might make sense if the webservice implements some business logic (semantic layer) which would be easier then to go directly to the tables.
And just for the record : also Data Integrator can consumer web services... -
Can i use flex to consume web services?
I am not a Flex developer and before delving into it I want
to be sure that it satisfies my project requirements. Mainly,
consuming web services. the other part of the project are a bunch
of buttons and graphs that constitute any GUI. so I think Flex can
handle this part as good as Flash.
Currently, I am using flash but my current client insists on
using flex. so my question is: can I develop in Flex whatever I can
develop in flash? or are there limitations?If you are developing applications in Flash, then you will
love Flex. Flex will make you much more productive than Flash for
producing applications of any complexity. You can do at least
"most" of what you can do in Flash, and more. There might be a few
things you can do only in Flash, or more easily in Flex, but your
client has it right. They want Flex and they should want it. Check
out the FB3 help for the WebService, RemoteObject, and HTTPService
components. -
Can a Web Service be Consumed from within JSX
Hi all,
In CS5, can a web service be consumed from within JSX, and if so - how?
TIA,
mlavieKris,
Thanks! Exactly what I needed!
mlavie -
How to consume Web Service with Password digest from PLSQL
We have Oracle 10g (10.2.0.3.0) 64 bit. We have a situation where we need to consume web service whose security header looks like as follow,
<soapenv:Header>
<wsse:Security soapenv:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<wsse:UsernameToken wsu:Id="UsernameToken-50">
<wsse:Username>weblogic</wsse:Username>
<wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest">d2enK45chjBPVvvukbYU6OX56kI=</wsse:Password>
<wsse:Nonce EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">YAhEtLJfp4lzycLd3hZYjQ==</wsse:Nonce>
<wsu:Created>2013-01-22T06:28:38.897Z</wsu:Created>
</wsse:UsernameToken>
</wsse:Security>
</soapenv:Header>
Here we need passowrd digest, Nonce and Timestamp.
How to create password digest from PLSQL? or if any other alternatives available please response soon.I do not see why it will not be possible to do digest authentication with a web server using PL/SQL.
As for the digest password - the web server supplies a token (a nonce) which you need to use for creating the hashed authentication token (the digest password). The URL I posted explains this authentication process.
As for the technical how-to in PL/SQL - as I mentioned, never had to do this (only dealt with Basic and NTLM authentication thus far). But as other auth methods (such as Microsoft's NTLM) can be implemented, I do not see why digest authentication could not.
Suggest you spend some time googling for technical articles/sample code on the subject - and try to find specific PL/SQL related sample code too. -
Error running demo PL/SQL consuming web services
I downloaded and installed the code from:
http://technet.oracle.com/tech/webservices/htdocs/samples/dbwebservice/DBWebServices_PLSQL.html
on Oracle 9i version 2 (on both Windows and Solaris).
But I got the following error running the local time
demo:
ORA-29273: HTTP request failed
ORA-06512: at "SYS.UTL_HTTP", line 1022
ORA-12545: Connect failed because target host or object does not exist
ORA-06512: at "XN.DEMO_SOAP", line 72
ORA-06512: at "XN.TIME_SERVICE", line 13
ORA-06512: at line 2
The error occurs on this line:
http_req := utl_http.begin_request(url, 'POST','HTTP/1.0');
Can anybody tell me what I do wrong? Thanks a lot!
Also, is there any alternative ways to consume web services
using PL/SQL only? Many thanks!
Henry X.Mike,
Thanks so much for your help. I tried your code just now.
Same error:
ORA-30625: method dispatch on NULL SELF argument is disallowed
ORA-06512: at "XN.DEMO_SOAP", line 50
ORA-06512: at "XN.DEMO_SOAP", line 83
ORA-06512: at "XN.TIME_SERVICE", line 27
ORA-06512: at line 7
Let me post the code I am using. Note that
I removed the code for using proxy in time_service.
Henry
-- code for calling the time_service
DECLARE
ZIPCODE VARCHAR2(200);
v_Return VARCHAR2(200);
BEGIN
ZIPCODE := '94065';
v_Return := TIME_SERVICE.GET_LOCAL_TIME(ZIPCODE => ZIPCODE);
DBMS_OUTPUT.PUT_LINE('v_Return = ' || v_Return);
END;
-- code for the package demo_soap
CREATE OR REPLACE PACKAGE demo_soap AS
TYPE request IS RECORD (
method VARCHAR2(256),
namespace VARCHAR2(256),
body VARCHAR2(32767));
TYPE response IS RECORD (
doc xmltype);
FUNCTION new_request(method IN VARCHAR2,
namespace IN VARCHAR2)
RETURN request;
PROCEDURE add_parameter(req IN OUT NOCOPY request,
name IN VARCHAR2,
type IN VARCHAR2,
value IN VARCHAR2);
FUNCTION invoke(req IN OUT NOCOPY request,
url IN VARCHAR2,
action IN VARCHAR2) RETURN response;
FUNCTION get_return_value(resp IN OUT NOCOPY response,
name IN VARCHAR2,
namespace IN VARCHAR2) RETURN VARCHAR2;
END;
CREATE OR REPLACE PACKAGE BODY demo_soap AS
FUNCTION new_request(method IN VARCHAR2,
namespace IN VARCHAR2)
RETURN request AS
req request;
BEGIN
req.method := method;
req.namespace := namespace;
RETURN req;
END;
PROCEDURE add_parameter(req IN OUT NOCOPY request,
name IN VARCHAR2,
type IN VARCHAR2,
value IN VARCHAR2) AS
BEGIN
req.body := req.body ||
'<'||name||' xsi:type="'||type||'">'||value||'</'||name||'>';
END;
PROCEDURE generate_envelope(req IN OUT NOCOPY request,
env IN OUT NOCOPY VARCHAR2) AS
BEGIN
env := '<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/1999/XMLSchema">
<SOAP-ENV:Body><'||req.method||' '||req.namespace||'
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">'||
req.body||'</'||req.method||'></SOAP-ENV:Body></SOAP-ENV:Envelope>';
END;
PROCEDURE show_envelope(env IN VARCHAR2) AS
i pls_integer;
len pls_integer;
BEGIN
i := 1; len := length(env);
WHILE (i <= len) LOOP
dbms_output.put_line(substr(env, i, 60));
i := i + 60;
END LOOP;
END;
PROCEDURE check_fault(resp IN OUT NOCOPY response) AS
fault_node xmltype;
fault_code VARCHAR2(256);
fault_string VARCHAR2(32767);
BEGIN
fault_node := resp.doc.extract('/soap:Fault',
'xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/');
IF (fault_node IS NOT NULL) THEN
fault_code := fault_node.extract('/soap:Fault/faultcode/child::text()',
'xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/').getstringval();
fault_string := fault_node.extract('/soap:Fault/faultstring/child::text()',
'xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/').getstringval();
raise_application_error(-20000, fault_code || ' - ' || fault_string);
END IF;
END;
FUNCTION invoke(req IN OUT NOCOPY request,
url IN VARCHAR2,
action IN VARCHAR2) RETURN response AS
env VARCHAR2(32767);
http_req utl_http.req;
http_resp utl_http.resp;
resp response;
BEGIN
generate_envelope(req, env);
-- show_envelope(env);
http_req := utl_http.begin_request(url, 'POST','HTTP/1.0');
utl_http.set_header(http_req, 'Content-Type', 'text/xml');
utl_http.set_header(http_req, 'Content-Length', length(env));
utl_http.set_header(http_req, 'SOAPAction', action);
utl_http.write_text(http_req, env);
http_resp := utl_http.get_response(http_req);
utl_http.read_text(http_resp, env);
utl_http.end_response(http_resp);
resp.doc := xmltype.createxml(env);
resp.doc := resp.doc.extract('/soap:Envelope/soap:Body/child::node()',
'xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"');
-- show_envelope(resp.doc.getstringval());
check_fault(resp);
RETURN resp;
END;
FUNCTION get_return_value(resp IN OUT NOCOPY response,
name IN VARCHAR2,
namespace IN VARCHAR2) RETURN VARCHAR2 AS
BEGIN
RETURN resp.doc.extract('//'||name||'/child::text()',
namespace).getstringval();
END;
END;
-- code for the package time_service
CREATE OR REPLACE PACKAGE time_service AS
FUNCTION get_local_time(zipcode IN VARCHAR2) RETURN VARCHAR2;
END;
CREATE OR REPLACE PACKAGE BODY time_service AS
-- Location of Web service definition
-- http://www.alethea.net/webservices/LocalTime.asmx?WSDL
FUNCTION get_local_time(zipcode IN VARCHAR2) RETURN VARCHAR2 IS
req demo_soap.request;
resp demo_soap.response;
BEGIN
req := demo_soap.new_request('LocalTimeByZipCode',
'xmlns="http://www.alethea.net/webservices/"');
demo_soap.add_parameter(req, 'ZipCode', 'xsd:string', zipcode);
resp := demo_soap.invoke(req,
'http://www.alethea.net/webservices/LocalTime.asmx',
'http://www.alethea.net/webservices/LocalTimeByZipCode');
RETURN demo_soap.get_return_value(resp, 'LocalTimeByZipCodeResult',
'xmlns="http://www.alethea.net/webservices/"');
END;
END; -
Best practice for consuming web services
Hi
we are consuming web service in orchestration by "Add Generated Item".By using this option it creates 1 orch,1xsd file and some bindings.
we have different projects for schemas,maps and orchestration under our solution in visual studio.
Now i need to know that what will be the best practice for consuming web service in orchestration i mean in which project should i use "add generated item" (in orchstration project or in schemas project) coz it generates both 1 orch and 1
schema.
thanksFrom a service orientation perspective you should abstract the service artifacts from the other artifacts. Otherwise it will be very difficult to update the service interface without affecting the other artifacts. For example you don't want to have to redeply
your entire application if only one field changes in the service you consume.
So I typically generate the items, remove the unnecessary stuff, and put them in a separate project.
Depending on the control you have over the services you want to consume, it would even be better to create another layer of abstraction. By that I mean create your own interface (schema) and map that one to the one the service exposes. This basically
is only necessary if you consume external services that are beyond your control. By abstracting the interface it exposes, you limit the impact of changes of that interface on the rest of your system. All changes are abstracted behind your own interface.
If you consume internal services, you can probably control the way the interface is defined. In a service oriented world all internal services expose a well known interface, based on the domain objects you have within your organisation.
Jean-Paul Smit | Didago IT Consultancy
Blog |
Twitter | LinkedIn
MCTS BizTalk 2006/2010 + Certified SOA Architect
Please indicate "Mark as Answer" if this post has answered the question. -
Consuming Web Services with ABAP - WSDL
Hi All,
I Want to consume web service in abap, i found lot of documents,Here i am having data in the internal table i need to pass
it to wsdl file, The Web Service or Proxy generates a WSDL file. So this WSDL file can be consumed on ABAP Front and Encrypt the Data that is to be sent to the Banks.
I found the input and output, Where i can find the method generated or we need to create it
CALL METHOD io_clientproxy->XXXXXXXXXXXX
please let me have your valuable ideas
Thanks in advance,
Arun.Hi Miguel,
I have not heared about SPROXY, Here i found some code,which calls a web service method and where it is from.
when i double click on my proxy it shows me some method.IF_PROXY_BASIS_INTERNAL~CREATE_FRAMEWORK
this is the one web service method. and i meed to pass the internal table data to WSDL file.
*-- create web service proxy class instance
TRY.
CREATE OBJECT io_clientproxy
EXPORTING
logical_port_name = 'LP4'.
CATCH cx_ai_system_fault.
ENDTRY.
*-- call web service methods
TRY.
CALL METHOD io_clientproxy->get_airport_information_by_is
EXPORTING
input = input
IMPORTING
output = output.
CATCH cx_ai_system_fault.
CATCH cx_ai_application_fault.
ENDTRY.
*-- text processing
output_string = output-get_airport_information_by_is.
REPLACE ALL OCCURRENCES OF
'<' IN output_string WITH '<' .
REPLACE ALL OCCURRENCES OF
'>' IN output_string WITH '>' .
REPLACE ALL OCCURRENCES OF
'xmlns=' IN output_string WITH 'xmlns:xsl=' .
*-- parsing
TRY .
CALL TRANSFORMATION ('Y_AIRPORT_XML2ABAP')
SOURCE XML output_string
RESULT outtab = outtab.
CATCH cx_xslt_exception INTO xslt_err.
DATA: s TYPE string.
s = xslt_err->get_text( ).
WRITE: ': ', s.
STOP.
ENDTRY .
Regards,
Arun. -
Problem at Consume WEB Service in ABAP
hello!!
I tell them my problem, is to create a web service from the SE80, which could be used properly.
Then there was a change of server, which migrated to the developments and the web service is recreation, but this can not be consumed.
now I need help, is where do I indicate that the basis so that they can return to consume web services, what services or settings should be activated.
any suggestion or help are welcome.
The ECC system is a 5 AS ABAP only.
from now, I appreciate any help or guidance I can get.What is the problem? Are all the services active in SICF for web services and how is the web service being consumed is it through a wsdl file ?
-
How can a web service be compliant with the WTK2.1?
I'm using WTK2.1 to develop mobile clients consuming web services.
After published a web service by Apache Axis, I use WTK2.1's Stub Generator to
generate the stub class.
As required by JSR172, I use the "document/literal" encoding style.
The web service class has only one method:
public int newUser(String userName, String password) {
But when I use Stub Generator to generator the stub class, I get the following messages:
************************ Error messages begin *****************************
warning: R2716 WSI-BasicProfile ver. 1.0, namespace attribute not allowed in doc/lit for soapbind:body: "newUser"
warning: R2716 WSI-BasicProfile ver. 1.0, namespace attribute not allowed in doc/lit for soapbind:body: "newUser"
warning: ignoring operation "newUser": more than one part in input message
warning: Port "User" does not contain any usable operations
************************ Error messages end *****************************
And following is the wsdl file:
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions targetNamespace="http://localhost:8080/web/services/User" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://localhost:8080/web/services/User" xmlns:intf="http://localhost:8080/web/services/User" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns1="http://ws.mauction.scucdut.edu.cn" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><wsdl:types><schema targetNamespace="http://ws.mauction.scucdut.edu.cn" xmlns="http://www.w3.org/2001/XMLSchema"><element name="userName" type="xsd:string"/><element name="password" type="xsd:string"/></schema><schema targetNamespace="http://localhost:8080/web/services/User" xmlns="http://www.w3.org/2001/XMLSchema"><element name="newUserReturn" type="xsd:int"/></schema></wsdl:types>
<wsdl:message name="newUserRequest">
<wsdl:part element="tns1:userName" name="userName"/>
<wsdl:part element="tns1:password" name="password"/>
</wsdl:message>
<wsdl:message name="newUserResponse">
<wsdl:part element="impl:newUserReturn" name="newUserReturn"/>
</wsdl:message>
<wsdl:portType name="User">
<wsdl:operation name="newUser" parameterOrder="userName password">
<wsdl:input message="impl:newUserRequest" name="newUserRequest"/>
<wsdl:output message="impl:newUserResponse" name="newUserResponse"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="UserSoapBinding" type="impl:User">
<wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="newUser">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="newUserRequest">
<wsdlsoap:body namespace="http://ws.mauction.scucdut.edu.cn" use="literal"/>
</wsdl:input>
<wsdl:output name="newUserResponse">
<wsdlsoap:body namespace="http://localhost:8080/web/services/User" use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="UserService">
<wsdl:port binding="impl:UserSoapBinding" name="User">
<wsdlsoap:address location="http://localhost:8080/web/services/User"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
So, can anybody tell me how to make the web service be used by the Stub Generator properly?Hi,
I am new to WTK 2.1 and I am also using Axis to generate WSDL.
one thing I figured out was to remove the namespace info behind all body tags.
for instance in your code, replace:
<wsdlsoap:body namespace="http://localhost:8080/web/services/User" use="literal"/>
by
<wsdlsoap:body use="literal"/>
and it should work. don't ask me why but it worked for me. -
Biztalk 2010 - Consume Web Service with Certificate
Hi
I have to consume a java web service with Biztalk that requires authentication via a client certificate. Until now I have not been able to consume any web service where any kind of authentication was needed. Simple web services without authentication are
no problem. Also using SoapUI works perfectly fine.
I am generating the XSDs and the port binding with the WCF wizard in VS2010. I've read several comments that it's not possible to consume web services with the WCF-WSHttp adapter when the message format should be SOAP 1.1. Therefore I'm trying with the WCF-BasicHttp
and WCF-Custom adapters, but I did not suceed in receiving a positive response yet.
The web service I want to consume uses a client certificate (with a private key) and two root certificates. When I use the BasicHttp adapter I choose either 'Transport' or 'TransportWithMessageCredential' but none of them work. I also have to supply a client
and a service certificate. I always use the one with the private key for the client but I'm not sure which one I have to use for the service. Is there a possibility that I have to provide both root certificates and if so, how can I achieve this?
Hope the question makes sense somehow... thanks for any input.
Error message that I receive currently is that the server needs a client certificate. However I attached it in the send port properties under the tab "Security" => mode "TransportWithMessageCredential".Adapter: WCF-Custom
Binding: customBinding
Cannot send pictures (yet).
<configuration>
<enterpriseLibrary.ConfigurationSource selectedSource="ESB File Configuration Source" />
<system.serviceModel>
<client>
<endpoint address="...." behaviorConfiguration="EndpointBehavior" binding="customBinding" bindingConfiguration="ReceiptBinding" contract="BizTalk" name="WebServicePort" />
</client>
<behaviors>
<endpointBehaviors>
<behavior name="EndpointBehavior">
<clientCredentials>
<clientCertificate findValue="..." x509FindType="FindByThumbprint" />
<serviceCertificate>
<defaultCertificate findValue="..." storeLocation="LocalMachine" storeName="AuthRoot" x509FindType="FindByThumbprint" />
</serviceCertificate>
</clientCredentials>
</behavior>
</endpointBehaviors>
<serviceBehaviors>
<behavior name="ServiceBehavior" />
</serviceBehaviors>
</behaviors>
<bindings>
<customBinding>
<clear />
<binding name="ReceiptBinding">
<textMessageEncoding messageVersion="Soap11" />
<security authenticationMode="MutualCertificate" />
<httpsTransport proxyAuthenticationScheme="Basic" requireClientCertificate="true" />
</binding>
</customBinding>
</bindings>
</system.serviceModel>
</configuration> -
Consuming Web Services in 11.2 does not work (UTL_DBWS)
Hello
i read some documents for consuming web services on the internet , but i get an error when i call add_numbers function as follows:
i connected on WSUSER , then
SQL> select add_numbers(1,3) from dual;
The Error message is:
ERROR at line 1:
ORA-29532: Java call terminated by uncaught Java exception:
java.lang.IllegalAccessException: java.lang.ExceptionInInitializerError
ORA-06512: at "WSUSER.UTL_DBWS", line 193
ORA-06512: at "WSUSER.UTL_DBWS", line 190
ORA-06512: at "WSUSER.ADD_NUMBERS", line 25"
I use the following steps to setup the UTL_DBWS :
1- Create new user 'WSUSER'
2- Run the UTL_DBWS scripts ( utl_dbws_decl.sql , utl_dbws_body.sql) on WSUSER.
3- Execute this command
loadjava -u scott/tiger -r -v -f -genmissing dbwsclientws.jar dbwsclientdb11.jar
4- Log in as sys and grant these privileges to our new user:
execute dbms_java.grant_permission('WSUSER','SYS:java.util.PropertyPermission','http.proxySet','write');
execute dbms_java.grant_permission('WSUSER','SYS:java.util.PropertyPermission','http.proxyHost', 'write');
execute dbms_java.grant_permission('WSUSER','SYS:java.util.PropertyPermission','http.proxyPort', 'write');
execute dbms_java.grant_permission('WSUSER','SYS:java.lang.RuntimePermission', 'accessClassInPackage.sun.util.calendar','');
execute dbms_java.grant_permission('WSUSER','SYS:java.lang.RuntimePermission','getClassLoader','');
execute dbms_java.grant_permission('WSUSER','SYS:java.net.SocketPermission','*','connect,resolve');
execute dbms_java.grant_permission('WSUSER','SYS:java.util.PropertyPermission','*','read,write');
execute dbms_java.grant_permission('WSUSER','SYS:java.lang.RuntimePermission','setFactory','');
execute dbms_java.grant_permission('WSUSER','SYS:java.lang.RuntimePermission', 'createClassLoader', '' )
5- Create add_numbers function on wsuser to test utl_dbws:
CREATE OR REPLACE FUNCTION add_numbers (p_int_1 IN NUMBER,
p_int_2 IN NUMBER)
RETURN NUMBER
AS
l_service UTL_DBWS.service;
l_call UTL_DBWS.call;
l_wsdl_url VARCHAR2(32767);
l_namespace VARCHAR2(32767);
l_service_qname UTL_DBWS.qname;
l_port_qname UTL_DBWS.qname;
l_operation_qname UTL_DBWS.qname;
l_xmltype_in SYS.XMLTYPE;
l_xmltype_out SYS.XMLTYPE;
l_return NUMBER;
BEGIN
l_wsdl_url := 'http://www.oracle-base.com/webservices/server.php?wsdl';
l_namespace := 'http://www.oracle-base.com/webservices/';
l_service_qname := UTL_DBWS.to_qname(l_namespace, 'Calculator');
l_port_qname := UTL_DBWS.to_qname(l_namespace, 'CalculatorPort');
l_operation_qname := UTL_DBWS.to_qname(l_namespace, 'ws_add');
l_service := UTL_DBWS.create_service (
wsdl_document_location => URIFACTORY.getURI(l_wsdl_url),
service_name => l_service_qname);
l_call := UTL_DBWS.create_call (
service_handle => l_service,
port_name => l_port_qname,
operation_name => l_operation_qname);
l_xmltype_in := SYS.XMLTYPE('<?xml version="1.0" encoding="utf-8"?>
<ws_add xmlns="' || l_namespace || '">
<int1>' || p_int_1 || '</int1>
<int2>' || p_int_2 || '</int2>
</ws_add>');
l_xmltype_out := UTL_DBWS.invoke(call_Handle => l_call,
request => l_xmltype_in);
UTL_DBWS.release_call (call_handle => l_call);
UTL_DBWS.release_service (service_handle => l_service);
l_return := l_xmltype_out.extract('//return/text()').getNumberVal();
RETURN l_return;
END;
6- Test the function
Select add_numbers(1,2) from dual
on the test i get the error message :
ERROR at line 1:
ORA-29532: Java call terminated by uncaught Java exception:
java.lang.IllegalAccessException: java.lang.ExceptionInInitializerError
ORA-06512: at "WSUSER.UTL_DBWS", line 193
ORA-06512: at "WSUSER.UTL_DBWS", line 190
ORA-06512: at "WSUSER.ADD_NUMBERS", line 25
anyone have an idea to resolve this error .
thanks alotHi.
Looking at the code, it seems it is my article you are asking about.
http://www.oracle-base.com/articles/10g/utl_dbws10g.php
I've just run through it on an 11.2 instance and it works fine for me.
Make sure your server has access to the Internet and make sure the java classes are loaded successfully.
Cheers
Tim... -
How to consume web service in Agentry in SMP 3.0
Dear All , I am using web service in Agentry to retrive data but could not able to fetch it . I have made connection with HTTP-XML for consuming webservices. and also give proper information in Agentry.ini files Ex : [HTTPXML-2] name=HTTP-XML Back End authenticationCertificateStore=MY authenticationCertificateStorePassword= authenticationCertificateStorePasswordEncoded=false autoDequote=true ;baseURL=http://localhost:81 baseURL=http://sapes1.sapdevcenter.com:8080/sap/opu/odata/iwbep/gwdemo/ basicAuthenticationPassword=123456 basicAuthenticationPasswordEncoded=false basicAuthenticationUserID=P1466405733 constantsFile=httpxml_sd.ini enableAuthentication=false enablePreviousUserAuthentication=false httpConnectTimeout=300 httpReceiveTimeout=300 httpResolveTimeout=300 httpSendTimeout=300 listenOn= timeout=300 timeZoneName= useSSL=false xmlAllowXSLTScript=true xmlNamespaces= xmlResolveExternals=true xmlValidateOnParse=true for more information i have attached agentry XML screen shot as well . Can you please guide me how to consume web services in Agentry correct way ? Note : Currently i am using standard netweaver demo web services . Thanks & Regards , Kunal Varaiya
Tags edited by: Michael ApplebyThe XML Steps URL will be added to the Agentry.ini BaseURL. So you dont' need the full URL on the step.
So when Agentry Runs the step to call the backend it will go:
<BaseURL>/<Step's URL>
This way if you need to change the base URL, IE, going from Dev to QA to Production Server you only need to change the Base, and not go into every step and update it.
URL: This attribute contains the URL to which the Agentry Server will make a request. This value will be appended to the value configured as the base URL for the HTTP-XML system connection. This base URL is configured within the HTTP-XML system connection configuration options for the Agentry Server. Proper use of both this base URL option and the URL entered in the requests of the step definitions can support portability for the application, with the base URL being the implementation-specific portion and the step’s URL being the portion not likely to change for the same back end system from one implementation to the next.
http://help.sap.com/saphelp_smp303sdk/helpdata/en/7c/143d5d70061014b323be16eb0b0a77/frameset.htm
Stephen -
Creating and consuming web service
Hello Everyone,
Please help me in creating a webservice which can be consumed in a button in Excel sheet i.e. I have to create a button in Excel sheet and on click of that button i have to consume a web service deployed in AS. Also I have to pass the data in Excel sheet to that web service.
PS: This is just a business logic no other view or UI is required here.
Thanks in advance.
Regards
PranavHi Pranav
>2. I know I can download WSDL files from server using the test page. Downloaded zip file has these three wsdl files Config1_document.wsdl, Config1_TestVi_document.wsdl and main.wsdl. But which wsdl to use while consuming.
Actually all the .wsdl files are part of single WSDL document which describes your Web service. Starting/root point here is main.wsdl which references two other .wsdl. You can access any time the root WSDL part by URL like
"http://<host>:<port>/BcfRemoteCheck/Config1?wsdl&style=document&mode=standard".
Hope you know where to see the WSDL URL (in Webservice Navigator or in Single Service Administration where you downloaded the ZIP).
When you are consuming web-service you need all the parts. Usually when a Web-service is consumed the remote WSDL is used for generation of WS Client Proxy. But, the WSDL files can be also downloaded and used locally for generation of the WS Client Proxy.
Sometimes the WSDL is not necessary at all for WS consuming on run-time. In the case it's used only on design-time just to know WS names, ports, operations, etc, for writing the code of WS Client.
BR, Sergei -
Hi All,
I am looking for some advice in regards to consuming web services via UCCX scripting. In the past i have been doing so successfully in our environment by using document steps and Xpath expressions for both SOAP and REST web services that were configured to allow an HTTP GET request (tomcat running on apache server to expose public methods written in Java).
Our company is in the midst of a Microsoft Dynamics 2012 (r2) implementation and I have the task of establishing communication with AX in order to pass information back and forth. Our consultants with dynamics have setup a test web service using AIF, but it seems that these services require authentication. Currently the test web service is using NTLM authentication and exposed via SOAP. Apparently it is not possible to use HTTP GET for these web services.
This means i had to write java code in Set steps to communicate with the SOAP services. I was able to successfully do this for some of our own web services using SOAP. however i am having problems with the AX test web service due to the authentication. (Thanks to Gergely Szabo, as i used some of his code found here: https://supportforums.cisco.com/document/97736/uccx-8x-really-simple-soap-client-no-custom-jar )
I am hoping someone has some experience with having consumed AIF web services via Java or at least Java written within a UCCX script. Or if someone has been able to implement authentication and can provide some details for how that works? I don't even know if i can authenticate via NTLM from UCCX scripts due to it being a windows authentication protocol and not linux based.
Any thoughts or ideas would be appreciated!
Thanks,
Kevin.Hi,
Thus far I have been unsuccessful in my attempts to communicate with this particular web service. The consults did create another service using Basic HTTP Auth and I was able to consume and use the service using SOAPUI just fine.
However, my soapResponseString code (small tweak of Gergely's code) is not working. After 2-3 minutes of sitting on that step in the CRS Editor my stacktrace exception is thrown and shows "Connection timed out". This is way past the time for the 5000ms read timeout, so I imagine the initial communication is successful but then eventually times out due to not returning a response?
I tried to mimic the headers SOAPUI uses from it's HTTP Log, hence the number of urlCon.setRequestProperty lines..
CODE for Set soapResponseString below:
// create a ByteArrayOutputStream - this is actually a buffer
// we are going to use to store the response coming from the SOAP server
java.io.ByteArrayOutputStream baos = new java.io.ByteArrayOutputStream();
// this is quite unnecessary: assigning the value of the soapRequest (still holding our XML document)
// to another variable, named content, type String; but anyway, it's just cleaner
String content = soapRequest;
// specify a timeout - 5000 milliseconds - if the web server does not start sending back
// anything within this timeframe, an exception will be raised
int readTimeout = 5000;
try {
// a new URL, which is the soapServiceEndpoint variable value (http://ip:port/ etc):
java.net.URL url = new java.net.URL(soapServiceEndpoint);
// creating a HTTP connection to the above URL:
java.net.HttpURLConnection urlCon = (java.net.HttpURLConnection) url.openConnection();
// setting some important header parameters, first of all, content length, this is most likely expected
// by the SOAP server
urlCon.setFixedLengthStreamingMode(content.length());
// setting the timeout:
urlCon.setReadTimeout(readTimeout);
// we tell Java we will do input (in other words, we will read):
urlCon.setDoInput (true);
// we tell Java we will do output (in other words, we will send):
urlCon.setDoOutput (true);
// we tell Java not to cache:
urlCon.setUseCaches (false);
// we are using HTTP POST
urlCon.setRequestMethod("POST");
// finally, we set the Content-Type header,
// this way we are telling the SOAP server we are sending an XML, using the UTF-8 charset
urlCon.setRequestProperty("Content-Type","text/xml;charset=UTF-8");
// here we are sending our Basic Auth - authStringEnc is a base64 encoded user:pass credential that's initialized in a previous step
urlCon.setRequestProperty("Authorization","Basic " + authStringEnc);
//set some other header information for the request required by the AIF Web Service
urlCon.setRequestProperty("SOAPAction","http://tempuri.org/myService/getSiteId");
urlCon.setRequestProperty("Host", "myServer.myDomain.com:8080");
urlCon.setRequestProperty("Connection","Keep-Alive");
urlCon.setRequestProperty("User-Agent","Java/1.6.0_29");
urlCon.setRequestProperty("Accept-Encoding","gzip,deflate");
// opening an OutputStream (this is a one-way channel towards the SOAP server:
java.io.DataOutputStream output = new java.io.DataOutputStream(urlCon.getOutputStream());
// we write the contents of the content variable (= soapRequest = XML document):
output.writeBytes(content);
// telling Java to flush "speed up!" and then close the stream:
output.flush();
output.close();
// now getting the InputStream (getting a one way channel coming from the SOAP server):
java.io.DataInputStream input = new java.io.DataInputStream(urlCon.getInputStream());
// buffered read from the InputStream, buffer size 4Kilobytes (= 4096 bytes):
// and the buffer is always written to the other buffer, named baos, that we specified
// on the first line of this block of code
int bufSize = 4096; // buffer size, bytes
byte[] bytesRead = new byte[bufSize];
int bytesReadLength = 0;
while(( bytesReadLength = input.read( bytesRead )) > 0 ) {
baos.write(bytesRead,0,bytesReadLength);
} //while block ends here
// closing the InputStream:
input.close();
// closing the baos buffer
baos.close();
} catch (Exception e) {
// again, if an error occurs, let's just send the stack trace to stdout (stdout.log)
// and then return null or can we can return e.getMessage() to see the exception caught inside the script
e.printStackTrace();
return e.getMessage();
//return null;
} // try..catch block ends here
// construct a new String, and return that to the CRS script:
return new String(baos.toByteArray());
} // closure ends here
Maybe you are looking for
-
SQL 2014 Exp Wont Install Win 8.1
Hello All, Im really struggling to install SQL 2014 express on my windows 8.1 SL pc. x64 i installed SQL 2008 first but when i tried to install the studio management, it refused to work. so i redownloaded the latest setups. ive tried both 32bit and
-
I have changed my apple id, and its ok when i sync my Iphone with Itunes, but ON my Iphone still my old apple-ID is there. I can NOT buy things from Itunes or Upgrade anything now, how to fix this?
-
Steps to setup Direct Production in SAP
Hello gurus. Could someone post a link to a guide; or the steps to setting up Direct Production in a Plant? We have a final assembly that has a multilevel BOM; what we want is to create one production order for the final assembly and have the product
-
Hi - I'm creating a positive pay file for my client (they are on Oracle Applications version 11.5.10.2), all has been successful with altering APXPOPAY, I've set this up under a custom directory and as a custom concurrent program. Users can submit th
-
How to set up multi-page brochure? Please help :(
Hi All I'm fairly new to InDesign and am struggling to set up a 6-page brochure - so either a roll fold or z-fold layout with 3 pages each side, similar to this. I can set up a 6 page A5 document, but, to help me when developing the design,rather tha