Help Urgent : Invoking SMS Web Services Using ABAP FM HTTP_POST
Dear Gurus,
Our client requirement is in such a way that ,
They want to invoke web services for sending SMS through ABAP program.
Please suggest the way .
I am using FM HTTP_POST in order to call the URL for web service for SMS.
My URL is as follows,
'http://IP ADDRESS :PORT /invoke/crm_sms/send_crm_sms?&mobile_no=9987536748&message=HI' .
and my code is as follows,
========================================================================
report ztesturl.
data : begin of t_request_body occurs 0 ,
body(1025),
end of t_request_body.
data : begin of t_request_header occurs 0 ,
body(1025),
end of t_request_header.
data : str(20) value '9987536748' ,int(20) value 'text',uri(460),
status_code(100),
status_text(100),
len type i.
data : begin of t_response_body occurs 0 ,
body(1025),
end of t_response_body.
data : begin of t_response_header occurs 0 ,
body(1025),
end of t_response_header.
uri = 'http://IP ADDRESS :PORT /invoke/crm_sms/send_crm_sms?mobile_no=9987536748&message=HI' .
concatenate 'mobile_no=' str into t_request_body-body.
append t_request_body.
concatenate 'message=' int into t_request_body-body.
append t_request_body.
move: url to t_request_header-body.
append t_request_header.
call function 'HTTP_POST'
exporting
absolute_uri = uri
request_entity_body_length = 300
blankstocrlf = 'X'
proxy = 'IP Address:Port' ===> Same as Interner Tools -> Connection
proxy_user = EMAIL ID ===> Which i am using Userid for Internet
proxy_password = 'password123'
importing
status_code = status_code
status_text = status_text
response_entity_body_length = len
tables
request_entity_body = t_request_body
request_headers = t_request_header
response_entity_body = t_response_body
response_headers = t_response_header.
I am getting Following log in t_response_body
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 3 5
ERROR
6
Cache Accesss
7
8
9 While trying to retrieve the URL: 10 http://IP ADDRESS :PORT /invoke/crm_sms/send_crm_sms?
11
12 The following error was encountered:
13
14
15 16 Cache Access Denied. 17 18
19
20 21
Sorry, you are not currently allowed to request: 22
http://IP ADDRESS :PORT /invoke/crm_sms/send_crm_sms?
23 from this cache until you have authenticated yourself. 24
25 26
27 You need to use Netscape version 2.0 or greater, or Microsoft Internet 28 Explorer 3.0, or an HTTP/1.1 compliant browser for this to work. Please 29 contact the cache administrator if you have 30 difficulties authenticating yourself or
31 change your default password.
32
33
34
35
36 Generated Thu, 26 Jun 2008 11:18:54 GMT by ProxyServer.VakolaProxy (Squid/2.4.STABLE7) 37
Thanks in advance.
With Regards,
Rajesh C
slen = strlen( user ).
call 'AB_RFC_X_SCRAMBLE_STRING'
id 'SOURCE' field user id 'KEY' field key
id 'SCR' field 'X' id 'DESTINATION' field user
id 'DSTLEN' field slen.
slen = strlen( password ).
call 'AB_RFC_X_SCRAMBLE_STRING'
id 'SOURCE' field password id 'KEY' field key
id 'SCR' field 'X' id 'DESTINATION' field password
id 'DSTLEN' field slen.
Similar Messages
-
Unallowed RFC-XML Tag (SOAP_EINVALDOC) - Web Service using ABAP Proxy
Hi there
I am trying to consume a Web Service using ABAP Proxies. I have done the following in the system:
I configured the HTTP and HTTPS Proxy settings.
I created a package with package interfaces SAI_TOOLS and SAPPINT included under the Use Access tab.
I created the proxy classes by using the WSDL provided by the system I'm trying to interface with.
I created my HTTP destination RFC via SM59.
I configured a logical port for the proxy.
I developed the ABAP code for calling the proxy.
In the code the exception CX_AI_SYSTEM_FAULT gets raised with error message <b>"Unallowed RFC-XML Tag (SOAP_EINVALDOC)"</b> when I call the method for passing data to the destination system in the proxy class.
I had a look at SM21 and the following message was written in the log:
<b>"SOAP Runtime: SOAP Runtime exception: 111 occurred in method XP_READ_TAG of class CL_SOAP_XP at position 1
SOAP Runtime: Exception message: Unallowed RFC-XML Tag (SOAP_EINVALDOC)"</b>. I also looked at SAP Note 919886 which states that it can be dumps in the system, missing configuration or the path prefix of the RFC destination that is incorrect. I cannot find any ST22 entries. The trace file looks as follows:
SAP System ID: DGH
Client: 009
User: COLESKG
System time: 072910
System date: 20070531
SAP Release: 700
Host: hd307c
Operating system: AIX
DB System: ORACLE
Program: ZUK_IPA00003
Processing State: 0
Location: Client
Transport Binding: http://schemas.xmlsoap.org/soap/http
SOAP Application: urn:sap-com:soap:runtime:application:client
SOAP Runtime Protocol: http://www.sap.com/webas/630/soap
/runtime/protocol
SOAP Protocols: <initial>
Request Message: <initial>
Response Message: <initial>
Fault: <initial>
Registry: <initial>
SOAP Roles: <initial>
Trace Level: 3
Logging Level: 2
Monitoring Level: 0
Security Profile: <initial>
WS Security Protocol: <initial>
INFO 07:29:10: SOAP LP Registry CL_SRT_LP_MAINTENANCE->CREATE_CLIENT_APPL() Try to create client application for Proxyclass:
ZES_CO_PROCESS_EMPLOYEE_BATCH LP name: DEFAULT
INFO 07:29:10: SOAP LP Registry CL_SRT_LP_MAINTENANCE->CREATE_CLIENT_APPL() Client application created
INFO 07:29:10: SOAP LP Registry CL_SRT_LP_MAINTENANCE->CREATE_CLIENT_APPL() Try to initialize client application
INFO 07:29:10: SOAP Application CL_SOAP_APPLICATION_CLIENT->IF_SOAP_APPLICATION_CS~INIT() Try to initialize application
urn:sap-com:soap:runtime:application:client
INFO 07:29:10: SOAP Application CL_SOAP_APPLICATION_CLIENT->INTERNAL_CLIENT_INIT() Create new runtime CL_SOAP_RUNTIME_CLIENT
INFO 07:29:10: SOAP Runtime CL_SOAP_RUNTIME_CLIENT->REGISTER_APPLICATION() Try to register application
INFO 07:29:10: SOAP Runtime CL_SOAP_RUNTIME_CLIENT->REGISTER_APPLICATION() Application registered
INFO 07:29:10: SOAP Application CL_SOAP_APPLICATION_CLIENT->INTERNAL_CLIENT_INIT() Read type of transport binding from
configuration
INFO 07:29:10: SOAP Application CL_SOAP_APPLICATION_CLIENT->INTERNAL_CLIENT_INIT() Create new transport binding type
http://schemas.xmlsoap.org/soap/http
INFO 07:29:10: SOAP Transport Binding CL_SOAP_TRANSPORT_BINDING_ROOT->IF_SOAP_TRANSPORT_BINDING~INIT() Try to initialize
http://schemas.xmlsoap.org/soap/http
INFO 07:29:10: SOAP Transport Binding CL_SOAP_TRANSPORT_BINDING_ROOT->IF_SOAP_TRANSPORT_BINDING~INIT() http://schemas.xmlsoap
.org/soap/http initialized
INFO 07:29:10: SOAP Transport Binding CL_SOAP_TRANSPORT_BINDING_ROOT->IF_SOAP_TRANSPORT_BINDING~REQUEST() Try to create request message
INFO 07:29:10: SOAP Transport Binding CL_SOAP_TRANSPORT_BINDING_ROOT->IF_SOAP_TRANSPORT_BINDING~REQUEST() Request message created
INFO 07:29:10: SOAP Transport Binding CL_SOAP_TRANSPORT_BINDING_ROOT->IF_SOAP_TRANSPORT_BINDING~RESPONSE() Try to create response message
INFO 07:29:10: SOAP Transport Binding CL_SOAP_TRANSPORT_BINDING_ROOT->IF_SOAP_TRANSPORT_BINDING~RESPONSE() Response message
created
INFO 07:29:10: SOAP Runtime CL_SOAP_RUNTIME_CLIENT->INIT() Try to initialize
INFO 07:29:10: SOAP Runtime CL_SOAP_RUNTIME_CLIENT->INIT() Check transport binding
INFO 07:29:10: SOAP Runtime CL_SOAP_RUNTIME_CLIENT->INIT() Create runtime protocol
INFO 07:29:10: SOAP Runtime Protocol CL_SOAP_RUNTIME_PROTOCOL->IF_SOAP_PROTOCOL~INIT() Try to initialize SOAP Runtime-intrinsic
Protocol as SENDER with Priority 5
INFO 07:29:10: SOAP Runtime Protocol CL_SOAP_RUNTIME_PROTOCOL->INIT_MODULES() Try to create trace header/part
INFO 07:29:10: SOAP Runtime Protocol CL_SOAP_RUNTIME_PROTOCOL->INIT_MODULES() Trace header/part created
INFO 07:29:10: SOAP Runtime Protocol CL_SOAP_RUNTIME_PROTOCOL->INIT_MODULES() Try to create logging header/part
INFO 07:29:10: SOAP Runtime Protocol CL_SOAP_RUNTIME_PROTOCOL->INIT_MODULES() Logging header/part created
INFO 07:29:10: SOAP Runtime Protocol CL_SOAP_RUNTIME_PROTOCOL->IF_SOAP_PROTOCOL~INIT() Protocol initialized
INFO 07:29:10: SOAP Runtime CL_SOAP_RUNTIME_CLIENT->INIT()
Initialized
INFO 07:29:10: SOAP Protocol CL_SOAP_PROTOCOL_FACTORY->CREATE()
Try to create instance for http://www.sap.com/webas/630/soap
/runtime/session/protocol::http://www.sap.com/webas/630/soap
/runtime/session/protocol/srt640_impl
INFO 07:29:10: SOAP Protocol CL_SOAP_PROTOCOL_FACTORY->CREATE()
Instance of CL_SOAP_SESSION_PROTOCOL created for http://www.sap.com/webas/630/soap/runtime/session/protocol::http://www.sap.com/webas/630/soap/runtime/session/protocol/srt640_impl
INFO 07:29:10: SOAP SESSION Protocol CL_SOAP_SESSION_PROTOCOL->IF_SOAP_PROTOCOL~INIT() Try to initialize SOAP Session Protocol
as SENDER with Priority 5
INFO 07:29:10: SOAP SESSION Protocol CL_SOAP_SESSION_PROTOCOL->IF_SOAP_PROTOCOL~INIT() Protocol initialized
INFO 07:29:10: SOAP Application CL_SOAP_APPLICATION_CLIENT_GEN->CONFIGURE_FEATURES() Try to configure features
INFO 07:29:10: SOAP HTTP Binding CL_SOAP_HTTP_TPBND_ROOT->IF_SOAP_HTTP_TRANSPORT_BINDING~SET_CLIENT_BY_DESTINATION() Try to
create ICF Client for DESTINATION = ALSB
INFO 07:29:10: SOAP HTTP Binding CL_SOAP_HTTP_TPBND_ROOT->IF_SOAP_HTTP_TRANSPORT_BINDING~SET_CLIENT_BY_DESTINATION() ICF
Client created by DESTINATION
INFO 07:29:10: SOAP HTTP Binding CL_SOAP_HTTP_TPBND_ROOT->IF_SOAP_HTTP_TRANSPORT_BINDING~SET_DESTINATION_URL_PATH() Set
DESTINATION PATH = /SapHRSmartIntegrationWeb/processes/ProcessEmployeeBatch.jpd
INFO 07:29:10: SOAP Application CL_SOAP_APPLICATION_CLIENT_GEN->CONFIGURE_FEATURES() Features configured
INFO 07:29:10: SOAP Application CL_SOAP_APPLICATION_CLIENT->IF_SOAP_APPLICATION_CS~INIT() Application urn:sap-com:soap
:runtime:application:client initialized
INFO 07:29:10: SOAP LP Registry CL_SRT_LP_MAINTENANCE->CREATE_CLIENT_APPL() Client application initialized
Trace file opened at 20070531 073030 GMT SAP-REL 700,0,95
Error in module XMLParserGetNextElement:773
Id @(#) $Id: //bas/700_REL/src/krn/rfc/xrfcpars.c#2 $
Unallowed RFC-XML Tag
Error in module XMLConverterReadTag:3061
Id @(#) $Id: //bas/700_REL/src/krn/rfc/xrfccnvrt.c#5 $
Unallowed RFC-XML Tag(24)
Error in module ab_soap:4392
Id @(#) $Id: //bas/700_REL/src/krn/rfc/abxrfccal.c#2 $
failed with return code 1
It then must be something in the config. Has anyone got any idea why this message is encountered?
Kind Regards
Gustav Coleske
Message was edited by:
Gustav ColeskeHi,
I have the same problem as described.
Can you give me a little more information about the error you have solved in the proxy.
Thanks for help
John -
We would like to implement SMS web services using ADF BC. Could u please help us to point us to the right path to start this. The SMS web services will send the logs, errors or exception generated by Oracle ADF based application to mobile phones. The recipient of this is an IT administrator or those who will maintain the application.
Aside from the software architecture, what are necessary technical implementation or hardware infrastructure needed to implement this? Is the Oracle wireless already integrated with the Oracle 10g AS?Are you already familiar with ADF BC and just trying to implement a web service with it?
I'm not familiar with what special facility an "SMS Web Service" would need. If you can implement it as a simple java class, you can implement it as a simple java class that uses ADF Business Components for sure. -
How to invoke a web service using https
Hi,
I have a few security related questions surrounding BPEL process manager.
1. Does the BPEL engine have the capability to invoke a web service using https (HTTP over SSL)? Does it automatically do that if partner link URI starts with https:// ?
2. If not, what needs to be done to enable accessing a https based web service?
3. I need to write a web service that accepts a message and updates certain information in the database. The web service will be deployed in an OC4J instance in Oracle App Server. We want to allow the web service to be accessed from BPEL only by users registered in the database. What is the recommended way to pass username and password to a webservice if service is invoked from BPEL process manager? Note that specifying username/password in bpel.xml is not an option.
Thanks,
Pranav1. Does the BPEL engine have the capability to invoke a web service using https (HTTP over SSL)? Does it automatically do that if partner link URI starts with https:// ?
We currently don't have support for HTTP over SSl. We are working on it to include this functionality in near future.
2. If not, what needs to be done to enable accessing a https based web service?
I am not sure it is possible with current product offering. I will confirm it after discussing with our concerned development group. There is some work going to integrate with Oblix security mechanism [recently acquired by Oracle].
3. I need to write a web service that accepts a message and updates certain information in the database. The web service will be deployed in an OC4J instance in Oracle App Server. We want to allow the web service to be accessed from BPEL only by users registered in the database. What is the recommended way to pass username and password to a webservice if service is invoked from BPEL process manager? Note that specifying username/password in bpel.xml is not an option.
This will be easier to do if we can use Oblix along with BPEL PM. Could you please let us know more about your application so that we can provide you the customized solution till it's part of the product. You can send this query to [email protected] so that our product management team can give you more detailed roadmap regarding this.
HTH.
Thanks,
Rakesh -
Invoking a Web Service using XI 2.0
Hi all,
I am attempting to create a scenario where an SAP application invokes a web service through XI 2.0.
I have created an ABAP proxy to allow my ABAP to start the call process and have set up the message interfaces within the Integration Directory.
I want XI to receive a call from this proxy and then act as the client to an existing Web Service.. calling it and bringing back a response... but it doesn't look like I can import the existing WSDL as a I would have expected.
So... instead I have exported the Message Interface for the "out of XI" portion of the interface as a WSDL and have asked the Web Service provider to amend their service according to this XI generated WSDL.
My difficulty now is how to use the SOAP adapter. Within the Integration Directory I presumably need to define the endpoint with XI Connectivity but I am not sure how to fill in the URL address of the SOAP adapter...
Any help on how to configure the actual SOAP adapter to fulfill this requirement would be great too.
I have looked around the boards to see if I could work this out from previous posts but without success so far.
It's a synchronous scenario and basically should look like...
ABAP Proxy->XI->SOAP Adapter->Web Service->XI->ABAP Proxy
Many thanks,
GordonHi Gordon,
here is an example for SOAP-Adapter config:
# Bubble adapter java class
classname=com.sap.aii.messaging.adapter.ModuleBubble
# Sets the bubble module helper that can instantiate your bubble bag
Bubble.Helper=com.sap.aii.messaging.adapter.ModuleBubbleHelperXMBWSImpl
###### Part 0 (FromWS and ToWS) : common part ######
# Keeps the XMB headers in web service messages
XMBWS.KeepHeaders=false
# Encodes the xmb headers into a special HTTP header string x-xmb_ws_encoded
XMBWS.UseEncoded=false
# The target URL for the web service, to which the adapter sends web service messages.
# The address is part of the WSDL
XMBWS.TargetURL=http://www.extensio.com:8080/ExtensioInfoServer/servlet/rpcrouter
# Proxy configuration from SAP
XMBWS.proxyHost=PrOxY
XMBWS.proxyPort=8080
# The port and path where the adapter waits for XMB messages from clients.
XMBWS.XMBPort=8400
XMBWS.XMBPath=/soap/stockquote
# The default SOAPAction HTTP request header to the web Service server
# The SoapAction is part of the WSDL
XMBWS.DefaultSOAPAction=
Of course you have to set URL, proxy and SOAP-action to your belongings.
You define the endpoint as:
"http://<Adapter-Server>:<XMBPort><XMBPath>"
in this example:
"http://localhost:8400/soap/stockquote"
Stefan -
Error invoking SSL web service using pl sql UTL_HTTP
Web Services Gurus,
I am invoking a secure web service based on the following WSDL file from a pl/sql program using UTL_HTTP package.
The web service is secure and prompts for authentication.
The web services certificate is imported in Oracle Wallet on Database Server.
I am listing the WSDL file, the pl/sql code and error message as follows -
1. The WSDL file -
<definitions
name="Webservice"
targetNamespace="http://webservice.airclic.com/"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:tns="http://webservice.airclic.com/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
>
<types>
<xs:schema targetNamespace="http://webservice.airclic.com/" version="1.0" xmlns:tns="http://webservice.airclic.com/"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="Exception" type="tns:Exception"/>
<xs:element name="sendAuthenticationResponse" type="tns:sendAuthenticationResponse"/>
<xs:element name="sendAuthenticationResponseResponse" type="tns:sendAuthenticationResponseResponse"/>
<xs:complexType name="AuthenticationResponse">
<xs:complexContent>
<xs:extension base="tns:Response">
<xs:sequence>
<xs:element name="success" type="xs:boolean"/>
<xs:element name="username" type="xs:string"/>
<xs:element minOccurs="0" name="password" type="xs:string"/>
<xs:element minOccurs="0" name="firstName" type="xs:string"/>
<xs:element minOccurs="0" name="lastName" type="xs:string"/>
<xs:element minOccurs="0" name="email" type="xs:string"/>
<xs:element minOccurs="0" name="active" type="xs:boolean"/>
<xs:element minOccurs="0" name="timeZone" type="xs:string"/>
<xs:element minOccurs="0" name="group" type="xs:string"/>
<xs:element minOccurs="0" name="role" type="xs:string"/>
<xs:element minOccurs="0" name="errorCode" type="xs:string"/>
<xs:element minOccurs="0" name="errorMessage" type="xs:string"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="DispatchEvent"></xs:complexType>
<xs:complexType name="sendAuthenticationResponse">
<xs:sequence>
<xs:element minOccurs="0" name="authenticationResponse" type="tns:AuthenticationResponse"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="sendAuthenticationResponseResponse">
<xs:sequence/>
</xs:complexType>
<xs:simpleType name="status"></xs:simpleType>
<xs:simpleType name="source"></xs:simpleType>
<xs:simpleType name="eventType"></xs:simpleType>
</xs:schema>
</types>
<message name="Webservice_sendAuthenticationResponse">
<part name="sendAuthenticationResponse" element="tns:sendAuthenticationResponse"/>
</message>
<message name="Webservice_sendAuthenticationResponseResponse">
<part name="sendAuthenticationResponseResponse" element="tns:sendAuthenticationResponseResponse"/>
</message>
<portType name="Webservice">
<operation name="sendAuthenticationResponse" parameterOrder="sendAuthenticationResponse">
<input message="tns:Webservice_sendAuthenticationResponse"/>
<output message="tns:Webservice_sendAuthenticationResponseResponse"/>
<fault name="Exception" message="tns:Exception"/>
</operation>
</portType>
<binding name="WebserviceBinding" type="tns:Webservice">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="sendAuthenticationResponse">
<soap:operation soapAction=""/>
<input>
<soap:body use="literal"/>
</input>
<output>
<soap:body use="literal"/>
</output>
<fault name="Exception">
<soap:fault name="Exception" use="literal"/>
</fault>
</operation>
</binding>
<service name="Webservice">
<port name="WebservicePort" binding="tns:WebserviceBinding">
<soap:address location="https://host.airclic.com:443/webservice/product/fieldservice/v1/Webservice"/>
</port>
</service>
</definitions>
2. The pl/sql code that calls the web service operation sendAuthenticationResponse
procedure send_auth_response
as
soap_request varchar2(30000);
soap_respond varchar2(30000);
http_req utl_http.req;
http_resp utl_http.resp;
resp XMLType;
i integer;
begin
-- initiate wallet for AirClic certificate
dbms_output.put_line ('1');
utl_http.set_wallet('file:/etc/oracle/wallet','<wallet password>');
-- create soap request
dbms_output.put_line ('2');
soap_request:= '<?xml version = "1.0" encoding = "UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<SOAP-ENV:Body>
<ns1:sendAuthenticationResponse xmlns="https://host.airclic.com:443/webservice/product/fieldservice/v1/Webservice" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<success xsi:type="xsd:boolean">true</success>
<username xsi:type="xsd:string">changlanih</username>
<password xsi:type="xsd:string">abcd1234</password>
<firstName xsi:type="xsd:string">hero</firstName>
<lastName xsi:type="xsd:string">changlani</lastName>
<email xsi:type="xsd:string">[email protected]</email>
<active xsi:type="xsd:boolean">true</active>
<timeZone xsi:type="xsd:string">eastern</timeZone>
<group xsi:type="xsd:string">Northeast</group>
<role xsi:type="xsd:string">Service Manager</role>
<errorCode xsi:type="xsd:string"></errorCode>
<errorMessage xsi:type="xsd:string"></errorMessage>
</ns1:sendAuthenticationResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>';
-- request that exceptions are raised for error Status Codes
dbms_output.put_line ('3');
utl_http.set_response_error_check (true);
-- allow testing for exceptions like UTL_HTTP.http_server_error
dbms_output.put_line ('4');
utl_http.set_detailed_excp_support (true);
--utl_http.set_transfer_timeout (ln_time_out);
dbms_output.put_line ('5');
utl_http.set_body_charset ('UTF-8');
-- begin request
dbms_output.put_line ('5.5');
http_req:= utl_http.begin_request
('https://host.airclic.com:443/webservice/product/fieldservice/v1/Webservice/sendAuthenticationResponse', ------ is the url correct here ?
'POST',
'HTTP/1.1'
dbms_output.put_line ('6');
utl_http.set_authentication(http_req, '<username for webservice>', '<password for webservice user>');
dbms_output.put_line ('7');
utl_http.set_persistent_conn_support (http_req, false);
dbms_output.put_line ('8');
utl_http.set_header(http_req, 'Content-Type', 'text/xml'); -- since we are dealing with plain text in XML documents
dbms_output.put_line ('9');
utl_http.set_header(http_req, 'Content-Length', length(soap_request));
dbms_output.put_line ('10');
utl_http.set_header(http_req, 'SOAPAction', ''); -- required to specify this is a SOAP communication
dbms_output.put_line ('11');
utl_http.write_text(http_req, soap_request);
dbms_output.put_line ('12');
http_resp := utl_http.get_response(http_req);
-- debug messages
DBMS_OUTPUT.PUT_LINE('-------utl_http.get_response---------------------');
DBMS_OUTPUT.PUT_LINE('http_resp.status_code is :'||http_resp.status_code );
DBMS_OUTPUT.PUT_LINE('http_resp.reason_phrase is :'||http_resp.reason_phrase);
DBMS_OUTPUT.PUT_LINE('http_resp.http_version is :'||http_resp.http_version);
DBMS_OUTPUT.PUT_LINE('http_resp.private_hndl is :'||http_resp.private_hndl);
DBMS_OUTPUT.PUT_LINE('-------utl_http.get_response----------------------');
utl_http.read_text(http_resp, soap_respond);
dbms_output.put_line ('13');
utl_http.end_response(http_resp);
dbms_output.put_line ('14');
resp := XMLType.createXML(soap_respond);
dbms_output.put_line ('15');
resp := resp.extract('/soap:Envelop/soap:Body/child::node()',
'xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"');
i:=0;
dbms_output.put_line ('16');
loop
dbms_output.put_line(substr(soap_respond, 1 + i * 255, 250));
i := i + 1;
if (i * 250) > length(soap_respond) then
exit;
end if;
end loop;
exception
when utl_http.request_failed then
dbms_output.put_line('request failed: ' || utl_http.get_detailed_sqlerrm);
when utl_http.http_server_error then
dbms_output.put_line('server error: ' || utl_http.get_detailed_sqlerrm);
when utl_http.http_client_error then
dbms_output.put_line('client error: ' || utl_http.get_detailed_sqlerrm);
when others then
dbms_output.put_line(sqlerrm);
end send_auth_response;
3. Output when I run the send_auth_response procedure
Connecting to the database cpdev.
1
2
3
4
5
5.5
ORA-12560: TNS:protocol adapter error
Process exited.
Disconnecting from the database cpdev.
Comments -
The web service operation only has input message. The input message consists of a complex type as seen in WSDL.
Questions -
1. This is my first attempt in invoking a web service from pl/sql program. Is the code in SOAP body correct as mapped to the complex type in WSDL ?
2. As seen from the dbms_out - the last message before ORA-12560 is 5.5, that means the call is erroring at following code line -
http_req:= utl_http.begin_request ------ what am I doing wrong here ?
3. The web service is SSL as seen from WSDLand needs a username/password for access - which is being performed by following code line -
utl_http.set_authentication(http_req, '<username for webservice>', '<password for webservice user>'); ------- is that correct ?
4. I am not using any proxy server - should I be using it ? When is it necessary to use proxy ?
Appreciate any help.
Thanx.Oracle is hosted by HOST A - this is where the pl/sql program resides.
The Web Service being accessed by pl/sql program is hosted by HOST B and there are 4 firewalls in between.
Oracle was not even able to establish connection to web services host.
Escalated the issue with networking folks and they resolved the connectivity problem.
Hope that helps. -
ORA-29532 error when invoking SSL web services using UTL_DBWS
Web Service gurus,
The WSDL for web services is as follows -
<definitions name="Webservice" targetNamespace="http://webservice.airclic.com/">
−
<types>
−
<xs:schema targetNamespace="http://webservice.airclic.com/" version="1.0">
<xs:element name="Exception" type="tns:Exception"/>
<xs:element name="listenForEvents" type="tns:listenForEvents"/>
<xs:element name="listenForEventsResponse" type="tns:listenForEventsResponse"/>
<xs:element name="sendAuthenticationResponse" type="tns:sendAuthenticationResponse"/>
<xs:element name="sendAuthenticationResponseResponse" type="tns:sendAuthenticationResponseResponse"/>
<xs:element name="upsertTask" type="tns:upsertTask"/>
<xs:element name="upsertTaskResponse" type="tns:upsertTaskResponse"/>
−
<xs:complexType name="upsertTask">
−
<xs:sequence>
<xs:element minOccurs="0" name="task" type="tns:Task"/>
</xs:sequence>
</xs:complexType>
−
<xs:complexType name="Task">
−
<xs:complexContent>
−
<xs:extension base="tns:PlatformObject">
−
<xs:sequence>
<xs:element minOccurs="0" name="status" type="tns:status"/>
<xs:element minOccurs="0" name="assignee" type="xs:string"/>
<xs:element minOccurs="0" name="assigneeUserId" type="xs:string"/>
<xs:element minOccurs="0" name="name" type="xs:string"/>
<xs:element minOccurs="0" name="type" type="xs:string"/>
<xs:element minOccurs="0" name="creationTimestamp" type="xs:long"/>
<xs:element minOccurs="0" name="updateTimestamp" type="xs:long"/>
<xs:element minOccurs="0" name="startTimestamp" type="xs:long"/>
<xs:element minOccurs="0" name="endTimestamp" type="xs:long"/>
<xs:element minOccurs="0" name="source" type="tns:source"/>
<xs:element minOccurs="0" name="notes" type="xs:string"/>
<xs:element minOccurs="0" name="priority" type="xs:int"/>
<xs:element minOccurs="0" name="penalized" type="xs:boolean"/>
<xs:element minOccurs="0" name="hasSLA" type="xs:boolean"/>
<xs:element minOccurs="0" name="location" type="tns:Location"/>
<xs:element minOccurs="0" name="windowStartTimestamp" type="xs:long"/>
<xs:element minOccurs="0" name="windowEndTimestamp" type="xs:long"/>
<xs:element minOccurs="0" name="signee" type="xs:string"/>
<xs:element minOccurs="0" name="signature" type="xs:base64Binary"/>
<xs:element minOccurs="0" name="customerId" type="xs:string"/>
<xs:element minOccurs="0" name="travelTime" type="xs:int"/>
<xs:element minOccurs="0" name="expirationTimestamp" type="xs:long"/>
<xs:element minOccurs="0" name="parentId" type="xs:long"/>
<xs:element minOccurs="0" name="externalTimezone" type="xs:string"/>
<xs:element minOccurs="0" name="localTimeOffset" type="xs:long"/>
<xs:element minOccurs="0" name="consignee" type="xs:string"/>
<xs:element minOccurs="0" name="assignmentWindowStartTimestamp" type="xs:long"/>
<xs:element minOccurs="0" name="assignmentWindowEndTimestamp" type="xs:long"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
−
<xs:complexType name="PlatformObject">
−
<xs:sequence>
<xs:element name="id" type="xs:string"/>
<xs:element name="externalId" type="xs:string"/>
<xs:element name="revision" type="xs:long"/>
<xs:element name="platformDateCreated" type="xs:dateTime"/>
<xs:element name="platformDateUpdated" type="xs:dateTime"/>
<xs:element name="objectName" type="xs:string"/>
<xs:element maxOccurs="unbounded" name="extendedAttributes" type="tns:ExtendedAttribute"/>
</xs:sequence>
</xs:complexType>
−
<xs:complexType name="Location">
−
<xs:sequence>
<xs:element minOccurs="0" name="name" type="xs:string"/>
<xs:element minOccurs="0" name="description" type="xs:string"/>
<xs:element minOccurs="0" name="type" type="xs:string"/>
<xs:element minOccurs="0" name="address" type="tns:Address"/>
<xs:element minOccurs="0" name="position" type="tns:Position"/>
<xs:element minOccurs="0" name="geofenceId" type="xs:long"/>
<xs:element minOccurs="0" name="capcity" type="xs:int"/>
<xs:element minOccurs="0" name="contact" type="xs:string"/>
<xs:element minOccurs="0" name="email" type="xs:string"/>
</xs:sequence>
</xs:complexType>
−
<xs:complexType name="Address">
−
<xs:sequence>
<xs:element minOccurs="0" name="addressLine" type="xs:string"/>
<xs:element minOccurs="0" name="addressLine2" type="xs:string"/>
<xs:element minOccurs="0" name="city" type="xs:string"/>
<xs:element minOccurs="0" name="secondaryCity" type="xs:string"/>
<xs:element minOccurs="0" name="subdivision" type="xs:string"/>
<xs:element minOccurs="0" name="postalCode" type="xs:string"/>
<xs:element minOccurs="0" name="country" type="xs:string"/>
<xs:element minOccurs="0" name="phone" type="xs:string"/>
<xs:element minOccurs="0" name="freeform" type="xs:string"/>
</xs:sequence>
</xs:complexType>
−
<xs:complexType name="Position">
−
<xs:sequence>
<xs:element name="latitude" type="xs:double"/>
<xs:element name="longitude" type="xs:double"/>
</xs:sequence>
</xs:complexType>
−
<xs:complexType name="ExtendedAttribute">
−
<xs:sequence>
<xs:element name="name" type="xs:string"/>
<xs:element name="value" type="xs:anyType"/>
</xs:sequence>
</xs:complexType>
−
<xs:complexType name="upsertTaskResponse">
−
<xs:sequence>
<xs:element minOccurs="0" name="task" type="tns:Task"/>
</xs:sequence>
</xs:complexType>
−
<xs:complexType name="Exception">
−
<xs:sequence>
<xs:element minOccurs="0" name="message" type="xs:string"/>
</xs:sequence>
</xs:complexType>
−
<xs:complexType name="listenForEvents">
−
<xs:sequence>
<xs:element minOccurs="0" name="listenParams" type="tns:ListenParams"/>
</xs:sequence>
</xs:complexType>
−
<xs:complexType name="ListenParams">
−
<xs:sequence>
<xs:element name="queueName" type="xs:string"/>
<xs:element name="resendLast" type="xs:boolean"/>
</xs:sequence>
</xs:complexType>
−
<xs:complexType name="listenForEventsResponse">
−
<xs:sequence>
<xs:element maxOccurs="unbounded" minOccurs="0" name="events" type="tns:Event"/>
</xs:sequence>
</xs:complexType>
−
<xs:complexType name="Event">
−
<xs:sequence>
<xs:element name="id" type="xs:string"/>
</xs:sequence>
</xs:complexType>
−
<xs:complexType name="AuthenticationRequestEvent">
−
<xs:complexContent>
−
<xs:extension base="tns:RequestEvent">
−
<xs:sequence>
<xs:element name="username" type="xs:string"/>
<xs:element minOccurs="0" name="password" type="xs:string"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
−
<xs:complexType name="RequestEvent">
−
<xs:complexContent>
−
<xs:extension base="tns:Event">
−
<xs:sequence>
<xs:element name="correlationId" type="xs:string"/>
<xs:element name="response" type="tns:Response"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
−
<xs:complexType name="Response">
−
<xs:sequence>
<xs:element name="correlationId" type="xs:string"/>
</xs:sequence>
</xs:complexType>
−
<xs:complexType name="AuthenticationResponse">
−
<xs:complexContent>
−
<xs:extension base="tns:Response">
−
<xs:sequence>
<xs:element name="success" type="xs:boolean"/>
<xs:element name="username" type="xs:string"/>
<xs:element minOccurs="0" name="password" type="xs:string"/>
<xs:element minOccurs="0" name="firstName" type="xs:string"/>
<xs:element minOccurs="0" name="lastName" type="xs:string"/>
<xs:element minOccurs="0" name="email" type="xs:string"/>
<xs:element minOccurs="0" name="active" type="xs:boolean"/>
<xs:element minOccurs="0" name="timeZone" type="xs:string"/>
<xs:element minOccurs="0" name="group" type="xs:string"/>
<xs:element minOccurs="0" name="role" type="xs:string"/>
<xs:element minOccurs="0" name="errorCode" type="xs:string"/>
<xs:element minOccurs="0" name="errorMessage" type="xs:string"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
−
<xs:complexType name="DispatchEvent">
−
<xs:complexContent>
−
<xs:extension base="tns:Event">
−
<xs:sequence>
<xs:element name="type" type="tns:eventType"/>
<xs:element minOccurs="0" name="previousTask" type="tns:Task"/>
<xs:element name="changeTask" type="tns:Task"/>
<xs:element minOccurs="0" name="newTask" type="tns:Task"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
−
<xs:complexType name="sendAuthenticationResponse">
−
<xs:sequence>
<xs:element minOccurs="0" name="authenticationResponse" type="tns:AuthenticationResponse"/>
</xs:sequence>
</xs:complexType>
−
<xs:complexType name="sendAuthenticationResponseResponse">
<xs:sequence/>
</xs:complexType>
−
<xs:simpleType name="status">
−
<xs:restriction base="xs:string">
<xs:enumeration value="NULL"/>
<xs:enumeration value="UNASSIGNED"/>
<xs:enumeration value="ASSIGNED"/>
<xs:enumeration value="RECEIVED"/>
<xs:enumeration value="ACCEPTED"/>
<xs:enumeration value="REJECTED"/>
<xs:enumeration value="IN_PROGRESS"/>
<xs:enumeration value="POSTPONED"/>
<xs:enumeration value="COMPLETED"/>
<xs:enumeration value="CANCELED"/>
<xs:enumeration value="CLEARED"/>
<xs:enumeration value="EXPIRED"/>
</xs:restriction>
</xs:simpleType>
−
<xs:simpleType name="source">
−
<xs:restriction base="xs:string">
<xs:enumeration value="NULL"/>
<xs:enumeration value="DISPATCH"/>
<xs:enumeration value="SYSTEM"/>
<xs:enumeration value="ENDUSER"/>
</xs:restriction>
</xs:simpleType>
−
<xs:simpleType name="eventType">
−
<xs:restriction base="xs:string">
<xs:enumeration value="TaskCreated"/>
<xs:enumeration value="TaskUpdated"/>
<xs:enumeration value="TaskAssigned"/>
<xs:enumeration value="TaskDeleted"/>
<xs:enumeration value="TaskStatusChanged"/>
<xs:enumeration value="TaskConflicted"/>
</xs:restriction>
</xs:simpleType>
</xs:schema>
</types>
−
<message name="Webservice_listenForEvents">
<part element="tns:listenForEvents" name="listenForEvents"/>
</message>
−
<message name="Webservice_sendAuthenticationResponseResponse">
<part element="tns:sendAuthenticationResponseResponse" name="sendAuthenticationResponseResponse"/>
</message>
−
<message name="Webservice_sendAuthenticationResponse">
<part element="tns:sendAuthenticationResponse" name="sendAuthenticationResponse"/>
</message>
−
<message name="Webservice_upsertTaskResponse">
<part element="tns:upsertTaskResponse" name="upsertTaskResponse"/>
</message>
−
<message name="Exception">
<part element="tns:Exception" name="Exception"/>
</message>
−
<message name="Webservice_upsertTask">
<part element="tns:upsertTask" name="upsertTask"/>
</message>
−
<message name="Webservice_listenForEventsResponse">
<part element="tns:listenForEventsResponse" name="listenForEventsResponse"/>
</message>
−
<portType name="Webservice">
−
<operation name="listenForEvents" parameterOrder="listenForEvents">
<input message="tns:Webservice_listenForEvents"/>
<output message="tns:Webservice_listenForEventsResponse"/>
<fault message="tns:Exception" name="Exception"/>
</operation>
−
<operation name="sendAuthenticationResponse" parameterOrder="sendAuthenticationResponse">
<input message="tns:Webservice_sendAuthenticationResponse"/>
<output message="tns:Webservice_sendAuthenticationResponseResponse"/>
<fault message="tns:Exception" name="Exception"/>
</operation>
−
<operation name="upsertTask" parameterOrder="upsertTask">
<input message="tns:Webservice_upsertTask"/>
<output message="tns:Webservice_upsertTaskResponse"/>
<fault message="tns:Exception" name="Exception"/>
</operation>
</portType>
−
<binding name="WebserviceBinding" type="tns:Webservice">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
−
<operation name="listenForEvents">
<soap:operation soapAction=""/>
−
<input>
<soap:body use="literal"/>
</input>
−
<output>
<soap:body use="literal"/>
</output>
−
<fault name="Exception">
<soap:fault name="Exception" use="literal"/>
</fault>
</operation>
−
<operation name="sendAuthenticationResponse">
<soap:operation soapAction=""/>
−
<input>
<soap:body use="literal"/>
</input>
−
<output>
<soap:body use="literal"/>
</output>
−
<fault name="Exception">
<soap:fault name="Exception" use="literal"/>
</fault>
</operation>
−
<operation name="upsertTask">
<soap:operation soapAction=""/>
−
<input>
<soap:body use="literal"/>
</input>
−
<output>
<soap:body use="literal"/>
</output>
−
<fault name="Exception">
<soap:fault name="Exception" use="literal"/>
</fault>
</operation>
</binding>
−
<service name="Webservice">
−
<port binding="tns:WebserviceBinding" name="WebservicePort">
<soap:address location="https://webservice.mp.b.airclic.com:443/webservice/product/fieldservice/v1/Webservice"/>
</port>
</service>
</definitions>
Following is the pl/sql code using UTL_DBWS
DECLARE
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_input_params UTL_DBWS.anydata_list;
soap_request xmltype;
l_result xmltype;
result_output VARCHAR2(32767);
BEGIN
l_wsdl_url := 'https://webservice.mp.b.airclic.com/webservice/product/fieldservice/v1/Webservice?WSDL';
l_namespace := 'http://webservice.airclic.com/';
dbms_output.put_line ('1');
l_service_qname := UTL_DBWS.to_qname(l_namespace, 'Webservice');
dbms_output.put_line ('2');
l_port_qname := UTL_DBWS.to_qname(l_namespace, 'WebservicePort');
dbms_output.put_line ('3');
l_operation_qname := UTL_DBWS.to_qname(l_namespace, 'sendAuthenticationResponse');
dbms_output.put_line ('4');
l_service := UTL_DBWS.create_service (
wsdl_document_location => URIFACTORY.getURI(l_wsdl_url),
service_name => l_service_qname);
dbms_output.put_line ('5');
l_call := UTL_DBWS.create_call (
service_handle => l_service,
port_name => l_port_qname,
operation_name => l_operation_qname);
dbms_output.put_line ('6');
UTL_DBWS.SET_PROPERTY(l_call,'USERNAME',<username to access wsdl>);
dbms_output.put_line ('7');
UTL_DBWS.SET_PROPERTY(l_call,'PASSWORD',<password>);
dbms_output.put_line ('8');
utl_dbws.set_property(l_call,'OPERATION_STYLE', 'document');
dbms_output.put_line ('9');
soap_request := xmltype.createxml('<?xml version="1.0" encoding="UTF-8"?>
<S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/">
<S:Body>
<ns2:sendAuthenticationResponse xmlns:ns2="http://webservice.airclic.com/">
<authenticationResponse>
<correlationId>4646735802698040711:[email protected]</correlationId>
<success>true</success>
<username>changlanih</username>
<password>abcd1234</password>
<firstName>hero</firstName>
<lastName>changlani</lastName>
<email>[email protected]</email>
<active>true</active>
<timeZone>eastern</timeZone>
<group>Northeast</group>
<role>Service Manager</role>
</authenticationResponse>
</ns2:sendAuthenticationResponse>
</S:Body>
</S:Envelope>');
l_result := UTL_DBWS.invoke ( l_call,soap_request);
UTL_DBWS.release_call (call_handle => l_call);
UTL_DBWS.release_service (service_handle => l_service);
result_output := l_result.getstringval;
dbms_output.put_line('web svc output ===> ' || result_output);
END;
Following is the error from pl/sql code
1
2
3
4
DECLARE
ERROR at line 1:
ORA-29532: Java call terminated by uncaught Java exception: java.lang.IllegalAccessException: error.build.wsdl.model: oracle.j2ee.ws.common.tools.api.WsdlValidationException:
Failed to read WSDL from https://webservice.mp.b.airclic.com/webservice/product/fieldservice/v1/Webservice?WSDL:
HTTP connection error code is 401
ORA-06512: at "SYS.UTL_DBWS", line 193
ORA-06512: at "SYS.UTL_DBWS", line 190
ORA-06512: at line 20
Notes
The program fails at following line of code -
l_service := UTL_DBWS.create_service (
wsdl_document_location => URIFACTORY.getURI(l_wsdl_url),
service_name => l_service_qname);
Web services are SSL.
The WSDL is at https location and needs username/password for access. The username/password to access WSDL are set using UTL_DBWS.SET_PROPERTY
To access the SSL site, I have imported the CA in Oracle Wallet, JVM home and JDK home.
Can anyone tell me what am I doing wrong here. I am not able to even establish connection to web service host.
This is very frustrating - Oracle has no examples on how to access a SSL Web Service (that needs authentication) from Database.
This is effecting our project deadlines ......... any help would be greatly appreciated.
Thanks.Hi,
I presume your Web Service needs HTTP (BASIC?) Authentication.
All this needs is setting the following 2 properties, which as can be seen, you are setting....
UTL_DBWS.set_property(l_call, 'USERNAME', '<username>');
UTL_DBWS.set_property(l_call, 'PASSWORD', '<pwd>');
This should work as long as your DBWS Callout Utility was downloaded from OTN after June 2008, and it's version is atleast 10.1.3.1.
Following is a sample code snippet that was tested successfully for this :
Declare
l_service UTL_DBWS.service;
l_call UTL_DBWS.call;
l_result sys.XMLTYPE;
l_request sys.XMLTYPE;
BEGIN
l_service := UTL_DBWS.create_service(null);
l_call := UTL_DBWS.create_call(l_service);
UTL_DBWS.set_target_endpoint_address(l_call, 'http://xxx.oracle.com:8888/basic/MyWebService1SoapHttpPort');
UTL_DBWS.set_property(l_call, 'USERNAME', 'username');
UTL_DBWS.set_property(l_call, 'PASSWORD', 'pwd');
UTL_DBWS.set_property(l_call, 'OPERATION_STYLE', 'document');
UTL_DBWS.set_property(l_call, 'SOAPACTION_USE', 'true');
UTL_DBWS.set_property(l_call, 'SOAPACTION_URI', 'http://xxx.oracle.com:8888/basic/MyWebService1SoapHttpPort');
l_request := XMLTYPE('<Z_CENTRICITY_GET_DOCLIST
xmlns:urn="urn:sap-com:document:sap:rfc:functions">' ||
'<I_INCLUDE_OLD_VERSIONS></I_INCLUDE_OLD_VERSIONS>' ||
'<I_INSTITUTION>0001</I_INSTITUTION>' ||
'<I_PATIENT_NR>0000000181</I_PATIENT_NR>' ||
'</Z_CENTRICITY_GET_DOCLIST>');
l_result := UTL_DBWS.invoke(l_call, l_request);
UTL_DBWS.release_call (call_handle => l_call);
UTL_DBWS.release_service (service_handle => l_service);
EXCEPTION
WHEN OTHERS THEN
dbms_output.put_line(sqlcode || ' ' || sqlerrm);
END;
Hope this helps,
Yogesh -
Have Error invoking SSL web service using pl sql procedure
Hi All,
Please any one can tell where i am going wrong,in calling ssl soa web service from plsql procedure.
Below steps i followed ssl configure in soa server
1- For configuring ssl in soa 11g, i am going to weblogic console->environment-> servers-> soa_server1-> check ssl box of port 8002.
2- restart the server.
3- One process i devloped, deployed in em console, while trying to acces the service with 8002 port, i need to use https://servicepath.
Is there is any problem in the above approch for configuring ssl in soa server.
Now coming to the procedure part, in below i given the deatails
DECLARE
HTTP_REQ UTL_HTTP.REQ;
HTTP_RESP UTL_HTTP.RESP;
URL_TEXT VARCHAR2(32767);
lv_process_xml_body varchar2(4000);
BEGIN
DBMS_OUTPUT.ENABLE(1000000);
lv_process_xml_body:='<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body xmlns:ns1="http://xmlns.oracle.com/SOA_RND_jws/Sample/DemoBPELProcess">
<ns1:process>
<ns1:input></ns1:input>
</ns1:process>
</soap:Body>
</soap:Envelope>';
UTL_HTTP.SET_WALLET('file:/db/oracle/app/oradb/product/11.2.0/dbhome_1/bin/client', 'abcd123');
HTTP_REQ := UTL_HTTP.BEGIN_REQUEST('https://172.28.40.20:8002/soa-infra/services/Client/Sample/demobpelprocess_client_ep', 'POST' , 'HTTP/1.0');
UTL_HTTP.set_header(http_req, 'Content-Type', 'text/xml');
UTL_HTTP.set_header(http_req, 'Content-Length', LENGTH(lv_process_xml_body));
UTL_HTTP.SET_HEADER(HTTP_REQ, 'SOAPAction', 'process');
UTL_HTTP.write_text(http_req, lv_process_xml_body);
HTTP_RESP := UTL_HTTP.GET_RESPONSE(HTTP_REQ);
UTL_HTTP.END_RESPONSE(HTTP_RESP);
dbms_output.put_line('success');
exception
when others then
dbms_output.put_line(sqlerrm);
END;
But i am getting the error, unable to open the file
Regarding certificate i have taken from the browser while running the above soa service in browser with 8002 port.
Please let me know where i am doing wrong...
Please if some one knows about steps ...... to do it to work
Its urgent please help me out on this
Thanks
Dillip
Edited by: 903915 on Dec 21, 2011 9:51 PM
Edited by: 903915 on Dec 21, 2011 10:11 PMOracle is hosted by HOST A - this is where the pl/sql program resides.
The Web Service being accessed by pl/sql program is hosted by HOST B and there are 4 firewalls in between.
Oracle was not even able to establish connection to web services host.
Escalated the issue with networking folks and they resolved the connectivity problem.
Hope that helps. -
Invoking P6 web services using PL/SQL block
Hi Team,
We have requirement like
Oracle jobs will invoke PL/SQL code to authenticate and establish a session with the P6 Web services.
Web service will export Project data from One Primavera database as an XML and copy to common location.
Then this XML project files will be imported into archive database.
Could anyone help me how I can establish sessio between Pl/SQL and P6 webservices?
Please let me know if you need any more information.
Regards,
Santosh
Edited by: SantoshV Singh on Apr 29, 2013 10:09 PMIt will be no different than connecting to any web services through PL/SQL which is pretty hard to do and if you are asking how to do it then you have a steep learning curve ahead of you and not a great deal in the way of good examples out there.
I wouldn't even attempt the approach you suggest. Instead I would probably write a Java application to do it and use your PL/SQL to enqueue a message that routed to the Java application. Then the java application with the Web Services support and P6 client would be easier to do what you want with web services. -
Is it possible to call an external web service using ABAP?
Hi~~
I wonder that is possible to use an external web service in SAPGUI using ABAP without PI ( Process Integraion ).
The external web service means the service that is developed by web-language like ASP.NET.
Thank you.hi,
i'm trying to study on how to use the oracle bi publisher using another client application aside from oracle. the client application is custom and uses a .Net framework. unfortunately, i am not familiar with how .Net sends requests to oracle bi publisher so i was thinking that may be i can just create oracle pl/sql stored procedures that can send this requests over to bi publisher.
p.s. when you said concurrent manager, i'm not sure if you are referring to oracle apps concurrent manager but if you are, unfortunately i won't be using oracle apps with bi publisher.
thanks
allen -
How to make use of a web service using ABAP to transfer data to portal?
Hello Experts,
I've a requirement to call/use a web service from a user exit, and need to transfer/update some data to the ESS portal.
Kindly let me know what are the steps involved?
Thanks & Regards,
MallikHi John,
I did searched te forums and got some information on this.
But I didnot understand it completely. I'm looking for a step by step process.
Kindly let me know if you have anything useful for me.
Thanks & Regards,
Mallik -
Invoking a web Service using Service Control
Hi All,
I am getting the below exception when I am trying to execute a process containing a simple Service Control generated using a WSDL file.
Any thoughts/solutions is appreciated.
Exception in getPendingOrdersForApprover
com.bea.control.ServiceControlException: Unexpected exception raised invoking getPendingOrdersForApprover on control com.verisign.controls.MSL_ORDERSoapServiceControl. Use getCause() to see the root cause.[java.rmi.RemoteException: Failed to invoke; nested exception is:
weblogic.wsee.handler.InvocationException: [Client CodecHandler]Failed to decode]
Caused by: java.rmi.RemoteException: Failed to invoke; nested exception is:
weblogic.wsee.handler.InvocationException: [Client CodecHandler]Failed to decode
... 38 more
Caused by: weblogic.wsee.handler.InvocationException: [Client CodecHandler]Failed to decode
... 44 more
Caused by: weblogic.wsee.codec.CodecException: Found more elements in the soap envelope than required by WSDL:{ld:Physical/MSL_ORDER}MSL_ORDER. WSDL Message for this operation is: (WsdlBindingMessage@20764897 <name=> <type=1> <extensionList=(NameValueList@29534392 <list[]{(SoapBody@13827654 <encodingStyle=null> <use=literal> <namespace=null> <parts=null>)}>)>)
... 53 more
at com.bea.control.servicecontrol.impl.ServiceControlImpl.invoke(ServiceControlImpl.java:678)
at com.verisign.controls.MSL_ORDERSoapServiceControlBean.getPendingOrdersForApprover(MSL_ORDERSoapServiceControlBean.java:323)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at com.bea.wli.knex.runtime.jcs.container.JcsProxy.invokeBeehiveControl(JcsProxy.java:666)
at com.bea.wli.knex.runtime.jcs.container.JcsProxy.invoke(JcsProxy.java:446)
at $Proxy71.getPendingOrdersForApprover(Unknown Source)
at com.verisign.processes.WebServiceInvokeProcess.mSL_ORDERSoapServiceControlGetPendingOrdersForApprover(WebServiceInvokeProcess.jws:48)
Thanks,
RamI solved the problem :-)
it happened due to JAVA_HOME env var. It has to point to jdk that comes along with wl812. mine was pointing to sun jdk 1.4.2. However, this is a bug, because, for wlwlbuild task , i was setting the proper bea java home, still it was failing due to system java_home var. And i did not face this problem with WL813. After facing lot of issues with 812, now i feel, 812 is not a stable production version.
Anyways, now the prob;em is solved. -
Hello All,
APEX Version: 4.0.2.00.07
DB: Oracle 11G R2
WebServer: EPG
Wallet info has been configured at APEX Instance Level, so APEX can access SSL enabled sites.
When I run following code in page process, to make SOAP request to our intranet JIRA instance, everything just works fine.
DECLARE
l_envelope CLOB;
l_xml XMLTYPE;
lv_faultcode VARCHAR2(4000);
lv_faultstring VARCHAR2(4000);
BEGIN
l_envelope := '<?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" xmlns:m0="http://beans.soap.rpc.jira.atlassian.com">'
||'<SOAP-ENV:Body>'
||' <m:getIssuesFromFilterWithLimit xmlns:m="http://soap.rpc.jira.atlassian.com" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">'
||' <in0>'||:F_JIRA_TOKEN||'</in0>'
||' <in1>'||HTF.escape_sc(:P4_IN1)||'</in1>'
||' <in2>'||HTF.escape_sc(:P4_IN2)||'</in2>'
||' <in3>'||HTF.escape_sc(:P4_IN3)||'</in3>'
||' </m:getIssuesFromFilterWithLimit>'
||' </SOAP-ENV:Body>'
||'</SOAP-ENV:Envelope>';
l_xml := APEX_WEB_SERVICE.MAKE_REQUEST(
p_url => 'https://jira.xyz.com/tracker/rpc/soap/jirasoapservice-v2',
p_action => 'https://jira.xyz.com/tracker/rpc/soap/jirasoapservice-v2/getIssuesFromFilterWithLimit',
p_envelope => l_envelope
END;However If i'm calling a RESTful webserivce using "apex_web_service" API then I always end-up with following error message.
The webservice was unreachable because either the URL you supplied was invalid, your environment requires a valid proxy server address for HTTP requests, or a wallet needs to be configured for HTTPS requests.Code (RESTful call)
DECLARE
lc_response CLOB;
BEGIN
apex_web_service.g_request_headers(1).name := 'Authorization';
apex_web_service.g_request_headers(1).value := 'Basic '||:F_JIRA_TOKEN_REST;
lc_response:= APEX_WEB_SERVICE.MAKE_REST_REQUEST(
p_url => 'https://jira.xyz.com/tracker/rest/api/2.0.alpha1/search?jql=assignee=John&startAt=1&maxResults=5',
p_http_method => 'GET'
END;As you can see, both requests are made to same server. However during SOAP request I'm not getting any error, but during RESTful request I'm getting error. Can anyone tell me what could be wrong?
Best Regards,
HariHi Hari,
this was bug 16212066 - apex_web_service make_rest_request doesn't use instance wallet if not specified
which will be fixed in APEX 4.2.2.
As a workaround you can specify the p_wallet_path and p_wallet_pwd parameter when calling apex_web_service.make_rest_request.
Regards
Patrick
My Blog: http://www.inside-oracle-apex.com
APEX Plug-Ins: http://apex.oracle.com/plugins
Twitter: http://www.twitter.com/patrickwolf -
Invoking web service using Weblogic Workshop (JCX)
Invoking web service using Weblogic Workshop
Posted: 5 Jan 2005 23:31 PM Reply
Hi,
I have WSDL from which I have generated a web service control (.jcx) using Weblogic Workshop.
I need to write a client which will invoke the web service using the control.
Can someone help me on how to go about this ?
BTW .. I also tried the clientgen route and tried to generated the proxy jar from the WSDL but wasn't successful because of a existing clientgen bug.
Refer bugHi,
if the consumer of the webservice is a control-aware consumer ( pageflow, control, process ) simply drag the control to this consumer and the control variable is ready for use.
if the consumer is not control-aware, try to generate a proxy using eg. the axis tool, or handcode your proxy class.
links :
how to use webservice control
http://e-docs.bea.com/workshop/docs81/doc/en/workshop/guide/controls/conGettingStartedWithJavaControls.html
axis
http://ws.apache.org/axis/
- Anders M.
- Anders M. -
How to invoke a web service asynchronously using ws-addressing model?
Hi Gurus,
We are invoking an external web service asynchronously using Oracle Work Flow Business events using the following mechanism -
1)Created a web service invoker event to invoke the web service.
2)Created a subscription that invokes the web service (provided the wsdl address, operation info).
3)Defined a subscription parameter WFBES_CALLBACK_EVENT with value pointing to a recieve event.
4)Created a receive event(parameter value for WFBES_CALLBACK_EVENT) and a subscription that directs the response to a custom PL/SQL function to process response.
so far so good. We were able to invoke the web service and get and process the response.
Problem: The external web service can take upto 10 hrs to process the request. A time out of 2 hrs is set on the server hosting the external web service. So when the external web service takes more than 2 hrs to process the request and it times out and we get the following error on EBS side -
'l_error_message:oracle.apps.fnd.wf.bes.InvokerException: HTTP transport error: javax.xml.soap.SOAPException: java.security.PrivilegedActionException: oracle.j2ee.ws.saaj.ContentTypeException: Not a valid SOAP Content-Type: text/html; charset=iso-8859-1'
Now the external web service providers are suggesting that we are not calling their web service asynchronously and we should use ws-addressing model to do so.
Is there a way to invoke this web service using ws-addressing model using business events or from PL/SQL or OA middle-tier?
Regards,
Sunil
CMRO Development.
I am providing here the WSDL of the external web service -
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions targetNamespace="http://service.sdk.webservices.enigma.com" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:ns1="http://org.apache.axis2/xsd" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:ax21="http://service.sdk.webservices.enigma.com/xsd" xmlns:ns="http://service.sdk.webservices.enigma.com" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
<wsdl:types>
<xs:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://service.sdk.webservices.enigma.com/xsd" xmlns:ax22="http://service.sdk.webservices.enigma.com">
<xs:import namespace="http://service.sdk.webservices.enigma.com"/>
<xs:complexType name="JCGWebServicesException">
<xs:complexContent>
<xs:extension base="ax22:Exception">
<xs:sequence>
<xs:element minOccurs="0" name="id" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="message" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="JCGServiceReply">
<xs:sequence>
<xs:element maxOccurs="unbounded" minOccurs="0" name="pdfStatus" nillable="true" type="ax21:PdfStatus"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="PdfStatus">
<xs:sequence>
<xs:element minOccurs="0" name="jobCardID" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="pdfPath" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="status" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
<xs:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://service.sdk.webservices.enigma.com" xmlns:ax23="http://service.sdk.webservices.enigma.com/xsd">
<xs:import namespace="http://service.sdk.webservices.enigma.com/xsd"/>
<xs:complexType name="Exception">
<xs:sequence>
<xs:element minOccurs="0" name="Exception" nillable="true" type="xs:anyType"/>
</xs:sequence>
</xs:complexType>
<xs:element name="JCGWebServicesException">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="JCGWebServicesException" nillable="true" type="ax21:JCGWebServicesException"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="runJobCard">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="a_WorkpackageFilePath" nillable="true" type="xs:string"/>
<xs:element minOccurs="0" name="a_userName" nillable="true" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="runJobCardResponse">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="return" nillable="true" type="ax21:JCGServiceReply"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
</wsdl:types>
<wsdl:message name="JCGWebServicesException">
<wsdl:part name="parameters" element="ns:JCGWebServicesException">
</wsdl:part>
</wsdl:message>
<wsdl:message name="runJobCardResponse">
<wsdl:part name="parameters" element="ns:runJobCardResponse">
</wsdl:part>
</wsdl:message>
<wsdl:message name="runJobCardRequest">
<wsdl:part name="parameters" element="ns:runJobCard">
</wsdl:part>
</wsdl:message>
<wsdl:portType name="JCGServicePortType">
<wsdl:operation name="runJobCard">
<wsdl:input message="ns:runJobCardRequest" wsaw:Action="urn:runJobCard">
</wsdl:input>
<wsdl:output message="ns:runJobCardResponse" wsaw:Action="urn:runJobCardResponse">
</wsdl:output>
<wsdl:fault name="JCGWebServicesException" message="ns:JCGWebServicesException" wsaw:Action="urn:runJobCardJCGWebServicesException">
</wsdl:fault>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="JCGServiceSoap11Binding" type="ns:JCGServicePortType">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="runJobCard">
<soap:operation soapAction="urn:runJobCard" style="document"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
<wsdl:fault name="JCGWebServicesException">
<soap:fault name="JCGWebServicesException" use="literal"/>
</wsdl:fault>
</wsdl:operation>
</wsdl:binding>
<wsdl:binding name="JCGServiceSoap12Binding" type="ns:JCGServicePortType">
<soap12:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="runJobCard">
<soap12:operation soapAction="urn:runJobCard" style="document"/>
<wsdl:input>
<soap12:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap12:body use="literal"/>
</wsdl:output>
<wsdl:fault name="JCGWebServicesException">
<soap12:fault name="JCGWebServicesException" use="literal"/>
</wsdl:fault>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="JCGService">
<wsdl:port name="JCGServiceHttpSoap12Endpoint" binding="ns:JCGServiceSoap12Binding">
<soap12:address location="http://localhost:8080/JCG/services/JCGService"/>
</wsdl:port>
<wsdl:port name="JCGServiceHttpSoap11Endpoint" binding="ns:JCGServiceSoap11Binding">
<soap:address location="http://localhost:8080/JCG/services/JCGService"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
Edited by: sikumar on Jun 22, 2010 1:50 PMBharat,
You dont need a Business Event setup to invoke a BPEL process from PL/SQL unless you have a special case and you need to process the response from the BPEL process in a separate thread (or in background)..
For a straight call to BPEL process from PL/SQL, here is a sample script -
function "MYTEST0" return varchar2 AS
soap_request varchar2(30000);
soap_respond varchar2(30000);
http_req utl_http.req;
http_resp utl_http.resp;
resp XMLType;
i integer;
helpStr varchar2(30000);
BEGIN
soap_request:= '<?xml version = ''1.0'' encoding = ''UTF-8''?>
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ns0="
http://xmlns.oracle.com/TestWS">
<env:Body>
<ns0:TestWSProcessRequest>
<ns0:input>abc</ns0:input>
</ns0:TestWSProcessRequest>
</env:Body>
</env:Envelope>
/* the BPEL process name is TestWS */
http_req:= utl_http.begin_request
( 'http://hostname:7777/orabpel/default/TestWS/1.0'
, '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, 'SOAPAction', 'process');
utl_http.write_text(http_req, soap_request);
http_resp:= utl_http.get_response(http_req);
utl_http.read_text(http_resp, soap_respond);
utl_http.end_response(http_resp);
resp:= XMLType.createXML(soap_respond);
resp:= resp.extract('/soap:Envelope/soap:Body/child::node()',
'xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"');
helpStr := '';
i:=0;
loop
helpStr := helpStr || substr(soap_respond,1+ i*255,250);
i:= i+1;
if i*250> length(soap_respond)
then
exit;
end if;
end loop;
return helpStr;
END;
Maybe you are looking for
-
Is iPod compatible with windows media player 11?
Hello, is iPod compatible with windows mediaplayer 11?
-
Saving modifled ARGB values in an Integer array to a jpeg file?
Hi, I have searched sites and forums and it seems that the key to this is to use BufferedImage and Graphics's drawImage(). But how can I use the drawImage when I only have an array of integer values? I went through the docs and seems that BufferedIma
-
Without BPM:Call RFC using JCO in interface mapping using java mapping
Hi all I have a very small scenario where REQUEST from the customer comes via Web Service all i have to do is to read the request using SOAP adapter and call an interface mapping(lets say the name is IM_TEST) inside which there is a JAVA MAPPING prog
-
Can't figure what is wrong with this code. Any ideas? My page is blank unless I remove this code. If I remove the below code the page shows the form and the list boxes but the last dependent list box is not functioning properly... <!-- Dynamic Depend
-
Zen V Plus "Cannot Install this Hardware - A service installation section in the INF is inva
I hate to play the "poor helpless female" , but at age 65 that's exactly what I am . I've had my player for 2 /2 weeks, and yesterday I re-charged my battery for the first time. Ever since then, my player cannot be recognized by my computer. I've uns