How to perform authentication on proxy using utl_http package?
Hi,
I am using Oracle 8i database (ver:8.1.7). I want to use the utl_http package to perform http requests. Within my company, I am forced to use a proxy and I have to be authenticated on that proxy. How can I authenticate myself on the proxy using utl_http.request function on Oracle 8i?
Thanks a lot.
Paulo.
UTL_HTTP
The UTL_HTTP package makes Hypertext Transfer Protocol (HTTP) callouts from SQL and PL/SQL. You can use it to access data on the Internet over HTTP.
With UTL_HTTP, you can write PL/SQL programs that communicate with Web (HTTP) servers. UTL_HTTP also contains a function that can be used in SQL queries. The package also supports HTTP over the Secured Socket Layer protocol (SSL), also known as HTTPS, directly or through an HTTP proxy. Other Internet-related data-access protocols (such as the File Transfer Protocol (FTP) or the Gopher protocol) are also supported using an HTTP proxy server that supports those protocols.
When the package fetches data from a Web site using HTTPS, it requires Oracle Wallet Manager to set up an Oracle wallet. Non-HTTPS fetches do not require an Oracle wallet.
See Also:
Chapter 102, "UTL_URL"
Chapter 100, "UTL_SMTP"
Oracle Advanced Security Administrator's Guide for more information on Wallet Manager
This chapter discusses the following topics:
UTL_HTTP Constants, Types and Flow
UTL_HTTP Exceptions
UTL_HTTP Examples
Summary of UTL_HTTP Subprograms
http://download-west.oracle.com/docs/cd/B10501_01/appdev.920/a96612/u_http.htm#ARPLS070
Joel P�rez
Similar Messages
-
How To Perform Lot Split Transactions Using Transaction Open Interface (MTI)
Can anyone give me some guidance on how to perform lot split transaction using MTI?
I am using the following code:
DECLARE
l_transaction_type_id NUMBER := 83;
l_transaction_action_id NUMBER := 41;
l_transaction_source_type_id NUMBER := 13;
l_org_id NUMBER := 1884;
l_txn_header_id NUMBER;
l_txn_if_id1 NUMBER;
l_txn_if_id2 NUMBER;
l_txn_if_id3 NUMBER;
l_parent_id NUMBER;
l_sysdate DATE;
l_item_id NUMBER :=287996;
l_user_id NUMBER;
l_distribution_account_id NUMBER;
l_exp_date DATE;
BEGIN
--For Lot Merge, there should be only one resultant lot.
--The transaction_quantity populated in MTI/MTLI should be the entire
--quantity that is available to transact for the org/sub/item/locator/LPN in
--that particular lot number.
--Get transaction_header_id for all the MTIs
SELECT APPS.mtl_material_transactions_s.NEXTVAL
INTO l_txn_header_id
FROM sys.dual;
--Get transaction_interface_id of resultant record
SELECT APPS.mtl_material_transactions_s.NEXTVAL
INTO l_txn_if_id1
FROM sys.dual;
l_parent_id := l_txn_if_id1;
l_sysdate := SYSDATE;
l_user_id := -1; --substitute with a valid user_id
l_distribution_account_id := NULL; --needed for lot translate
l_exp_date := NULL; --set if required
--Populate the MTI record for resultant record
INSERT INTO MTL_TRANSACTIONS_INTERFACE
transaction_interface_id,
transaction_header_id,
Source_Code,
Source_Line_Id,
Source_Header_Id,
Process_flag,
Transaction_Mode,
Lock_Flag,
Inventory_Item_Id,
revision,
Organization_id,
Subinventory_Code,
Locator_Id,
Transaction_Type_Id,
Transaction_Source_Type_Id,
Transaction_Action_Id,
Transaction_Quantity,
Transaction_UOM,
Primary_Quantity,
Transaction_Date,
Last_Update_Date,
Last_Updated_By,
Creation_Date,
Created_By,
distribution_account_id,
parent_id,
transaction_batch_id,
transaction_batch_seq,
lpn_id,
transfer_lpn_id
VALUES
l_txn_if_id1, --transaction_header_id
l_txn_header_id, --transaction_interface_id
'INV', --source_code
-1, --source_header_id
-1, --source_line_id
1, --process_flag
3, --transaction_mode
2, --lock_flag
l_item_id, --inventory_item_id
null, --revision
l_org_id, --organization_id
'EACH', --subinventory_code
1198, --locator_id
l_transaction_type_id, --transaction_type_id
l_transaction_source_type_id, --transaction_source_type_id
l_transaction_action_Id, --l_transaction_action_id
100000, --transaction_quantity
'EA', --transaction_uom
100000, --primary_quantity
l_sysdate, --Transaction_Date
l_sysdate, --Last_Update_Date
l_user_id, --Last_Updated_by
l_sysdate, --Creation_Date
l_user_id, --Created_by
l_distribution_account_id, --distribution_account_id
l_parent_id, --parent_id
l_txn_header_id, --transaction_batch_id
2, --transaction_batch_seq
NULL, --lpn_id (for source MTI)
NULL --transfer_lpn_id (for resultant MTIs)
--Insert MTLI corresponding to the resultant MTI record
INSERT INTO MTL_TRANSACTION_LOTS_INTERFACE(
transaction_interface_id
, Source_Code
, Source_Line_Id
, Process_Flag
, Last_Update_Date
, Last_Updated_By
, Creation_Date
, Created_By
, Lot_Number
, lot_expiration_date
, Transaction_Quantity
, Primary_Quantity
VALUES (
l_txn_if_id1 --transaction_interface_id
, 'INV' --Source_Code
, -1 --Source_Line_Id
, 'Y' --Process_Flag
, l_sysdate --Last_Update_Date
, l_user_id --Last_Updated_by
, l_sysdate --Creation_date
, l_user_id --Created_By
, 'Q0000.1' --Lot_Number
, l_exp_date --Lot_Expiration_Date
, 100000 --transaction_quantity
, 100000 --primary_quantity
INSERT INTO MTL_TRANSACTIONS_INTERFACE
transaction_interface_id,
transaction_header_id,
Source_Code,
Source_Line_Id,
Source_Header_Id,
Process_flag,
Transaction_Mode,
Lock_Flag,
Inventory_Item_Id,
revision,
Organization_id,
Subinventory_Code,
Locator_Id,
Transaction_Type_Id,
Transaction_Source_Type_Id,
Transaction_Action_Id,
Transaction_Quantity,
Transaction_UOM,
Primary_Quantity,
Transaction_Date,
Last_Update_Date,
Last_Updated_By,
Creation_Date,
Created_By,
distribution_account_id,
parent_id,
transaction_batch_id,
transaction_batch_seq,
lpn_id,
transfer_lpn_id
VALUES
l_txn_if_id1, --transaction_header_id
l_txn_header_id, --transaction_interface_id
'INV', --source_code
-1, --source_header_id
-1, --source_line_id
1, --process_flag
3, --transaction_mode
2, --lock_flag
l_item_id, --inventory_item_id
null, --revision
l_org_id, --organization_id
'EACH', --subinventory_code
1198, --locator_id
l_transaction_type_id, --transaction_type_id
l_transaction_source_type_id, --transaction_source_type_id
l_transaction_action_Id, --l_transaction_action_id
100000, --transaction_quantity
'EA', --transaction_uom
100000, --primary_quantity
l_sysdate, --Transaction_Date
l_sysdate, --Last_Update_Date
l_user_id, --Last_Updated_by
l_sysdate, --Creation_Date
l_user_id, --Created_by
l_distribution_account_id, --distribution_account_id
l_parent_id, --parent_id
l_txn_header_id, --transaction_batch_id
3, --transaction_batch_seq
NULL, --lpn_id (for source MTI)
NULL --transfer_lpn_id (for resultant MTIs)
--Insert MTLI corresponding to the resultant MTI record
INSERT INTO MTL_TRANSACTION_LOTS_INTERFACE(
transaction_interface_id
, Source_Code
, Source_Line_Id
, Process_Flag
, Last_Update_Date
, Last_Updated_By
, Creation_Date
, Created_By
, Lot_Number
, lot_expiration_date
, Transaction_Quantity
, Primary_Quantity
VALUES (
l_txn_if_id1 --transaction_interface_id
, 'INV' --Source_Code
, -1 --Source_Line_Id
, 'Y' --Process_Flag
, l_sysdate --Last_Update_Date
, l_user_id --Last_Updated_by
, l_sysdate --Creation_date
, l_user_id --Created_By
, 'Q0000.1' --Lot_Number
, l_exp_date --Lot_Expiration_Date
, 100000 --transaction_quantity
, 100000 --primary_quantity
--Get transaction_interface_id of Source record-1
SELECT APPS.mtl_material_transactions_s.NEXTVAL
INTO l_txn_if_id2
FROM sys.dual;
--Populate the MTI record for Source record-1
INSERT INTO MTL_TRANSACTIONS_INTERFACE
transaction_interface_id,
transaction_header_id,
Source_Code,
Source_Line_Id,
Source_Header_Id,
Process_flag,
Transaction_Mode,
Lock_Flag,
Inventory_Item_Id,
revision,
Organization_id,
Subinventory_Code,
Locator_Id,
Transaction_Type_Id,
Transaction_Source_Type_Id,
Transaction_Action_Id,
Transaction_Quantity,
Transaction_UOM,
Primary_Quantity,
Transaction_Date,
Last_Update_Date,
Last_Updated_By,
Creation_Date,
Created_By,
distribution_account_id,
parent_id,
transaction_batch_id,
transaction_batch_seq,
lpn_id,
transfer_lpn_id
VALUES
l_txn_if_id2, --transaction_header_id
l_txn_header_id, --transaction_interface_id
'INV', --source_code
-1, --source_header_id
-1, --source_line_id
1, --process_flag
3, --transaction_mode
2, --lock_flag
l_item_id, --inventory_item_id
null, --revision
l_org_id, --organization_id
'EACH', --subinventory_code
1198, --locator_id
l_transaction_type_id, --transaction_type_id
l_transaction_source_type_id, --transaction_source_type_id
l_transaction_action_Id, --transaction_action_id
-200000, --transaction_quantity
'EA', --transaction_uom
-200000, --primary_quantity
l_sysdate, --Transaction_Date
l_sysdate, --Last_Update_Date
l_user_id, --Last_Updated_by
l_sysdate, --Creation_Date
l_user_id, --Created_by
l_distribution_account_id, --distribution_account_id
l_parent_id, --parent_id
l_txn_header_id, --transaction_batch_id
1, --transaction_batch_seq
NULL, --lpn_id (for source MTI)
NULL --transfer_lpn_id (for resultant MTIs)
--Insert MTLI corresponding to the Source record-1
INSERT INTO MTL_TRANSACTION_LOTS_INTERFACE(
transaction_interface_id
, Source_Code
, Source_Line_Id
, Process_Flag
, Last_Update_Date
, Last_Updated_By
, Creation_Date
, Created_By
, Lot_Number
, lot_expiration_date
, Transaction_Quantity
, Primary_Quantity
VALUES (
l_txn_if_id2 --transaction_interface_id
, 'INV' --Source_Code
, -1 --Source_Line_Id
, 'Y' --Process_Flag
, l_sysdate --Last_Update_Date
, l_user_id --Last_Updated_by
, l_sysdate --Creation_date
, l_user_id --Created_By
, 'Q0000' --Lot_Number
, l_exp_date --Lot_Expiration_Date
, -200000 --transaction_quantity
, -200000 --primary_quantity
END;the first MTI record should be the source record ...ie. it should have transaction quantity as negative.
new set of MTI records should have positive transaction quantities.
Also ensure that sum of transaction quantities for the set should be 0...
What is the error that you are getting?
Thanks,
Hrishi. -
Error while invoking webservice using UTL_HTTP package
Hi All,
I am invoking a webservice (SOAP Request) from a PL/SQL block using UTL_HTTP package.
I am able to send the complete request and am getting the required instance on the BPEL Console, but the process is errorring out while getting response back.
and the PL/SQL Block is ending in error mentioned below:
ERROR at line 1:
ORA-29266: end-of-body reached
ORA-06512: at "SYS.UTL_HTTP", line 1321
ORA-06512: at "APPS.CSM_BPEL_TEST_PKG", line 34
ORA-06512: at line 1
Can anyone let me know what is the cause of this.
Thanks in advanceMy guess would be that your request is not properly constructed,
29266, 00000, "end-of-body reached"
// *Cause: The end of the HTTP response body was reached.
// *Action: If the end of the HTTP response is reached prematurely, check if
// the HTTP response terminates prematurely. Otherwise, end the
// HTTP response.John -
Can we post data 32KB using utl_http package?
I was using utl_http package for posting http data. Now there is a change in requirement and I have to call a web service instead of normal http post. Also the amount of data to be transferred now is >32KB (previously it was only 16KB). I have to manaually create the SOAP message and post it as http requset. Is it possible to post data more than >32KB using the utl_http package?
-Kumar
Message was edited by:
user586950did a trace route and this is what it came out with
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
C:\Documents and Settings\Moroni>ping 64.124.140.30:9090
Ping request could not find host 64.124.140.30:9090. Please check the name and t
ry again.
C:\Documents and Settings\Moroni>tracert 64.124.140.30:9090
Unable to resolve target system name 64.124.140.30:9090.
C:\Documents and Settings\Moroni>tracert 64.124.140.30
Tracing route to 64.124.140.30.mfnx.net [64.124.140.30]
over a maximum of 30 hops:
1 13 ms 15 ms 33 ms 73.91.188.1
2 9 ms 11 ms 9 ms GE-2-45-ur01.troutdale.or.bverton.comcast.net [6
8.87.218.185]
3 * 12 ms * te-9-3-ar01.troutdale.or.bverton.comcast.net [68
.87.216.89]
4 39 ms 13 ms 16 ms 12.116.25.33
5 17 ms 17 ms 18 ms tbr1011401.st6wa.ip.att.net [12.122.111.6]
6 17 ms 15 ms 16 ms 12.122.86.41
7 * * * Request timed out.
8 * * * Request timed out.
9 * * * Request timed out.
10 * * * Request timed out.
11 * * * Request timed out.
12 * * * Request timed out.
13 * * * Request timed out.
14 * * * Request timed out.
15 * * * Request timed out.
16 * * * Request timed out.
17 * * * Request timed out.
18 * * * Request timed out.
19 * * * Request timed out.
20 * * * Request timed out.
21 * * -
Problem in Using Utl_Http package
Hi to all,
I'm trying to send the sms(Short Message Service) using utl_Http package. When I'm trying to run a sql statement like
SELECT utl_http.request('http://www.oracle.com/index.html') FROM dual
I'm getting an error message like this.
The following error has occurred:
ORA-29273: HTTP request failed
ORA-06512: at "SYS.UTL_HTTP", line 1577
ORA-12545: Connect failed because target host or object does not exist
ORA-06512: at line 1
Pls help me to solve this problem.
Regards,
Alok DubeyThank you for ur reply. Infact my database was not able to access the internet. currently, it is working fine.
I'am using this code. It's works well.
CREATE OR REPLACE PROCEDURE Send_Sms_Http
AS
text_str VARCHAR2(5000);
V_Message VARCHAR2(200) := REPLACE('This is a DEMO SMS sent to u on '||TO_CHAR(SYSDATE,'DD/MM/RRRR HH12:MI:SS AM'),' ','%20');
text_sms VARCHAR2(5000) := 'http://hapi.smsapi.org/SendSMS.aspx?UserName=xxxx&password=xxxx&MobileNo=xxxx,xxxxx&SenderID=xxxx&CDMAHeader=xxxxx&Message='||V_Message;
BEGIN
text_str := utl_http.request(text_sms);
Dbms_Output.Put_Line('text_str = '||text_str);
EXCEPTION
WHEN OTHERS THEN
Dbms_Output.Put_line('Error in sending the message'||SQLERRM);
END;
Regards,
Alok Dubey -
How to get list of tables used in packages
Dear All
Can you pls tell me how to get list of tables used in packages
Regardsselect referenced_name
from user_dependencies
where name = 'your_package'
and referenced_type = 'TABLE'Regards,
Rob. -
Error while using utl_http package
Hi Guys,
I need some help with the utl_http package
The problem that Iam facing is as follows :
Iam trying to use the Oracle provided package utl_http
package to send an http request to a particular
website.However Iam getting the request_failed
exception.
I type in the foll.command in sqlplus:
select utl_http.request('http://www.oracle.com') from
dual
and I get the foll.error---
ERROR at line 1:
ORA-06510: PL/SQL: unhandled user-defined exception
ORA-06512: at "SYS.UTL_HTTP", line 174
ORA-06512: at line 1
If I try and trap the exception it shows
request_failed exception.
If any one has any clue on how to resolve this -- >please reply ASAP .
ThanksIs it possible that your database sits behind a firewall? If so, you need to specify the proxy in utl_http.request.
-
How to display html document returned by utl_http package (POST method)
I am using oracle forms 10g, data base version is 10g.
I have written a database procedure that calls utl_http package POST method and request returns an html document. How do display this html document from oracle form?
Thank you
HemaHere you have...
A Full Web Browser Java Bean - Oracle Forms PJCs/Java Beans
http://forms.pjc.bean.over-blog.com/article-26251949.html -
How to call a stored procedure using its package name in Oracle
hi
we're doing a JDBC scenario where we call a stored procedure(a.prc) using its package name(b)The stored procedure has In /Out/IN-OUT parameter.
i have got 2 queries:
1- How to call the stored procedure using it's package.
2- How to capture the In/Out parameter in the response.hi Prateek
thanks for the reply.
However when i tried mapping it to Package.procedure, communication channel throws the error saying that Package.proceudre needs to be declared.
As i said , the procedure has IN-OUT parameter too.In oracle we need to write a block if we want to read the IN-OUT parameter.
How to get the IN-OUT parameter in XI? -
Getting ora-04030 out of process memory using utl_http package
Hi,
Using oracle db v9 on aix. I run an extract (pl/sql package) which processes about 50,000 records. When processing gets to about record 45,500 ora 04030 error is reported when calling utl_http.get response or utl_http.read_text. Only have this problem after about 45500 records prcoessed.
Can anybody help?donl wrote:
Hi,
Using oracle db v9 on aix. I run an extract (pl/sql package) which processes about 50,000 records. When processing gets to about record 45,500 ora 04030 error is reported when calling utl_http.get response or utl_http.read_text. Only have this problem after about 45500 records prcoessed.
Can anybody help?04030, 00000, "out of process memory when trying to allocate %s bytes (%s,%s)"
// *Cause: Operating system process private memory was exhausted.
// *Action:
[oracle@localhost ~]$ -
I purchased an 89.99 Acrobat pack but can't figure out how to edit PDF's which is the reason I made the purchase. How do I edit with this software?
Hi peggyb50904266,
I'm sorry for the confusion: Adobe PDF Pack allows you to create and combine PDF files, but not edit them. To do that, you need to use Acrobat. If you'd like, we can switch your PDF Pack subscription for an Acrobat Pro or Standard subscription.
Best,
Sara -
How to apply Authentication for a webservice getting SOAPFaultException :(
Hi ,
I am working with weblogic 10.1.3 and running build.xml in eclipse for EE
I would like to know the steps to include security parameters to authenticate with weblogic server and call webservice
I have written a build.xml that takes input as wsdl , When I run the build.xml it generates
all the necessary stubs and interfaces
I have written a main program that imports generated classes and invoke the webservice method
below are buidl.xml and two classes( main program and one java class) which I used to invoke webservice
Build.xml
=====
<project name="webservices-simple_client" default="all">
<!-- set global properties for this -->
<property name="wls.hostname" value="localhost" />
<property name="wls.port" value="8002" />
<property name="example-output" value="output" />
<property name="clientclass-dir" value="${example-output}/srcclasses" />
<property name="clientclassfiles-dir" value="${example-output}/classfiles" />
<path id="client.class.path">
<pathelement path="${clientclass-dir}" />
<pathelement path="${java.class.path}" />
</path>
<taskdef name="clientgen" classname="weblogic.wsee.tools.anttasks.ClientGenTask" />
<target name="clean">
<delete dir="${clientclass-dir}" />
<delete dir="../src/com/bea/wlcp/wlng/ws/presence" />
<delete dir="../src/org/csapi/schema/paralyx/common/v2_1" />
<delete dir="../src/org/csapi/schema/paralyx/presence/consumer/v2_3/local" />
<delete dir="../src/org/csapi/schema/parlayx/presence/v2_3" />
<echo message="Cleaning Completed" />
</target>
<target name="build-client">
<clientgen wsdl="http://${wls.hostname}:${wls.port}/parlayx21/presence/PresenceConsumer?WSDL" destdir="${clientclass-dir}" generatepolicymethods="true" packageName="com.bea.wlcp.wlng.ws.presence" />
<javac srcdir="${clientclass-dir}" destdir="${clientclassfiles-dir}" includes="*/.java" />
<copy overwrite="true" todir="../src">
<fileset dir="${clientclass-dir}" />
</copy>
<copy overwrite="true" todir="../src">
<fileset dir="${clientclassfiles-dir}" />
</copy>
<delete dir="${clientclass-dir}" />
<delete dir="${clientclassfiles-dir}" />
<echo message="Building Completed" />
</target>
<target name="all" depends="clean,build-client" />
</project>
======================================================
import java.net.URI;
import javax.xml.rpc.Stub;
import javax.xml.ws.BindingProvider;
import java.net.Proxy;
import java.net.InetSocketAddress;
import java.util.ArrayList;
import java.util.List;
import weblogic.webservice.wsdl.WsdlPort;
import weblogic.wsee.connection.transport.http.HttpTransportInfo;
import weblogic.wsee.jaxrpc.ServiceImpl;
import org.csapi.schema.parlayx.common.v2_1.PolicyException;
import org.csapi.schema.parlayx.common.v2_1.SimpleReference;
import org.csapi.schema.parlayx.presence.consumer.v2_3.local.SubscribePresence;
import org.csapi.schema.parlayx.presence.consumer.v2_3.local.SubscribePresenceResponse;
import com.bea.wlcp.wlng.et.core.module.session_manager.GTUsernameTokenPolicy;
import com.bea.wlcp.wlng.et.core.module.session_manager.SessionManagerService_Impl;
import com.bea.wlcp.wlng.ws.presence.PresenceConsumer;
import com.bea.wlcp.wlng.ws.presence.PresenceConsumerService_Impl;
import com.bea.wlcp.wlng.ws.sessionmanager.SessionManager;
import com.bea.wlcp.wlng.ws.sessionmanager.SessionManagerService;
import weblogic.wsee.security.unt.ClientUNTCredentialProvider;
import weblogic.xml.crypto.wss.WSSecurityContext;
import weblogic.xml.crypto.wss.provider.CredentialProvider;
@SuppressWarnings("deprecation")
public class Main {
@SuppressWarnings("unchecked")
public static void main(String[] args) throws javax.xml.rpc.ServiceException,PolicyException{
try{
/*PresenceConsumerService_Impl pcs_impl = new PresenceConsumerService_Impl("http://localhost:8002/parlayx21/presence/PresenceConsumer?WSDL");
PresenceConsumer pc = (PresenceConsumer) pcs_impl.getPresenceConsumer();
UserCredentialsvalidation gt = new UserCredentialsvalidation("sdpai","sdp");*/
SimpleReference rf = new SimpleReference();
rf.setCorrelator("correlatorid");
rf.setEndpoint(URI.create("http://localhost:8002/PresenceConsumerService/services/PresenceConsumer"));
rf.setInterfaceName("PresenceConsumer");
SubscribePresence sb = new SubscribePresence();
sb.setApplication("sdp");
sb.setPresentity(URI.create("tel:1234"));
sb.setReference(rf);
System.out.println(" Before calling subscribe presence ==" );
//SubscribePresenceResponse spr = pc.subscribePresence(sb);
System.out.println(" Hi There here 2226678565");
System.out.println(" Hi There here 333");
//raja
String strUrl = "http://localhost:8002/parlayx21/presence/PresenceConsumer?WSDL";
Stub objStub = (Stub) new PresenceConsumerService_Impl().getPresenceConsumer();
objStub._setProperty(javax.xml.rpc.Stub.USERNAME_PROPERTY,"sdpai");
objStub._setProperty(javax.xml.rpc.Stub.PASSWORD_PROPERTY,"sdp");
objStub._setProperty(javax.xml.rpc.Stub.ENDPOINT_ADDRESS_PROPERTY,strUrl);
PresenceConsumer port = (PresenceConsumer) objStub;
String returnVal = "";
System.out.println(" Hi There here 77");
SubscribePresenceResponse spr = port.subscribePresence(sb);
System.out.println(spr);
//ended here
catch(Exception e)
e.printStackTrace();
=======================================
UserCredentialsvalidation.java
import com.bea.wlcp.wlng.et.core.module.session_manager.SessionManagerService_Impl;
import com.bea.wlcp.wlng.schema.ews.common.ServiceException;
import com.bea.wlcp.wlng.ws.sessionmanager.SessionManager;
import com.bea.wlcp.wlng.ws.sessionmanager.SessionManagerService;
import weblogic.wsee.security.unt.ClientUNTCredentialProvider;
import javax.xml.rpc.Stub;
import java.util.ArrayList;
import java.util.List;
public class UserCredentialsvalidation implements PolicyBase {
private String username;
private String password;
public UserCredentialsvalidation(String username, String password) {
this.username = username;
this.password = password;
String sessionManagerURL="http://localhost:8002/session_manager/SessionManager";
SessionManagerService accessservice = null;
try {
accessservice = (SessionManagerService) new SessionManagerService_Impl(sessionManagerURL+"?WSDL");
SessionManager port = accessservice.getSessionManager();
System.out.println(" port >>>>>");
System.out.println(" port >>>>>" +port);
UserCredentialsvalidation pbase = new UserCredentialsvalidation();
pbase.prepareStub((Stub)port,username,password);
} catch (Exception e) {
System.out.println(" helo helo");
// TODO Auto-generated catch block
e.printStackTrace();
public UserCredentialsvalidation() {
// TODO Auto-generated constructor stub
public void prepareStub(Stub stub,String username,String password) throws Exception {
List<ClientUNTCredentialProvider> credProviders = new ArrayList<ClientUNTCredentialProvider>();
System.out.println(" username >>> " + username.getBytes());
System.out.println(" password >>> " + password.getBytes());
credProviders.add(new ClientUNTCredentialProvider(username.getBytes(),
password.getBytes()));
System.out.println("setting standard wssec");
stub._setProperty("weblogic.wsee.security.wss.CredentialProviderList",
credProviders);
System.out.println("Getting property from stub== " + stub._getProperty("weblogic.wsee.security.wss.CredentialProviderList"));
@Override
public void prepareStub(Stub port) throws Exception {
// TODO Auto-generated method stub
=========================================
When I run the main program I am getting below exception
Before calling subscribe presence ==
Hi There here 2226678565
Hi There here 333
Hi There here 77
java.rmi.RemoteException: SOAPFaultException - FaultCode {http://schemas.xmlsoap.org/soap/envelope/}Server FaultString Unable to add security token for identity FaultActor nullNo Detail; nested exception is:
weblogic.wsee.jaxrpc.soapfault.WLSOAPFaultException: Unable to add security token for identity
at com.bea.wlcp.wlng.ws.presence.PresenceConsumer_Stub.subscribePresence(PresenceConsumer_Stub.java:37)
at Main.main(Main.java:62)
Caused by: weblogic.wsee.jaxrpc.soapfault.WLSOAPFaultException: Unable to add security token for identity
at weblogic.wsee.codec.soap11.SoapCodec.decodeFault(SoapCodec.java:355)
at weblogic.wsee.ws.dispatch.client.CodecHandler.decodeFault(CodecHandler.java:115)
at weblogic.wsee.ws.dispatch.client.CodecHandler.decode(CodecHandler.java:100)
at weblogic.wsee.ws.dispatch.client.CodecHandler.handleFault(CodecHandler.java:88)
at weblogic.wsee.handler.HandlerIterator.handleFault(HandlerIterator.java:309)
at weblogic.wsee.handler.HandlerIterator.handleResponse(HandlerIterator.java:269)
at weblogic.wsee.ws.dispatch.client.ClientDispatcher.handleResponse(ClientDispatcher.java:213)
at weblogic.wsee.ws.dispatch.client.ClientDispatcher.dispatch(ClientDispatcher.java:150)
at weblogic.wsee.ws.WsStub.invoke(WsStub.java:87)
at weblogic.wsee.jaxrpc.StubImpl._invoke(StubImpl.java:337)
at com.bea.wlcp.wlng.ws.presence.PresenceConsumer_Stub.subscribePresence(PresenceConsumer_Stub.java:32)
... 1 more
Caused by: weblogic.xml.crypto.wss.WSSecurityException: Unable to add security token for identity
at weblogic.wsee.security.wss.SecurityPolicyDriver.processIdentity(SecurityPolicyDriver.java:175)
at weblogic.wsee.security.wss.SecurityPolicyDriver.processOutbound(SecurityPolicyDriver.java:73)
at weblogic.wsee.security.WssClientHandler.processOutbound(WssClientHandler.java:71)
at weblogic.wsee.security.WssClientHandler.processRequest(WssClientHandler.java:55)
at weblogic.wsee.security.WssHandler.handleRequest(WssHandler.java:74)
at weblogic.wsee.handler.HandlerIterator.handleRequest(HandlerIterator.java:141)
at weblogic.wsee.handler.HandlerIterator.handleRequest(HandlerIterator.java:107)
at weblogic.wsee.ws.dispatch.client.ClientDispatcher.dispatch(ClientDispatcher.java:132)
... 4 more
==========================================================
I am working for 3 days to solve this issue, but helpless
Please tell me I am going in right way , I read many forums and implemented different ways , but getting same problem, that too before calling webservice method .
Do i need to do anything more apart from adding username and password parameters
Please tell me the exact steps how to perform authentication with webservices
Your answer will help me a lot .
Thanks in Advance
Regards
RajasekharPlease find the modified file Main.java
import java.net.URI;
import javax.xml.rpc.Stub;
import javax.xml.ws.BindingProvider;
import java.net.Proxy;
import java.net.InetSocketAddress;
import java.util.ArrayList;
import java.util.List;
import weblogic.webservice.wsdl.WsdlPort;
import weblogic.wsee.connection.transport.http.HttpTransportInfo;
import weblogic.wsee.jaxrpc.ServiceImpl;
import org.csapi.schema.parlayx.common.v2_1.PolicyException;
import org.csapi.schema.parlayx.common.v2_1.SimpleReference;
import org.csapi.schema.parlayx.presence.consumer.v2_3.local.SubscribePresence;
import org.csapi.schema.parlayx.presence.consumer.v2_3.local.SubscribePresenceResponse;
import com.bea.wlcp.wlng.et.core.module.session_manager.GTUsernameTokenPolicy;
import com.bea.wlcp.wlng.et.core.module.session_manager.SessionManagerService_Impl;
import com.bea.wlcp.wlng.ws.presence.PresenceConsumer;
import com.bea.wlcp.wlng.ws.presence.PresenceConsumerService_Impl;
import com.bea.wlcp.wlng.ws.sessionmanager.SessionManager;
import com.bea.wlcp.wlng.ws.sessionmanager.SessionManagerService;
import weblogic.wsee.security.unt.ClientUNTCredentialProvider;
import weblogic.xml.crypto.wss.WSSecurityContext;
import weblogic.xml.crypto.wss.provider.CredentialProvider;
@SuppressWarnings("deprecation")
public class Main {
@SuppressWarnings("unchecked")
public static void main(String[] args) throws javax.xml.rpc.ServiceException,PolicyException{
try{
/*PresenceConsumerService_Impl pcs_impl = new PresenceConsumerService_Impl("http://localhost:8002/parlayx21/presence/PresenceConsumer?WSDL");
//PresenceConsumer pc = (PresenceConsumer) pcs_impl.getPresenceConsumer();*/
UserCredentialsvalidation gt = new UserCredentialsvalidation("sdpai","sdp");
SimpleReference rf = new SimpleReference();
rf.setCorrelator("correlatorid");
rf.setEndpoint(URI.create("http://localhost:8002/PresenceConsumerService/services/PresenceConsumer"));
rf.setInterfaceName("PresenceConsumer");
SubscribePresence sb = new SubscribePresence();
sb.setApplication("sdp");
sb.setPresentity(URI.create("tel:1234"));
sb.setReference(rf);
System.out.println(" Before calling subscribe presence ==" );
//SubscribePresenceResponse spr = pc.subscribePresence(sb);
System.out.println(" Hi There here 2226678565");
System.out.println(" Hi There here 333");
//raja
String strUrl = "http://localhost:8002/parlayx21/presence/PresenceConsumer?WSDL";
Stub objStub = (Stub) new PresenceConsumerService_Impl().getPresenceConsumer();
objStub._setProperty(javax.xml.rpc.Stub.USERNAME_PROPERTY,"sdpai");
objStub._setProperty(javax.xml.rpc.Stub.PASSWORD_PROPERTY,"sdp");
objStub._setProperty(javax.xml.rpc.Stub.ENDPOINT_ADDRESS_PROPERTY,strUrl);
PresenceConsumer port = (PresenceConsumer) objStub;
String returnVal = "";
System.out.println(" Hi There here 77");
SubscribePresenceResponse spr = port.subscribePresence(sb);
System.out.println(spr);
//ended here
catch(Exception e)
e.printStackTrace();
==============================
When I run the main program getting below exception
port >>>>>
port >>>>>com.bea.wlcp.wlng.ws.sessionmanager.SessionManager_Stub@19c0bd6
username >>> [B@1cd280b
password >>> [B@29ac
setting standard wssec
Getting property from stub== [[ClientUNTCredentialProvider: username=sdpai password=is set]]
Before calling subscribe presence ==
Hi There here 2226678565
Hi There here 333
Hi There here 77
java.rmi.RemoteException: SOAPFaultException - FaultCode [{http://schemas.xmlsoap.org/soap/envelope/}Server] FaultString [Unable to add security token for identity] FaultActor [null]No Detail; nested exception is:
weblogic.wsee.jaxrpc.soapfault.WLSOAPFaultException: Unable to add security token for identity
at com.bea.wlcp.wlng.ws.presence.PresenceConsumer_Stub.subscribePresence(PresenceConsumer_Stub.java:37)
at Main.main(Main.java:62)
Caused by: weblogic.wsee.jaxrpc.soapfault.WLSOAPFaultException: Unable to add security token for identity
at weblogic.wsee.codec.soap11.SoapCodec.decodeFault(SoapCodec.java:355)
at weblogic.wsee.ws.dispatch.client.CodecHandler.decodeFault(CodecHandler.java:115)
at weblogic.wsee.ws.dispatch.client.CodecHandler.decode(CodecHandler.java:100)
at weblogic.wsee.ws.dispatch.client.CodecHandler.handleFault(CodecHandler.java:88)
at weblogic.wsee.handler.HandlerIterator.handleFault(HandlerIterator.java:309)
at weblogic.wsee.handler.HandlerIterator.handleResponse(HandlerIterator.java:269)
at weblogic.wsee.ws.dispatch.client.ClientDispatcher.handleResponse(ClientDispatcher.java:213)
at weblogic.wsee.ws.dispatch.client.ClientDispatcher.dispatch(ClientDispatcher.java:150)
at weblogic.wsee.ws.WsStub.invoke(WsStub.java:87)
at weblogic.wsee.jaxrpc.StubImpl._invoke(StubImpl.java:337)
at com.bea.wlcp.wlng.ws.presence.PresenceConsumer_Stub.subscribePresence(PresenceConsumer_Stub.java:32)
... 1 more
Caused by: weblogic.xml.crypto.wss.WSSecurityException: Unable to add security token for identity
at weblogic.wsee.security.wss.SecurityPolicyDriver.processIdentity(SecurityPolicyDriver.java:175)
at weblogic.wsee.security.wss.SecurityPolicyDriver.processOutbound(SecurityPolicyDriver.java:73)
at weblogic.wsee.security.WssClientHandler.processOutbound(WssClientHandler.java:71)
at weblogic.wsee.security.WssClientHandler.processRequest(WssClientHandler.java:55)
at weblogic.wsee.security.WssHandler.handleRequest(WssHandler.java:74)
at weblogic.wsee.handler.HandlerIterator.handleRequest(HandlerIterator.java:141)
at weblogic.wsee.handler.HandlerIterator.handleRequest(HandlerIterator.java:107)
at weblogic.wsee.ws.dispatch.client.ClientDispatcher.dispatch(ClientDispatcher.java:132)
... 4 more -
Hi ...
I am using oracle 9i release 2 ....
I want to use UTL_HTTP package to POST the Data ....
Can Anyone Plz give me the hint of how to use it .....
I am also worried abt testing the above problem ... Is there anything on Internet to Test the Posting of DATA using UTL_HTTP ....
Thanks,Hi,
Did you see this sample code below ?
http://www.oracle.com/technology/sample_code/tech/pl_sql/htdocs/x/Utl_Http_Package_Enhancements/Cr_Using_Utl_Http.htm
Cheers -
Downloading of PPT using UTL_HTTP
Hi All,
I want one solution such a way that we have some urls stored in our database, so we are going to retrive the data that are in ppt format from this urls and store it in the ppt format in our database and my problem is the urls are password protected thats why when we use utl_http package we are getting blank ppt getting saved. So i want a solution as to how can we authenticate in the process ,while retrieving data from url.Can anybody please help me.
Thanks
Edited by: dil84 on Jan 19, 2009 11:45 PMHello,
Take a look at the following thread -
Re: UTL_HTTP.REQUEST_PIECES on a page that needs log in
Hope this helps,
John
Blog: http://jes.blogs.shellprompt.net
Work: http://www.apex-evangelists.com
Author of Pro Application Express: http://tinyurl.com/3gu7cd
REWARDS: Please remember to mark helpful or correct posts on the forum, not just for my answers but for everyone! -
How to do OBIEE load testing using OATS
Hi,
As part of OBIEE load testing, i have down loaded OATS.
Can i please know what protocol to use to perform OBIEE load testing.
And how to perform OBIEE load testing using OATS ?You can use the web/http protocol for load testing the OBIEE.., Also please let me know if you face any issues using this protocol
Maybe you are looking for
-
Need to load data from source .CSV files to oracle target database.
Hi, This is the my scenario I have .CSV files in ftp folder and need to load the data into target tables. For that i need to create package and load the data into daily basis. But some time .csv file name will vary daily basis. can you any one sugges
-
First of all, I was looking on another site "answers" about how to copy music on my ipod touch with out erasing the current music which are on it... I did as instructed to copy them manually.....checked my ipod to see..... All the music I copied were
-
Hi all, Here i'm facing an below stated exception when ever i click on link. I have a created an HTML page under the Portal KM and for that Page i have created a resource , and the resource added to the Area under the field Area long text in SPRO tco
-
Hi Gurus, We are doing an upgrade of system from patch level 52 to 53 in 4.6 C . I have read some documents.Following them, I'm trying to clear SPAU list.First i'm clearing 'sap note corrections' I have reset the obsolete notes(ones displayed with gr
-
Siempre que intento sincronizar mi ipod itunes no me deja
no me deja y me envia un mensaje diciendo el ipod no se a podido sincronizar por que la sincronizacion no se logro