APEX 3.0.1 fails to consume Web Services
I am running APEX 3.0.1 in a 10.2.0.2 EE database on Windows XP.
I am trying to get APEX to use a simple web service that I have created in BPEL. The web service functions perfectly in SoapUI.
APEX seems to be using the response document rather than the request document when invoking the service.
Here is the request generated by APEX:
<inputVariable><part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="payload"><ns1:Item xmlns:ns1="http://TargetNamespace.com/GetItemResponse">
<ns1:SETID>SHARE</ns1:SETID>
<ns1:ITEM_ID>810002</ns1:ITEM_ID>
</ns1:Item>
</part></inputVariable>
Here is the request generated by SoapUI:
<inputVariable><part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="payload"><get:Item xmlns:get="http://TargetNamespace.com/GetItemRequest">
<get:SETID>SHARE</get:SETID>
<get:ITEM_ID>810002</get:ITEM_ID>
</get:Item>
</part></inputVariable>
The primary difference is that APEX is referencing GetItemResponse rather than GetItemRequest.
Here is the WSDL:
<definitions name="ItemGet" targetNamespace="http://xmlns.oracle.com/ItemGet" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://xmlns.oracle.com/ItemGet" xmlns:ns1="http://TargetNamespace.com/GetItemRequest" xmlns:plnk="http://schemas.xmlsoap.org/ws/2003/05/partner-link/" xmlns:ns2="http://TargetNamespace.com/GetItemResponse" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:client="http://xmlns.oracle.com/ItemGet">
<types>
<schema xmlns="http://www.w3.org/2001/XMLSchema">
<import namespace="http://TargetNamespace.com/GetItemRequest" schemaLocation="GetItemRequest.xsd"/>
</schema>
<schema xmlns="http://www.w3.org/2001/XMLSchema">
<import namespace="http://TargetNamespace.com/GetItemResponse" schemaLocation="GetItemResponse.xsd"/>
</schema>
</types>
<message name="ItemGetRequestMessage">
<part name="payload" element="ns1:Item"/>
</message>
<message name="ItemGetResponseMessage">
<part name="payload" element="ns2:Root-Element"/>
</message>
<portType name="ItemGet">
<operation name="process">
<input message="tns:ItemGetRequestMessage"/>
<output message="tns:ItemGetResponseMessage"/>
</operation>
</portType>
<binding name="ItemGetBinding" type="tns:ItemGet">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="process">
<soap:operation style="document" soapAction="process"/>
<input>
<soap:body use="literal"/>
</input>
<output>
<soap:body use="literal"/>
</output>
</operation>
</binding>
<service name="ItemGet">
<port name="ItemGetPort" binding="tns:ItemGetBinding">
<soap:address location="http://xpvm.us.oracle.com:8888/orabpel/default/ItemGet/1.0"/>
</port>
</service>
<plnk:partnerLinkType name="ItemGet">
<plnk:role name="ItemGetProvider">
<plnk:portType name="tns:ItemGet"/>
</plnk:role>
</plnk:partnerLinkType>
</definitions>
As you can see from the WSDL, the input message is tns:ItemGetRequestMessage and the output is tns:ItemGetResponseMessage.
The APEX design time environment is accurately recognizing ItemRequest for the input parameters and ItemResponse for the output parameters.
It looks like a potential APEX bug.
Anyone run into this? Anyone have any suggestions?
Thanks!
Kurt
Kurt:
It does look like a bug. I can offer the following workaround.
Create a Manual Web reference as described here:
http://download-west.oracle.com/docs/cd/B32472_01/doc/appdev.300/b32471/advnc.htm#BABCBBHJ
section "Creating a Web Service Manually"
based on the WSDL below, you would enter the following for URL and Action:
URL: http://xpvm.us.oracle.com:8888/orabpel/default/ItemGet/1.0
Action: process
Also, enter a name for an APEX collection to store the response, such as GET_ITEM_RESPONSE.
For the SOAP Envelope, paste in the one that works from SOAPUI or use BPEL Control to get the envelope. Instead of static values for the parameters you use #ITEM_NAME# substitutions. So if the page generated by the wizard was on page 1, it would look something like:
<inputVariable><part xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="payload"><get:Item xmlns:get="http://TargetNamespace.com/GetItemRequest">
<get:SETID>#P1_SETID#</get:SETID>
<get:ITEM_ID>#P1_ITEM_ID#</get:ITEM_ID>
</get:Item>
</part></inputVariable>
(with the proper SOAP Envelope wrapper around it)
Now go to page 1 (assuming that was the page created by the wizard) and remove the current process of type Web service on that page. Add a new process of type Web service, choose Manual, and choose the manual one you created above.
Follow the instructions in the section titled "Displaying Web Service Results in a Report" at the link above to create a report on the result.
There is also an advanced tutorial using Manual Web references you may wish to review:
http://download-west.oracle.com/docs/cd/B32472_01/doc/appdev.300/b32469/web_serv.htm#CHDEFEGH
Hope that helps,
Jason
Similar Messages
-
Failed to consume web service having datetime and date fields
Hi everyone,
We are trying to consume .net webservices which are exposed in SAP. But while cretaing proxy we having issues which is showing error shown below
XSD date doesnot exactly corresponds to the ABAP type DATS
XSD type dateTime does not exactly correspond to the ABAP type String.
cheers
ramBelow is the code to add security header.
public List<String> lookup(String lenderid, String url, String user, String pw) throws SOAPException {
SOAPHeader header = message.getSOAPHeader();
if (header == null) {
header = envelope.addHeader();
SOAPElement headerElement = createSecurityHeader(uName, pWord);
soapHeader.addChildElement(headerElement);.................
private static SOAPElement createSecurityHeader(String uName,String pWord) throws SOAPException {
SOAPElement UsernameToken = null;
SOAPFactory sFactory = SOAPFactory.newInstance();
UsernameToken = sFactory.createElement("wsse:UsernameToken", "", WS);
SOAPElement Username = sFactory.createElement("wsse:Username","", WS);
Username.setValue(uName);
UsernameToken.addChildElement(Username);
SOAPElement Password = sFactory.createElement("wsse:Password","",WS);
Password.setValue(pWord);
QName qname = new QName("","Type");
Password.addAttribute(qname,"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText");
UsernameToken.addChildElement(Password);
SOAPElement wsseSecurity = sFactory.createElement("wsse:Security","",WS);
wsseSecurity.addChildElement(UsernameToken);
return wsseSecurity; -
Consume web service in ABAP proxy with SOAP header
Hi Thomas ,
I am trying to consume web service in ABAP . I have followed the procedure from one of your web blog <a href="/people/thomas.jung3/blog/2004/11/17/bsp-a-developers-journal-part-xiv--consuming-webservices-with-abap a Developer's Journal Part XIV - Consuming WebServices with ABAP</a> . (640 release).
I need to pass SOAP header along with SOAP body. As you mentioned I have used if_wsprotocol_ws_header interface to pass header but it is still failing.
Please see below code and please give some direction to fix the issue.
1.Create ABAP proxy for WSDL (http://ws.strikeiron.com/SwanandMokashi/StockQuotes?WSDL). It has created structures only for SOAP body.
2.Create Logical port
3.Create following program to call proxy
REPORT zproxy.
DATA: ref_stock TYPE REF TO zzco_stock_quotes_soap ,
ws_header TYPE REF TO if_wsprotocol_ws_header,
name TYPE string,
namespace TYPE string.
TRY.
CREATE OBJECT ref_stock
get WS_HEADER protocol
ws_header ?= ref_stock->get_protocol('IF_WSPROTOCOL_WS_HEADER').
set somehow header as iXML-DOM tree
DATA: ixml TYPE REF TO if_ixml,
xml_document TYPE REF TO if_ixml_document,
xml_root TYPE REF TO if_ixml_element,
xml_element TYPE REF TO if_ixml_element,
xml_node TYPE REF TO if_ixml_node.
DATA l_xstring TYPE xstring.
DATA l_string TYPE string.
FIELD-SYMBOLS <fs_xstring> TYPE xstring.
Additional Header:
CONCATENATE
'<soap:Header>'
'<s1:LicenseInfo xmlns:s1="http://ws.strikeiron.com">'
'<s1:RegisteredUser>'
'<s1:UserID>[email protected]</s1:UserID>'
'<s1:Password>aaaaaaaa</s1:Password>'
'</s1:RegisteredUser></s1:LicenseInfo>'
'</soap:Header>' INTO l_string.
convert to xstring
l_xstring = cl_proxy_service=>cstring2xstring( l_string ).
IF NOT l_string IS INITIAL.
create iXML DOM document from XML xstring
CALL FUNCTION 'SDIXML_XML_TO_DOM'
EXPORTING
xml = l_xstring
IMPORTING
document = xml_document
EXCEPTIONS
invalid_input = 1
OTHERS = 2.
IF sy-subrc = 0 AND NOT xml_document IS INITIAL.
xml_root = xml_document->get_root_element( ).
xml_element ?= xml_root->get_first_child( ).
add header element by element to SOAP header
WHILE NOT xml_element IS INITIAL.
name = xml_element->get_name( ).
namespace = 'http://swanandmokashi.com' . "xml_element->get_namespace_uri( ).
IF NOT xml_element IS INITIAL.
ENDIF.
ws_header->set_request_header(
name = name
namespace = namespace
dom = xml_element ).
xml_element ?= xml_element->get_next( ).
ENDWHILE.
ENDIF.
ENDIF.
CATCH cx_ai_system_fault .
ENDTRY.
*Call soap body using abap proxy class.
DATA: get_quotes TYPE zzget_quotes_soap_out .
DATA: get_quotes1 TYPE zzget_quotes_soap_in .
get_quotes1-quote_ticker = 'GE'.
TRY.
CALL METHOD ref_stock->get_stock_quotes
EXPORTING
get_quotes1 = get_quotes1
IMPORTING
get_quotes = get_quotes.
CATCH cx_ai_system_fault .
CATCH cx_ai_application_fault .
ENDTRY.
4.It is throwing cx_ai_system_fault error.
SOAP details:
Input:
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:enc="http://schemas.xmlsoap.org/soap/encoding" >
<soap:Header>
<s1:LicenseInfo xmlns:s1="http://ws.strikeiron.com">
<s1:RegisteredUser>
<s1:UserID>[email protected]</s1:UserID>
<s1:Password>aaaaaaaa</s1:Password>
</s1:RegisteredUser>
</s1:LicenseInfo>
</soap:Header>
<soap:Body>
<tns:GetQuotes xmlns:tns="http://swanandmokashi.com">
<tns:QuoteTicker>GE</tns:QuoteTicker>
</tns:GetQuotes>
</soap:Body>
</soap:Envelope>
Thanks,
Kavitha.Hi ,
Thank you for the response. Did you passed user email and password ([email protected] /aaaaaaaa) part of licenseinfo->resisteredUser along with Quoteticker GE in analyzer?
<a href="http://www.strikeiron.com/Analyzer/OnlineAnalyzer.aspx?WSDL=http://ws.strikeiron.com/SwanandMokashi/StockQuotes?WSDL">ANALYZER</a>
Thanks,
Kavitha. -
Unable to consume web service. LPX-00104: Warning: element "html"
Dear All,
I am new to this posting stuff. Right away i desperate need help from you guys. I am using pl/sql to consume web service initially it was working fine but not it's throwing the exception i.e.
ORA-06502: PL/SQL: numeric or value error: character string buffer too small
ORA-31011: XML parsing failed
ORA-19202: Error occurred in XML processing
LPX-00104: Warning: element "html" is not declared in the DTD
Error at line 2
Please assist.
Regards,
Muhammad Naseer.
Edited by: m_naseer on Jan 21, 2011 2:47 AMthanks for reply,
following is the version
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
PL/SQL Release 10.2.0.4.0 - Production
"CORE 10.2.0.4.0 Production"
TNS for Solaris: Version 10.2.0.4.0 - Production
NLSRTL Version 10.2.0.4.0 - Production
XML Error is
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Error Report</title>
<style>
td {font-family : Arial, Tahoma, Helvetica, sans-serif; font-size : 14px;}
A:link {color : #0059AA;}
A:visited {color : #999999;}
A:active {color : #999999;}
</style>
</head>
<body marginwidth="0" marginheight="0" leftmargin="0" topmargin="0" rightmargin="0">
<table width="100%" cellspacing="0" cellpadding="0" border="0" align="left" height="75">
<tr bgcolor="#FFFFFF">
<td align="left" colspan="2" height="48"><font face="Arial, Verdana, Helvetica" size="4" color="#666666"><b> 404   Not Found</b></font></td>
</tr>
<tr bgcolor="#3F73A3">
<td height="23" width="84"><img width=1 height=1 border=0 alt=""></td>
<td height="23"><img width=1 height=1 border=0 alt=""></td>
<td align="right" height="23"><font face="Arial, Verdana, Helvetica" size="2" color="#FFFFFF"><b>SAP J2EE Engine/7.00 </b></font></td>
</tr>
<tr bgcolor="#9DCDFD">
<td height="4" colspan="3"><img width=1 height=1 border=0 alt=""></td>
</tr>
</table>
<br><br><br><br><br><br>
<table width="100%" cellspacing="0" cellpadding="0" border="0" align="left" height="75">
<tr bgcolor="#FFFFFF">
<td align="left" colspan="2" height="48"><font face="Arial, Verdana, Helvetica" size="3" color="#000000"><b> The requested resource does not exist.</b></font></td>
</tr>
<tr bgcolor="#FFFFFF">
<td align="left" valign="top" height="48"><font face="Arial, Verdana, Helvetica" size="2" color="#000000"><b> Details:</b></font></td>
<td align="left" valign="top" height="48"><font face="Arial, Verdana, Helvetica" size="3" color="#000000"><pre> Go to main page of this application!</pre></font></td>
</tr>
</body>
</html>
-31011
ORA-31011: XML parsing failed
ORA-19202: Error occurred in XML processing
LPX-00104: Warning: element "html" is not declared in the DTD
Error at line 2
Code is perfect is at was working but some thing may be bad has just happen that it is not working now.
Thanks in advance -
Error running demo PL/SQL consuming web services
I downloaded and installed the code from:
http://technet.oracle.com/tech/webservices/htdocs/samples/dbwebservice/DBWebServices_PLSQL.html
on Oracle 9i version 2 (on both Windows and Solaris).
But I got the following error running the local time
demo:
ORA-29273: HTTP request failed
ORA-06512: at "SYS.UTL_HTTP", line 1022
ORA-12545: Connect failed because target host or object does not exist
ORA-06512: at "XN.DEMO_SOAP", line 72
ORA-06512: at "XN.TIME_SERVICE", line 13
ORA-06512: at line 2
The error occurs on this line:
http_req := utl_http.begin_request(url, 'POST','HTTP/1.0');
Can anybody tell me what I do wrong? Thanks a lot!
Also, is there any alternative ways to consume web services
using PL/SQL only? Many thanks!
Henry X.Mike,
Thanks so much for your help. I tried your code just now.
Same error:
ORA-30625: method dispatch on NULL SELF argument is disallowed
ORA-06512: at "XN.DEMO_SOAP", line 50
ORA-06512: at "XN.DEMO_SOAP", line 83
ORA-06512: at "XN.TIME_SERVICE", line 27
ORA-06512: at line 7
Let me post the code I am using. Note that
I removed the code for using proxy in time_service.
Henry
-- code for calling the time_service
DECLARE
ZIPCODE VARCHAR2(200);
v_Return VARCHAR2(200);
BEGIN
ZIPCODE := '94065';
v_Return := TIME_SERVICE.GET_LOCAL_TIME(ZIPCODE => ZIPCODE);
DBMS_OUTPUT.PUT_LINE('v_Return = ' || v_Return);
END;
-- code for the package demo_soap
CREATE OR REPLACE PACKAGE demo_soap AS
TYPE request IS RECORD (
method VARCHAR2(256),
namespace VARCHAR2(256),
body VARCHAR2(32767));
TYPE response IS RECORD (
doc xmltype);
FUNCTION new_request(method IN VARCHAR2,
namespace IN VARCHAR2)
RETURN request;
PROCEDURE add_parameter(req IN OUT NOCOPY request,
name IN VARCHAR2,
type IN VARCHAR2,
value IN VARCHAR2);
FUNCTION invoke(req IN OUT NOCOPY request,
url IN VARCHAR2,
action IN VARCHAR2) RETURN response;
FUNCTION get_return_value(resp IN OUT NOCOPY response,
name IN VARCHAR2,
namespace IN VARCHAR2) RETURN VARCHAR2;
END;
CREATE OR REPLACE PACKAGE BODY demo_soap AS
FUNCTION new_request(method IN VARCHAR2,
namespace IN VARCHAR2)
RETURN request AS
req request;
BEGIN
req.method := method;
req.namespace := namespace;
RETURN req;
END;
PROCEDURE add_parameter(req IN OUT NOCOPY request,
name IN VARCHAR2,
type IN VARCHAR2,
value IN VARCHAR2) AS
BEGIN
req.body := req.body ||
'<'||name||' xsi:type="'||type||'">'||value||'</'||name||'>';
END;
PROCEDURE generate_envelope(req IN OUT NOCOPY request,
env IN OUT NOCOPY VARCHAR2) AS
BEGIN
env := '<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/1999/XMLSchema">
<SOAP-ENV:Body><'||req.method||' '||req.namespace||'
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">'||
req.body||'</'||req.method||'></SOAP-ENV:Body></SOAP-ENV:Envelope>';
END;
PROCEDURE show_envelope(env IN VARCHAR2) AS
i pls_integer;
len pls_integer;
BEGIN
i := 1; len := length(env);
WHILE (i <= len) LOOP
dbms_output.put_line(substr(env, i, 60));
i := i + 60;
END LOOP;
END;
PROCEDURE check_fault(resp IN OUT NOCOPY response) AS
fault_node xmltype;
fault_code VARCHAR2(256);
fault_string VARCHAR2(32767);
BEGIN
fault_node := resp.doc.extract('/soap:Fault',
'xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/');
IF (fault_node IS NOT NULL) THEN
fault_code := fault_node.extract('/soap:Fault/faultcode/child::text()',
'xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/').getstringval();
fault_string := fault_node.extract('/soap:Fault/faultstring/child::text()',
'xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/').getstringval();
raise_application_error(-20000, fault_code || ' - ' || fault_string);
END IF;
END;
FUNCTION invoke(req IN OUT NOCOPY request,
url IN VARCHAR2,
action IN VARCHAR2) RETURN response AS
env VARCHAR2(32767);
http_req utl_http.req;
http_resp utl_http.resp;
resp response;
BEGIN
generate_envelope(req, env);
-- show_envelope(env);
http_req := utl_http.begin_request(url, 'POST','HTTP/1.0');
utl_http.set_header(http_req, 'Content-Type', 'text/xml');
utl_http.set_header(http_req, 'Content-Length', length(env));
utl_http.set_header(http_req, 'SOAPAction', action);
utl_http.write_text(http_req, env);
http_resp := utl_http.get_response(http_req);
utl_http.read_text(http_resp, env);
utl_http.end_response(http_resp);
resp.doc := xmltype.createxml(env);
resp.doc := resp.doc.extract('/soap:Envelope/soap:Body/child::node()',
'xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"');
-- show_envelope(resp.doc.getstringval());
check_fault(resp);
RETURN resp;
END;
FUNCTION get_return_value(resp IN OUT NOCOPY response,
name IN VARCHAR2,
namespace IN VARCHAR2) RETURN VARCHAR2 AS
BEGIN
RETURN resp.doc.extract('//'||name||'/child::text()',
namespace).getstringval();
END;
END;
-- code for the package time_service
CREATE OR REPLACE PACKAGE time_service AS
FUNCTION get_local_time(zipcode IN VARCHAR2) RETURN VARCHAR2;
END;
CREATE OR REPLACE PACKAGE BODY time_service AS
-- Location of Web service definition
-- http://www.alethea.net/webservices/LocalTime.asmx?WSDL
FUNCTION get_local_time(zipcode IN VARCHAR2) RETURN VARCHAR2 IS
req demo_soap.request;
resp demo_soap.response;
BEGIN
req := demo_soap.new_request('LocalTimeByZipCode',
'xmlns="http://www.alethea.net/webservices/"');
demo_soap.add_parameter(req, 'ZipCode', 'xsd:string', zipcode);
resp := demo_soap.invoke(req,
'http://www.alethea.net/webservices/LocalTime.asmx',
'http://www.alethea.net/webservices/LocalTimeByZipCode');
RETURN demo_soap.get_return_value(resp, 'LocalTimeByZipCodeResult',
'xmlns="http://www.alethea.net/webservices/"');
END;
END; -
How to consume Web Service in ABAP WebDynpro
Hi
I want to know the entire details about how to consume Web Service in WebDynpro application.
regards
PiyushhI piyush,
Have a look at this Blog by Thomas Jung.
/people/thomas.jung/blog/2007/12/17/consuming-services-with-abap
on consuming webservies thru webdynpro ABAP
Cheers
Mary -
Best practice for consuming web services
Hi
we are consuming web service in orchestration by "Add Generated Item".By using this option it creates 1 orch,1xsd file and some bindings.
we have different projects for schemas,maps and orchestration under our solution in visual studio.
Now i need to know that what will be the best practice for consuming web service in orchestration i mean in which project should i use "add generated item" (in orchstration project or in schemas project) coz it generates both 1 orch and 1
schema.
thanksFrom a service orientation perspective you should abstract the service artifacts from the other artifacts. Otherwise it will be very difficult to update the service interface without affecting the other artifacts. For example you don't want to have to redeply
your entire application if only one field changes in the service you consume.
So I typically generate the items, remove the unnecessary stuff, and put them in a separate project.
Depending on the control you have over the services you want to consume, it would even be better to create another layer of abstraction. By that I mean create your own interface (schema) and map that one to the one the service exposes. This basically
is only necessary if you consume external services that are beyond your control. By abstracting the interface it exposes, you limit the impact of changes of that interface on the rest of your system. All changes are abstracted behind your own interface.
If you consume internal services, you can probably control the way the interface is defined. In a service oriented world all internal services expose a well known interface, based on the domain objects you have within your organisation.
Jean-Paul Smit | Didago IT Consultancy
Blog |
Twitter | LinkedIn
MCTS BizTalk 2006/2010 + Certified SOA Architect
Please indicate "Mark as Answer" if this post has answered the question. -
Windows authentification while consuming web service from ABAP
Hi All,
We are consuming web service from ABAP, we have created client proxy in SE80 and configured logical port in LPCONFIG.
This one was working fine. Now we have added windows user authentification to access this service.
Now when I'm trying to regenerate this proxy in R/3 it is asking for user and password. When I enter these details this one is not working.
If I access this service direcly from internet explorer and I enter same user and password then I would able to access this service.
Could you please let me know how to handle this.
Regards
VikramThe dialog that is produced by HTTP Destination object of the logical port is designed only for use within Classic Dynpro applications. There is no prompt produced when running in Web Dynpro. If possible assign a generic user within the logical port definition and this will be used automatically by all users.
-
Consuming web service in PI 7.3 and creating file
Hi,
I need to consume web service in PI 7.3 and create file from response. I have WSDL for the web service. Now confused about datatype/message type. Is there any document/note to follow?
thanks,
7ZI need to consume web service in PI 7.3 and create file from response. I have WSDL for the web service. Now confused about datatype/message type. Is there any document/note to follow?
==>
Hi,
There are 2 ways you can do this :-
If your sender is a file and receiver is a webservice and you want to map the response back to the file then :-
Sol 1 :- Async-Sync Bridge using RequesResponse Oneway bean
Sender File channel ---> Soap Receiver Channel
Soap Receiver Channel brings the response back to the File Receiver Channel.
Now this File Receiver Channel should be called inside the Sender File Channel using the above bean.
Data Type :
Src - File struc to SOAP request (WSDL used as an external definition)(mapping 1)
SOAP response(WSDL used as an external definition) to Tgt File Struc (mapping 2)
Sol 2 :- Async Scenario
Make a Sender File Channel --> use SOAP lookup channel (pass the request payload through the SOAP receiver channel) --> Map the response back to the File using File Receiver Channel.
Data Type:
Src - File struc to Tgt File Struc (mapping 1). Since you are passing the request payload through SOAP lookup in the UDF itself.
====================================================================== -
Consuming Web Services with ABAP - WSDL
Hi All,
I Want to consume web service in abap, i found lot of documents,Here i am having data in the internal table i need to pass
it to wsdl file, The Web Service or Proxy generates a WSDL file. So this WSDL file can be consumed on ABAP Front and Encrypt the Data that is to be sent to the Banks.
I found the input and output, Where i can find the method generated or we need to create it
CALL METHOD io_clientproxy->XXXXXXXXXXXX
please let me have your valuable ideas
Thanks in advance,
Arun.Hi Miguel,
I have not heared about SPROXY, Here i found some code,which calls a web service method and where it is from.
when i double click on my proxy it shows me some method.IF_PROXY_BASIS_INTERNAL~CREATE_FRAMEWORK
this is the one web service method. and i meed to pass the internal table data to WSDL file.
*-- create web service proxy class instance
TRY.
CREATE OBJECT io_clientproxy
EXPORTING
logical_port_name = 'LP4'.
CATCH cx_ai_system_fault.
ENDTRY.
*-- call web service methods
TRY.
CALL METHOD io_clientproxy->get_airport_information_by_is
EXPORTING
input = input
IMPORTING
output = output.
CATCH cx_ai_system_fault.
CATCH cx_ai_application_fault.
ENDTRY.
*-- text processing
output_string = output-get_airport_information_by_is.
REPLACE ALL OCCURRENCES OF
'<' IN output_string WITH '<' .
REPLACE ALL OCCURRENCES OF
'>' IN output_string WITH '>' .
REPLACE ALL OCCURRENCES OF
'xmlns=' IN output_string WITH 'xmlns:xsl=' .
*-- parsing
TRY .
CALL TRANSFORMATION ('Y_AIRPORT_XML2ABAP')
SOURCE XML output_string
RESULT outtab = outtab.
CATCH cx_xslt_exception INTO xslt_err.
DATA: s TYPE string.
s = xslt_err->get_text( ).
WRITE: ': ', s.
STOP.
ENDTRY .
Regards,
Arun. -
To consume web service in ABAP is it required that server should be XI.
Hi ,
I am trying to connect to a webservice from netweaver 7.0 systemand it gives an error " Not configured as integration engine". Is it required to have integration engine to consume web service.
SanjayHi Sanjay
You can consume webservices in ABAP but its better to use XI in mid to avoid point to point communication. Using XI you can have a central hub for all services you consume or publish
Check this link as well
BSP a Developer's Journal Part XIV - Consuming WebServices with ABAP
Thanks
Gaurav -
Code for consuming web services in ABAP
*& Report ZVM_GET_CITY_TIME
REPORT zvm_get_city_time.
PARAMETERS:
p_city TYPE zget_city_time_soap_in-city.
DATA:
cl_proxy TYPE REF TO zco_time_service_soap,
input TYPE zget_city_time_soap_in,
output TYPE zget_city_time_soap_out,
systerr TYPE REF TO cx_ai_system_fault,
w_error TYPE c.
TRY.
CREATE OBJECT cl_proxy
EXPORTING
logical_port_name = 'ZCO_TIME_SERVICE_SOAP'.
CATCH cx_ai_system_fault.
CREATE OBJECT systerr.
WRITE:/ 'Error in creating object - ', systerr->errortext.
ENDTRY.
TRY.
input-city = p_city.
CALL METHOD cl_proxy->get_city_time
EXPORTING
input = input
IMPORTING
output = output.
CATCH cx_ai_system_fault.
CREATE OBJECT systerr.
WRITE:/ 'Error in calling the method - ', systerr->errortext.
w_error = 'X'.
ENDTRY.
CHECK w_error NE 'X'.
SKIP.
WRITE:/ 'The current time in ', p_city, ' is ',
output-get_city_time_result.<i> is there any other way to consume web services in ABAP</i>
you can use cl_http_client class to make your program to act as http client and post the soap message too webservice. This way you dont need to generate proxy, but you should know the soap message format.
Regards
Raja -
Problem at Consume WEB Service in ABAP
hello!!
I tell them my problem, is to create a web service from the SE80, which could be used properly.
Then there was a change of server, which migrated to the developments and the web service is recreation, but this can not be consumed.
now I need help, is where do I indicate that the basis so that they can return to consume web services, what services or settings should be activated.
any suggestion or help are welcome.
The ECC system is a 5 AS ABAP only.
from now, I appreciate any help or guidance I can get.What is the problem? Are all the services active in SICF for web services and how is the web service being consumed is it through a wsdl file ?
-
Problem when consuming web service on WIndows authentication applcation
Hi,
I am having a tough time in consuming web services on a
Windows authentication IIS server.
In one of my application I have created web services and
consuming those web services from my another application.
If I turned off the Windows authentication everything works
fine, but If I turned on the Windows authentication web services
stop working.
Has anyone encountered such error while working with web
services on Windows authentication server.
Attach Code
Could not perform web service invocation "funGetCustomer".
Here is the fault returned when invoking the web service
operation:
AxisFault
faultCode: {
http://xml.apache.org/axis/}HTTP
faultSubcode:
faultString: (401)Unauthorized
faultActor:
faultNode:
faultDetail:
{}:return code: 401
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "
http://www.w3.org/TR/html4/strict.dtd">
<HTML><HEAD><TITLE>You are not authorized
to view this page</TITLE>
<META HTTP-EQUIV="Content-Type" Content="text/html;
charset=Windows-1252">
<STYLE type="text/css">
BODY { font: 8pt/12pt verdana }
H1 { font: 13pt/15pt verdana }
H2 { font: 8pt/12pt verdana }
A:link { color: red }
A:visited { color: maroon }
</STYLE>
</HEAD><BODY><TABLE width=500 border=0
cellspacing=10><TR><TD>
<h1>You are not authorized to view this page</h1>
You do not have permission to view this directory or page
using the credentials that you supplied because your Web browser is
sending a WWW-Authenticate header fi...You could try switching the HTTP transport provided in the
Apache Axis embedded in ColdFusion to "CommonsHTTPSender".
See this blog post:
http://tjordahl.blogspot.com/2007/03/apache-axis-and-commons-httpclient.html -
Biztalk 2010 - Consume Web Service with Certificate
Hi
I have to consume a java web service with Biztalk that requires authentication via a client certificate. Until now I have not been able to consume any web service where any kind of authentication was needed. Simple web services without authentication are
no problem. Also using SoapUI works perfectly fine.
I am generating the XSDs and the port binding with the WCF wizard in VS2010. I've read several comments that it's not possible to consume web services with the WCF-WSHttp adapter when the message format should be SOAP 1.1. Therefore I'm trying with the WCF-BasicHttp
and WCF-Custom adapters, but I did not suceed in receiving a positive response yet.
The web service I want to consume uses a client certificate (with a private key) and two root certificates. When I use the BasicHttp adapter I choose either 'Transport' or 'TransportWithMessageCredential' but none of them work. I also have to supply a client
and a service certificate. I always use the one with the private key for the client but I'm not sure which one I have to use for the service. Is there a possibility that I have to provide both root certificates and if so, how can I achieve this?
Hope the question makes sense somehow... thanks for any input.
Error message that I receive currently is that the server needs a client certificate. However I attached it in the send port properties under the tab "Security" => mode "TransportWithMessageCredential".Adapter: WCF-Custom
Binding: customBinding
Cannot send pictures (yet).
<configuration>
<enterpriseLibrary.ConfigurationSource selectedSource="ESB File Configuration Source" />
<system.serviceModel>
<client>
<endpoint address="...." behaviorConfiguration="EndpointBehavior" binding="customBinding" bindingConfiguration="ReceiptBinding" contract="BizTalk" name="WebServicePort" />
</client>
<behaviors>
<endpointBehaviors>
<behavior name="EndpointBehavior">
<clientCredentials>
<clientCertificate findValue="..." x509FindType="FindByThumbprint" />
<serviceCertificate>
<defaultCertificate findValue="..." storeLocation="LocalMachine" storeName="AuthRoot" x509FindType="FindByThumbprint" />
</serviceCertificate>
</clientCredentials>
</behavior>
</endpointBehaviors>
<serviceBehaviors>
<behavior name="ServiceBehavior" />
</serviceBehaviors>
</behaviors>
<bindings>
<customBinding>
<clear />
<binding name="ReceiptBinding">
<textMessageEncoding messageVersion="Soap11" />
<security authenticationMode="MutualCertificate" />
<httpsTransport proxyAuthenticationScheme="Basic" requireClientCertificate="true" />
</binding>
</customBinding>
</bindings>
</system.serviceModel>
</configuration>
Maybe you are looking for
-
Hello Gurus, We want to send dunning notice by mail to dunning receipient. Can we use user exit-F150D001? Pl.advise us. Thanks in advance, Ganesh Lokam.
-
Flex updates at a row level in a grid
I needs to updates row level in a grid for frequent basis, Also i don't want to Refresh the Grid. Is there any method i can use ? Using flex Grid -> updates at a row level in a grid
-
RFC-XI-JDBC testing is not working
Hi, I created rfc-xi-jdbc. I created 2 dt, 2 msg types, 2 msg mappings, 1 msg interface(synchronous, abstract), 1 interface mapping. In the CD, I defined, 1 sender, 1 receiver agreement. 1 receiver, 1 sender determination, 1 interface determination,
-
When I run the setup file it extracts and closes and never installs.
I downloaded FF 4 beta 12. When I run the file after downloading it extracts but then just closes and never goes into setup. Windows 7 x64
-
Posting Intercompany documents using program RFBIBL00
Hi, I want to know if we can post intercompany documents using program RFBIBL00(Direct Input Method). If this is possible, please let me know how can this be achieved as I am getting an error "Cross-company code postings not defined". Thanks Harveen.