Consuming stateful web service via ABAP proxy
Hi all,
I´ve got the following scenario. I´ve a ABAP proxy generated based on a WSDL file. The provider is a WebService provided by a tomcat server. (no PI etc. as middleware). The problem i´ve now is that the webservice is stateful so I need a stateful communication between my ABAP report (client) and the Web Service.
I´ve already found the possibiliy to switch on the feature "Session-Oriented Communication" on "Preconfiguration Tab" of the ABAP Proxy Screen. But unfortunately it´s not working.
Anybody knows whether general system settings has to be changed for this. Or anybody has other tips.
I´m currentliy working on the SAP Discovery System v3 which is a Netweaver 7.0.
Many thanks in advance for your answers,
Andy
Marcelo Almeida wrote:
> You can use Logial port for it in LPCONFIG ( Transaction). See this examplo Below:
>
> TRY.
>
> CREATE OBJECT my_proxy
> EXPORTING
> logical_port_name = 'LP01'.
> CATCH cx_ai_system_fault.
> ENDTRY.
>
> TRY.
> input-airline_id = p_carrid.
> input-connection_id = p_connid.
> input-flight_date = p_fldate.
>
> CALL METHOD my_proxy->flight_get_detail
> EXPORTING
> input = input
> IMPORTING
> output = output.
> CATCH cx_ai_system_fault.
> CATCH cx_ai_application_fault.
> ENTRY.
>
> Its necessary create a connection in SM59 (type H) and setting in the call parameters logical port (LPCONFIG).
Hi,
thanks for your answer. It´s working!
Cheers,
Andy
Similar Messages
-
Wrong data when consuming web service via ABAP
Dear all,
we tried to consume a web service via ABAP and used one of the various existing how-to papers from the internet in order to develop everything.
The development was not that difficult, but when we now execute our ABAP, we noticed that
- the first 100 returned rows from the webservice are completely correct
- then we receive 10-15 completely incorrect rows (empty fields, redundant lines, etc.)
- the rest of the data (60 records) is correct again
As we nearly all objects have been generated automatically via SE80, I do not really know where this problem might come from. We double checked the original data and there everything is correct.
Any ideas?
Thanks for your feedback,
AndreasMarcelo Almeida wrote:
> You can use Logial port for it in LPCONFIG ( Transaction). See this examplo Below:
>
> TRY.
>
> CREATE OBJECT my_proxy
> EXPORTING
> logical_port_name = 'LP01'.
> CATCH cx_ai_system_fault.
> ENDTRY.
>
> TRY.
> input-airline_id = p_carrid.
> input-connection_id = p_connid.
> input-flight_date = p_fldate.
>
> CALL METHOD my_proxy->flight_get_detail
> EXPORTING
> input = input
> IMPORTING
> output = output.
> CATCH cx_ai_system_fault.
> CATCH cx_ai_application_fault.
> ENTRY.
>
> Its necessary create a connection in SM59 (type H) and setting in the call parameters logical port (LPCONFIG).
Hi,
thanks for your answer. It´s working!
Cheers,
Andy -
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 -
Hi,
We have a Web Service URL on PI. Run time of this Web Service in a Portal Server.
We need to access the Same URL from ECC using ABAP Programming?
Can any one tell me how we can call the same Web Service?
I need to pass few values to the web service using ABAP Code and I need to get back the result into some variables.
any code available for verify?
Thanks,
Sekhar.JHi,
Steps involved in Consuming a Web Service in ABAP.
1. You will need to create a Service Consumer Proxy in the ECC system.
The procedure for this is available in the documentation link [http://help.sap.com/saphelp_erp60_sp/helpdata/en/46/9743916d1115ece10000000a114a6b/frameset.htm] in the section Consuming a Web Service.. The URL access path of the WSDL can be used to generate the Service Consumer Proxy in ABAP.
2. Using transaction SOAMANAGER create the Logical Port for the Consumer Proxy created in Step 1.
3. Code the Consumer Proxy call in the ABAP program. Check section Consuming a Web Service --> Programming with Client and Server Proxies --> Sending a Message in the link specified above.
The Video link [Consuming Services in ABAP |https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/media/uuid/20eb3174-41ab-2a10-a383-907faf60eed3] will provide good conceptual knowledge, steps involved and Logical port maintenance..
In case you face any problems, shoot your queries.
regards
Nitesh -
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. -
SoapFaultCode:1"Consume web service in ABAP proxy
Hi,
All while trying to execute the web service in ABAP i am getting the following error: SoapFaultCode:1".
When i used tcode ST11, i found it is giving the following error trace:
XRFC>
XRFC> E HTTP_TRANSPORT_BINDING 20091202120425.2099810 : CL_SOAP_HTTP
XRFC> TPBNDROOT ->HANDLE_STATUS_CODE Received return code 500 (
XRFC>
XRFC>
XRFC> E SOAP_RUNTIME 20091202120425.2897590 : CL_SOAP_RUNTIME_CLIENT
XRFC> ->EXEC_PROCESSING SOAP Fault Exception caught: : System.Web
XRFC> .Services.Protocols.SoapHeaderException: SOAP header To was not
XRFC> understood.#
Can anyone please help with this?Hi
1.- check adding the host of the Service to your etc\hosts file unix case, or your DNS in case you have one.
2.- Add the SOAP Action in the Logical Port Config (Obtain it from the WSDL info).
Hope this help,
Greetings. -
Error while consuming CAF Web Service in ABAP
Hi experts,
I need to consume a CAF Web Service in ABAP 7.0. While trying to generate the Proxy Object in SE80 it is thowing an error "Proxy generation terminated: WSDL error. (<extension> not supported)" and terminating the Proxy generation.
Can anyone please help me out with the solution for this?
Thanks in Advance.
Vaishali.Hi,
waiting for reply..... -
Consuming a Web Service with ABAP in WAS 6.40 (SS3)
Hi Everyone,
Has anyone successfully consumed a web service (based on an EJB) that is published to the J2EE engine of their WAS 6.40 server by creating a proxy from the ABAP layer?
We are encountering the following problem: When executing method of the proxy to call the Web Service on the J2EE engine, the CX_AI_SYSTEM_FAULT exception is triggered with the message "Unallowed RFC-XML Tag (SOAP_EINVALDOC)".
This same problem has occurred with multiple web services, even though the proxy generation seems to execute without a problem. Is there some system setting that could cause this? We have run the SOAP Runtime trace, but only receive the same basic information about the problem.
If anyone has any thoughts at all, I'd be grateful to hear them.
Thanks,
--GregHi,
We encountered problems when consuming a foreign WS. It seems to be that RPC style WSDL isn't supported by the WAS 6.4 WS proxy. An interesting reading on this is
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/documents/a1-8-4/the difference between rpc and document style wsdl.article
Eddy -
Problems consuming a web service in ABAP
We wish to consume an external web service from ABAP but the provided WSDL file contains syntax not supported by SAP - namely "mixed content". A response from Roman Glushkov in forum thread [Call Sharepoint Web Service; seemed to offer a solution.
The WSDL file was edited as suggested by Roman and the Service Consumer proxy was successfully created from this edited version. However, in our SAP release (Basis release 700 support pack SAPKB70018) the "untyped mapping" indicator is not shown anywhere so we are unable to set that for those elements that were set edited in the WSDL.
The problem now is that when calling a method where the return parameters include one of these edited elements we get the error "SOAP:1,001 CX_ST_MATCH_TYPE:XSLT exception.System expected a value for the type g" presumably because SAP is trying to de-serialise the response rather than just return the data as an XML string.
Does anyone know how to get this "untyped mapping" indicator or can anyone suggest another way to solve this mixed content issue?
TIA
GarethHi Tim
I've sort of got further in that I I can now call the web service method without error but structure returned is empty even though I know the SOAP response has data.
What I did was to go back to the WSDL and re-write the type declaration bit to fully describe the response message.
The appropriate portion of the original WSDL was;
<s:element name="getActionListResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="getActionListResult">
<s:complexType mixed="true">
<s:sequence>
<s:any />
</s:sequence>
</s:complexType>
</s:element>
</s:sequence>
</s:complexType>
</s:element>
The response SOAP message was;
<getActionListResponse xmlns="http://webcominc.com/">
<getActionListResult>
<RESULT xmlns="">
<RESULT>
OK
</RESULT>
<REASON />
<ACTION>
View
</ACTION>
<ACTION>
Change Status
</ACTION>
</RESULT>
</getActionListResult>
</getActionListResponse>
So I re-wrote the WSDL as follows;
<s:element name="getActionListResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="getActionListResult">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="RESULT">
<s:complexType>
<s:sequence>
<s:element name="RESULT" type="s:string" minOccurs="1" maxOccurs="1" />
<s:element name="REASON" type="s:string" minOccurs="1" maxOccurs="1" />
<s:element maxOccurs="unbounded" name="ACTION" type="s:string" minOccurs="0" />
</s:sequence>
</s:complexType>
</s:element>
</s:sequence>
</s:complexType>
</s:element>
</s:sequence>
</s:complexType>
</s:element>
Using this new version of the WSDL I recreated the ABAP Proxy but as I said this now returns an ABAP structure that is empty. I'm new to WSDL so its very probable that my attempt at defining the response message is incorrect or maybe it is something to do with the fact that the response message has two elements called RESULT - one being the child of the other?
Regards
Gareth -
WebDynpro Consuming a Web Service via SSL (https)
Hello dovelopers,
i want to consume a Web Service in a WebDynpro Application via https.
can anybody give me a few links to pdfs etc.
Thank You
MichelTry this:
Are you trying to create https trust relation ship between two SAP Portals or SAP Portal to Non Sap Portal?
Help on How to Consume a Web Service in SAP Portal?
http://help.sap.com/saphelp_nw04/helpdata/en/f5/30c5aca7f92f418d889b99ccc9ee08/content.htm
http://help.sap.com/saphelp_nw04/helpdata/en/df/a08340d990ce62e10000000a155106/content.htm
http://www.sapportalguide.com/web_services.html
Here the documents helps you how to integreate https authentication betweeen two portals:
http://help.sap.com/saphelp_nw2004s/helpdata/en/43/2235260b413fe1e10000000a11466f/content.htm
http://help.sap.com/saphelp_nw04/helpdata/en/62/881e3e3986f701e10000000a114084/frameset.htm
http://help.sap.com/saphelp_nw04/helpdata/en/14/29236de1864c6e8d46e77192adaa95/frameset.htm
http://help.sap.com/saphelp_nw04/helpdata/en/d3/41c8efb31d11d5993800508b6b8b11/frameset.htm
Thanks
Krishna -
Comsume Web Service via ABAP SAP 4.7
Hello Experts
We wanted use an ABAP program to call a web service. We were only given the target WSDL file. Not sure what to do with this and what information can we get from this.
As I checked, the format is different from the conventional web service I found in the blogs. Usually the WSDL URL is format below.
http://www.webservicex.net/airport.asmx?wsdl
and you can see and test the services from this URL http://www.webservicex.net/airport.asmx
But in our case, this the WSDL URL is below.
http://<host>/dd10/services/shipRSS?wsdl
and we cannot see and test service from http://<host>/dd10/services/shipRSS this is what we are getting.
"shipRSS
Hi there, this is an AXIS service!
Perhaps there will be a form for invoking the service here..."
Having this kind of WSDL, can we still create an ABAP program that can consume this? Is there difference in the programming and parameters. Currently we are using the program template from this blog /people/durairaj.athavanraja/blog/2004/09/20/consuming-web-service-from-abap as we are only running on SAP 4.7 but it seems not to be working. Any thoughts?
Thank you very much!
TonyHi Andrei,
We did the changes in the program and we seem to have made some progress here. Here are the test results now.
Test Soap
>> Starting...
>>
>> TEST: SOAP call to method STFC_CONNECTION
>>
>> Result of SOAP call
echotext =
resptext =
<< ...Done
Here is an excerpt of the program of which parameters are inputted. We are suppose to send an XML string. We have not made much changes in the sample program except the one you highlighted to us before. But if there are any concerns it will on the part where to construct soap request document which is shown below. If it is not too much to ask, would you help us check the parameters if they are correct. Thank you very much. You've been very helpful.
1 construct soap request document
CREATE OBJECT osoap.
IF osoap IS INITIAL.
WRITE: / '> cannot create soap document, exiting...'. EXIT.
ENDIF.
TRY.
** OLD VALUE:
** CALL METHOD osoap->set_method
** EXPORTING
** nsprefix = 'saprfc'
** nsvalue = CSoapConstants=>sc_rfc_function_ns
** attributes =
** name = 'STFC_CONNECTION'.
NEW VALUE
CALL METHOD osoap->set_method
EXPORTING
nsvalue ='http://webservice.<namespace>'
name = 'exec' .
"-- parameter: REQUTEXT
GET REFERENCE OF p_requtext INTO dref.
CALL METHOD osoap->add_parameter
EXPORTING
nsprefix =
nsvalue =
attributes =
direction = CSoapConstants=>ic_param_in
name = 'REQUTEXT'
value = dref.
"-- parameter: ECHOTEXT
GET REFERENCE OF p_echotext INTO dref.
CALL METHOD osoap->add_parameter
EXPORTING
nsprefix =
nsvalue =
attributes =
direction = CSoapConstants=>ic_param_out
name = 'ECHOTEXT'
value = dref.
"-- parameter: RESPTEXT
GET REFERENCE OF p_resptext INTO dref.
CALL METHOD osoap->add_parameter
EXPORTING
nsprefix =
nsvalue =
attributes =
direction = CSoapConstants=>ic_param_out
name = 'RESPTEXT'
value = dref.
"-- use ABAP tag names
CALL METHOD osoap->set_tag_name_format
EXPORTING format = CSoapConstants=>ic_tagfmt_default.
CATCH CSoapExceptionUsage INTO usgEx.
WRITE: / ' > exception occurred'.
exTxt = usgEx->get_text( ).
WRITE: / ' > text: ', exTxt.
EXIT.
ENDTRY.
isoap = osoap. -
Get error "SoapFaultCode:1"Consume web service in ABAP proxy
Hi All,
I created a proxy and logical port to consume a BOBJ Data Service' webservice, when I tested the proxy I get exception:
SoapFaultCode:1 without further more information.
the wsdl is @ http://nspad372.dmzpal.sap.corp:8080/DataServices/servlet/webservices?ver=2.1&wsdlxml
and the endpoint of that webservice is@ http://cnst50052835:8080/DataServices/servlet/webservices?ver=2.1
By using SOAPUI I can successful call that webservice, but with ABAP proxy not. Can someone give me a help?
thanks& bst regards,
BinHi
1.- check adding the host of the Service to your etc\hosts file unix case, or your DNS in case you have one.
2.- Add the SOAP Action in the Logical Port Config (Obtain it from the WSDL info).
Hope this help,
Greetings. -
Consuming a Web Service via SSL with Basic Authentication
Hello,
I have a simple web service (returns a parameter value) and want to consume it. Therefore I have generated a proxy for its in Netweaver Studio SP13.
When I set up the web service to be accessed via HTTP and Basic Authentication (Username/Password), everything is fine. When I set up the web service to communicate via HTTPS, I get the following error message in my client:
java.rmi.RemoteException: Service call exception; nested exception is:
java.lang.NullPointerException
at priv.senw04.wsproxy.multisec_ssl.SSLBindingStub.pingText(SSLBindingStub.java:87)
at priv.senw04.wsproxy.multisec_ssl.SSLBindingStub.pingText(SSLBindingStub.java:96)
at priv.se.wsclient.MultiSecSSL.main(MultiSecSSL.java:38)
Caused by: java.lang.NullPointerException
at com.sap.engine.services.webservices.jaxm.soap.HTTPSocket.disconnect(HTTPSocket.java:625)
at com.sap.engine.services.webservices.jaxrpc.wsdl2java.soapbinding.HTTPTransport.closeSession(HTTPTransport.java:396)
at com.sap.engine.services.webservices.jaxrpc.wsdl2java.soapbinding.MimeHttpBinding.call(MimeHttpBinding.java:1312)
at priv.senw04.wsproxy.multisec_ssl.SSLBindingStub.pingText(SSLBindingStub.java:80)
... 2 more
Testing the web service with WebServiceNavigator and/or by using a generated WebDynpro Client results in the following error:
000D604C66BE004E0000001300000AFC00040922E0160632 : An error occurred during processing the timestamp. The error was: com.sap.security.core.ws.wss.NoSecurityHeaderException No wsse:Security header has been defined for role soap:finalActor. Please verify the policy configuration..
But my main focus is on the client implementation based on a proxy. Here comes the client's code:
public class MultiSecSSL {
public static void main(String[] args) {
try {
MultiSecuritySSLAuthImpl serviceInterface = new MultiSecuritySSLAuthImpl();
SSLBindingStub service = (SSLBindingStub)serviceInterface.getLogicalPort(MultiSecuritySSLAuthViDocument.class);
SecurityProtocol protocol = (SecurityProtocol) service._getGlobalProtocols().getProtocol("SecurityProtocol");
AuthenticationContext auth = protocol.getAuthenticationContext();
auth.setIgnoreSSLServerCertificate(true);
auth.setUsername("cfpcompany");
auth.setPassword("demo");
String ret = service.pingText("Called service MultiSecurity via SSL");
System.out.println(ret);
} catch (Exception e) {
e.printStackTrace(System.out);
Here comes the logical port information of the generated proxy:
<?xml version="1.0" encoding="UTF-8"?>
<LogicalPorts Name='MultiSecuritySSLAuth' InterfaceName='priv.senw04.wsproxy.multisec_ssl.MultiSecuritySSLAuth'>
<LogicalPort Name='SSLPort_Document' Endpoint='https://192.168.129.76:50001/MultiSecuritySSLAuth/SSL?style=document' BindingName='SSLBinding' BindingUri='urn:MultiSecuritySSLAuthWsd/SSL/document' BindingImplementation='SOAP 1.1 HTTP Binding with Attachments' StubName='priv.senw04.wsproxy.multisec_ssl.SSLBindingStub' Default='true' InterfaceName='priv.senw04.wsproxy.multisec_ssl.MultiSecuritySSLAuthViDocument' Original='true' Valid='true'>
<globalFeatures>
<Feature Name='http://www.sap.com/webas/630/soap/features/headers/' Provider='SoapHeadersProtocol' Original='false'>
</Feature>
<Feature Name='http://www.sap.com/webas/630/soap/features/session/' Provider='SessionProtocol' Original='false'>
<Property Name='SessionMethod' Value='httpCookies'>
</Property>
</Feature>
<Feature Name='http://www.sap.com/webas/630/soap/features/authentication' Provider='SecurityProtocol' Original='true'>
<Property Name='AuthenticationLevel' Value='None'>
</Property>
<Property Name='AuthenticationMechanism' Value='HTTP'>
</Property>
<Property Name='AuthenticationMethod' Value='BasicAuth'>
</Property>
<Property Name='SupportsSSO2Authentication' Value='false'>
</Property>
</Feature>
<Feature Name='http://www.sap.com/webas/630/soap/features/transportguarantee' Original='true'>
<Property Name='Level' Value='No'>
</Property>
<Property Name='TLSType' Value='SSL'>
</Property>
</Feature>
</globalFeatures>
<localFeatures>
<Operation Name='pingText'>
<Feature Name='http://www.sap.com/webas/630/soap/features/wss' Original='true'>
<Property Name='RequestPolicy' Value='Signature'>
</Property>
<Property Name='ResponsePolicy' Value='None'>
</Property>
</Feature>
<Feature Name='http://sap.com/webservices/authorization' Original='true'>
</Feature>
</Operation>
</localFeatures>
</LogicalPort>
</LogicalPorts>
To me, this looks consistent. Any idea, what is misconfigured on my machine ?Hi Martin,
that is exactly, what I did.
- Change Web Service Configuration in IDE
- Build and Deploy the Service to my local Server
- Check Service in Visual Administrator
- Deleted and Regenerated the Standalone Proxy
- Deleted and Recreated the link between CLient and Proxy Project in IDE
- Started Client
Here comes the section of the ws-deployment-descriptor.xml of the service. For me, it matches, what the proxy generated.
<webservice>
<guid>ed8363_10876a54b6d__7fe9_192_168_129_76_1135862193037</guid>
<ejb-name-temp>MultiSecWSBean</ejb-name-temp>
<webservice-name>
<namespaceURI>urn:MultiSecuritySSLAuthWsd</namespaceURI>
<localName>MultiSecuritySSLAuth</localName>
</webservice-name>
<webservice-internal-name>MultiSecuritySSLAuth</webservice-internal-name>
<standard-namespaceURI>urn:MultiSecuritySSLAuthWsd</standard-namespaceURI>
<ws-configuration>
<configuration-name>SSL</configuration-name>
<ejb-name>MultiSecWSBean</ejb-name>
<service-endpoint-name>
<namespaceURI>urn:MultiSecuritySSLAuthWsd</namespaceURI>
<localName>SSLPort</localName>
</service-endpoint-name>
<wsdl-porttype-name>
<namespaceURI>urn:MultiSecuritySSLAuthWsd</namespaceURI>
<localName>MultiSecuritySSLAuthVi</localName>
</wsdl-porttype-name>
<webservice-definition-ref>
<package>com.technidata.cfp.i3rdparty.cfpxml</package>
<name>MultiSecuritySSLAuthWsd.wsdef</name>
</webservice-definition-ref>
<service-endpoint-vi-ref>
<package>com.technidata.cfp.i3rdparty.cfpxml</package>
<name>MultiSecuritySSLAuthVi.videf</name>
</service-endpoint-vi-ref>
<transport-binding name="SOAPHTTP_TransportBinding">
<wsdl-binding-name>
<namespaceURI>urn:MultiSecuritySSLAuthWsd</namespaceURI>
<localName>SSLBinding</localName>
</wsdl-binding-name>
</transport-binding>
<transport-address>/MultiSecuritySSLAuth/SSL</transport-address>
<global-features>
<feature name="http://www.sap.com/webas/630/soap/features/transportguarantee" protocol="SecurityProtocol">
<property name="TLSType" value="SSL"/>
</feature>
<feature name="http://www.sap.com/webas/630/soap/features/authorization" protocol="SecurityProtocol"/>
<feature name="http://www.sap.com/webas/630/soap/features/authentication" protocol="SecurityProtocol">
<property name="AuthenticationMethod" value="BasicAuth"/>
<property name="AuthenticationMechanism" value="HTTP"/>
<property name="SupportsSSO2Authentication" value="false"/>
</feature>
</global-features>
<operation-configuration uniqueViName="pingText(java.lang.String)">
<transport-binding-configuration>
<input>
<property name="soapAction" value=""/>
<property name="encodingStyle" value="http://schemas.xmlsoap.org/soap/encoding/"/>
</input>
<output>
<property name="encodingStyle" value="http://schemas.xmlsoap.org/soap/encoding/"/>
</output>
</transport-binding-configuration>
<feature name="http://www.sap.com/webas/630/soap/features/wss" protocol="SecurityProtocol">
<property name="RequestPolicy" value="None"/>
<property name="ResponsePolicy" value="None"/>
</feature>
<feature name="http://sap.com/webservices/authorization" protocol="SecurityProtocol">
<property name="security-roles">
<property name="role1" value="use_multisec_service"/>
</property>
</feature>
</operation-configuration>
</ws-configuration>
</webservice>
Regards,
Stefan -
Consuming a web service in ABAP exception and error
Hi experts,
I have succesfully implemented this example web service http://www.webservicex.net/airport.asmx?WSDL from http://www.webservicex.net/airport.asmx and everything works perfect so I know it is possible.
But my requirement is to implement the following web service: http://ws1.webservices.nl/business/soap_doclit?wsdl it is a document/literal soap web service and WS-I Basic Profile 1.0 compliant. When I try to create a proxy object I get the following errors:
- Exception occurred in library handler
- Incorrect value: Unknown Namespace http://schemas.xmlsoap.org/wsdl
I already found that library handler exception might have something to do with http bindings, I found note 1403271 but as my system is running on release 702 level 0008 this note is obsolete.
Now 2nd error, incorrect value I don't really understand.. I also think the web service is SOAP 1.1 and not 1.2 because that should also give problems according to this topic: Proxy object to consume web service - can anyone verify to be sure? I'm not that familiar with WSDL files but does anyone know what I can test and what I can remove from the web service?
The web service documentation is found here: https://webview.webservices.nl/documentation/files/interfaces/soap/soap-txt.html#SOAP_Interface.Differences_between_SOAP_interfaces
There are also other versions such as RPC/Encoded and one without a header but ALL versions give the exact same error.
Thx!check the beginning of your WSDL file
just after the first line <xml> you should have
<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsa="http://www.w3.org/2005/08/addressing"
followed by the namespaces related to your web service if required.
SAP does all the job (generate the web service client) but any very little error in the file (or element not recognized) leads to this message "exception occurred in library handler" and it is not easy to know exactly what is the error... -
Web Service u0096 ABAP proxy synchronous interface
hi experts,
can you suggest me how to do this scenario?
<i><b>Web Service ABAP proxy synchronous interface.</b></i>hi,
you can create a web service on XI
which will call ABAP proxy (on ERP, SRM etc)
in a synchronous way (you just need to generate the proxy class
in TCODE SPROXY)
then you can fill the method of your generated proxy class
and you will have WS - ABAP proxy interface
have a look at this to undrstand server proxy:
/people/siva.maranani/blog/2005/04/03/abap-server-proxies
Regards,
michal
<a href="/people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions"><b>XI / PI FAQ - Frequently Asked Questions</b></a>
Maybe you are looking for
-
Error in SDE_ORA_AbsenceEvent_Full workflow
I am getting a task failure on the SDE_ORA_AbsenceEvent task when running the Human Resource - Oracle R1212 execution plan from DAC. I have copied and pasted the session log below. The error I see within it is an 'ORA-01846: not a valid day of the we
-
Installing Adobe Reader to other than C Drive
I cannot seem to download Adobe Reader 9 to anything other than my C Drive. I need it to install somewhere else. How do I accomplish this?
-
Lightroom 3 making duplicate copies of recent imported photos by itself?
I use Lightroom 3 and recently it has started making multiple duplicates of recent imported (and exported) photos without me doing anything.... what happens is I import a batch of photos, make adjustments to them, export them... close lightroom. Then
-
Running Labview 8.2 on MacOS X.4 with the latest PCI/X-GPIB card to a Spex / Jobin-Yvon monocromator. The interface handshake fails on first character sent to the device (TIMO). Using an older PCI-GPIB card (physically larger, I don't see how to diff
-
Hi all, 11.2.0.1 Aix 6.1 I have issues with IMPDP & EXPDP when using non-dba users. These are the steps I followed: 1. I have created as root user, the directory /dpdump. 2. The chown 777 /dpdump. 3. As oracle user, I connect sqlplus / as sysdba , cr