Call (consume) a webservice from ABAP for dummies
Hi
I find the documentation for this topic very confusing. It a badly structured mix of documentation of client scenarios, server scenarios and worst of all a lot of XI nonsense.
I need purely client scenario documentation without any info about XI and without any info about creating web services.
I just need to know how to consume a web based webservice in ABAP program. Where can I find this docu?
I have tried to generate proxies from different WSDL sources, but it always fails with different error messages.
Can anyone suggest a simple WSDL webservice usefull for testing my setup?
Best regards
Thomas Madsen Nielsen
You are right, the help files do mix consuming and creating, but they do provide a list of steps for consuming and what you need to do. To consume a web service, the general steps you need to follow are:
- Create an extendable package with use accesses SAI_SXMS, SAI_TOOLS, SAPPINT
- Create a proxy class using the wizard in SE80 (right click on the package -> Create -> Enterprise Service) - the creation of the class depends on the WSDL document - you can either generate based on the url for the WSDL or download the WSDL document and import it as a file in the wizard. You may need to tinker with the WSDL document to get the class generation to complete successfully. Your WSDL is here: [http://maptp12.map24.com/map24/webservices1.5?soap=Map24Routing]
- Create a logical port in LPCONFIG or SOAMANAGER (assumes NW 7.0 SP14 or later) with information in the WSDL
- Create a program to consume the service method - it will look something like this (abbreviated):
DATA: gv_client_proxy TYPE REF TO zcwsbb_co_global_weather_soap,
gv_sys_exception TYPE REF TO cx_ai_system_fault.
DATA: gs_request TYPE zcwsbb_get_weather_soap_in,
gs_response TYPE zcwsbb_get_weather_soap_out,
gs_weather TYPE zst_currentweather.
DATA: gv_message TYPE string.
TRY.
CREATE OBJECT gv_client_proxy.
CALL METHOD gv_client_proxy->get_weather
EXPORTING
input = gs_request
IMPORTING
output = gs_response.
CATCH cx_ai_system_fault INTO gv_sys_exception.
CALL METHOD gv_sys_exception->if_message~get_text
RECEIVING
result = gv_message.
WRITE: gv_message.
FREE: gv_client_proxy, gv_sys_exception.
EXIT.
ENDTRY.
- Transform the response as required using ST or XSLT
Similar Messages
-
Calling an existing webservice from ABAP ?
I am trying to call an existing webservice from abap and cannot seem to get it right.
We are on 640.
What are the steps I need to follow ?
The address of the test wsdl is http://obcbox:50000/EMWSApp/DCCGen?wsdl
and http://obcbox:50000/wsnavigator/jsps/explorer.jsp?localWS=RU1XU0FwcC9zYXAuY29tJTJGRU1XU0FwcEVhci9FTVdTYXBwLmphcg%3D%3D
I need to be able to send data to the dccGenerator so it can do its work.
Any help would be greatly appreciated.
Cheers Steve.The following code will call the web service and fill the data into internal table which was received from the Web service. This code will send & Receive the data from ABAP to Webservice.
Change the Header detail as per your Webservice.
REPORT ZWORKORDER.
* Author : Raja T
* Company :******
TYPES: BEGIN OF OUTTAB1 ,
JOBCODE(20),
COMPONENTCODE(20),
ACCURATEHOURS(20),
ACCURATECOST(20),
LENGTH TYPE I,
END OF OUTTAB1 .
DATA: OUTTAB TYPE TABLE OF OUTTAB1.
DATA: TAB TYPE OUTTAB1.
DATA: WF_O LIKE LINE OF OUTTAB .
DATA: XSLT_ERR TYPE REF TO CX_XSLT_EXCEPTION .
DATA: RLENGTH TYPE I,
TXLEN TYPE STRING .
DATA: HTTP_CLIENT TYPE REF TO IF_HTTP_CLIENT .
DATA: WF_STRING TYPE STRING .
DATA: WF_STRING1 TYPE STRING .
DATA: WF_PROXY TYPE STRING ,
WF_PORT TYPE STRING .
CLEAR WF_STRING .
* Form the input string to send the Input Data to Web service.
CONCATENATE
'<?xml version="1.0" encoding="utf-8"?>'
'<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">'
' <soap:Body>'
' <GetWorkOrder xmlns="http://*******erica.net/webservices/">'
' <nWorkOrder>2</nWorkOrder>'
' <nDistributorCode>4871</nDistributorCode>'
' <model>HM400</model>'
' <type>1 </type>'
' </GetWorkOrder>'
' </soap:Body>'
'</soap:Envelope>'
INTO WF_STRING .
CLEAR :RLENGTH , TXLEN .
RLENGTH = STRLEN( WF_STRING ) .
MOVE: RLENGTH TO TXLEN .
CLEAR: WF_PROXY, WF_PORT .
CALL METHOD CL_HTTP_CLIENT=>CREATE
EXPORTING
HOST = '192.168.1.41' "'http://****merica.net/webservices'
SERVICE = '8080'
SCHEME = '1'
IMPORTING
CLIENT = HTTP_CLIENT.
HTTP_CLIENT->PROPERTYTYPE_LOGON_POPUP = HTTP_CLIENT->CO_DISABLED.
CALL METHOD HTTP_CLIENT->REQUEST->SET_HEADER_FIELD
EXPORTING
NAME = '~request_method'
VALUE = 'POST'.
CALL METHOD HTTP_CLIENT->REQUEST->SET_HEADER_FIELD
EXPORTING
NAME = '~server_protocol'
VALUE = 'HTTP/1.1'.
CALL METHOD HTTP_CLIENT->REQUEST->SET_HEADER_FIELD
EXPORTING
NAME = '~request_uri'
VALUE = '/service/accurate/workorder.asmx?'.
CALL METHOD HTTP_CLIENT->REQUEST->SET_HEADER_FIELD
EXPORTING
NAME = 'Content-Type'
VALUE = 'text/xml; charset=utf-8'.
CALL METHOD HTTP_CLIENT->REQUEST->SET_HEADER_FIELD
EXPORTING
NAME = 'Content-Length'
VALUE = TXLEN.
CALL METHOD HTTP_CLIENT->REQUEST->SET_HEADER_FIELD
EXPORTING
NAME = 'SOAPAction'
VALUE = 'http://********merica.net/webservices/GetWorkOrder'.
CALL METHOD HTTP_CLIENT->REQUEST->SET_CDATA
EXPORTING
DATA = WF_STRING
OFFSET = 0
LENGTH = RLENGTH.
* Send the Input Data to Web service.
CALL METHOD HTTP_CLIENT->SEND
EXCEPTIONS
HTTP_COMMUNICATION_FAILURE = 1
HTTP_INVALID_STATE = 2.
* Receive the Input from Web Serice.
CALL METHOD HTTP_CLIENT->RECEIVE
EXCEPTIONS
HTTP_COMMUNICATION_FAILURE = 1
HTTP_INVALID_STATE = 2
HTTP_PROCESSING_FAILED = 3.
CLEAR WF_STRING1 .
WF_STRING1 = HTTP_CLIENT->RESPONSE->GET_CDATA( ).
DATA: LENGTH TYPE I.
LENGTH = STRLEN( WF_STRING1 ).
DATA: VALUE_FIELD TYPE NAME_KOMP.
DATA: VALUE TYPE REF TO DATA.
FIELD-SYMBOLS: <FS_CONVERTED_DATA>.
DATA: TAB1 TYPE TABLE OF STRING.
DATA: FROM_LENGTH TYPE I VALUE 1.
DATA: TO_LENGTH TYPE I.
DATA: DIFF TYPE I.
DATA: START TYPE I VALUE 1.
DO.
* JOBCODE.
SEARCH WF_STRING1 FOR 'JobCode=' . "STARTING AT START .
IF SY-SUBRC <> 0.
EXIT.
ENDIF.
FROM_LENGTH = SY-FDPOS .
FROM_LENGTH = FROM_LENGTH + 8.
SEARCH WF_STRING1 FOR 'JobDescription=' ."STARTING AT START ..
TO_LENGTH = SY-FDPOS .
DIFF = TO_LENGTH - FROM_LENGTH .
MOVE WF_STRING1+FROM_LENGTH(DIFF) TO TAB-JOBCODE.
TO_LENGTH = DIFF + TO_LENGTH.
SHIFT WF_STRING1 BY TO_LENGTH PLACES.
* COMPONENT CODE
SEARCH WF_STRING1 FOR 'ComponentCode=' .
IF SY-SUBRC <> 0.
EXIT.
ENDIF.
FROM_LENGTH = SY-FDPOS .
FROM_LENGTH = FROM_LENGTH + 14.
SEARCH WF_STRING1 FOR 'ComponentDescription=' .
TO_LENGTH = SY-FDPOS .
DIFF = TO_LENGTH - FROM_LENGTH .
MOVE WF_STRING1+FROM_LENGTH(DIFF) TO TAB-COMPONENTCODE.
TO_LENGTH = DIFF + TO_LENGTH.
SHIFT WF_STRING1 BY TO_LENGTH PLACES.
* AccurateHours
SEARCH WF_STRING1 FOR 'AccurateHours=' .
IF SY-SUBRC <> 0.
EXIT.
ENDIF.
FROM_LENGTH = SY-FDPOS .
FROM_LENGTH = FROM_LENGTH + 14.
SEARCH WF_STRING1 FOR 'AccurateCost='.
TO_LENGTH = SY-FDPOS .
DIFF = TO_LENGTH - FROM_LENGTH .
MOVE WF_STRING1+FROM_LENGTH(DIFF) TO TAB-ACCURATEHOURS.
TO_LENGTH = DIFF + TO_LENGTH.
* AccurateCost
SEARCH WF_STRING1 FOR 'AccurateCost='.
FROM_LENGTH = SY-FDPOS.
FROM_LENGTH = FROM_LENGTH + 13.
SEARCH WF_STRING1 FOR '/>'.
TO_LENGTH = SY-FDPOS.
DIFF = TO_LENGTH - FROM_LENGTH .
MOVE WF_STRING1+FROM_LENGTH(DIFF) TO TAB-ACCURATECOST.
TO_LENGTH = DIFF + TO_LENGTH.
SHIFT WF_STRING1 BY TO_LENGTH PLACES.
APPEND TAB TO OUTTAB.
ENDDO.
WRITE: (10) 'JOBCODE'.
WRITE (20) 'COMPONENTCODE'.
WRITE (30) 'ACCURATEHOURS'.
WRITE (40) 'ACCURATECOST'.
LOOP AT OUTTAB INTO TAB.
WRITE:/ TAB-JOBCODE .
WRITE (20) TAB-COMPONENTCODE.
WRITE (30) TAB-ACCURATEHOURS.
WRITE (40) TAB-ACCURATECOST.
ENDLOOP .
Message was edited by:
Raja T -
Error Consuming a webservice from ABAP
Hi all,
I am consuming an external webservice from abap. I created teh proxy using WSDl file. While testing teh service its giving an exception like this-
"JAXB unmarshalling exception: Unable to create an instance of de.*******v2.MeldungType; nested exception is javax.xml.bind.UnmarshalExcept
ion: Unable to create an instance of de.****.MeldungType# - with linked exception:#[java.lang.InstantiationException]"
With a soapfaultcode: 1..
can any one help out in arriving at teh reason for this..
Regards
SandeepI've seen lots of unmarshalling errors whilst trying to consume web services via Web Dynpro Java... Usually, it was due to an inconsistency between the WSDL file being used and the underlying web service definition. It might be worth checking the WSDL you are using is correct and up to date, in case the underlying service interface has changed.
Also worth checking if you have any simple boolean type parameters defined as part of the service interface - they have to have a value assigned when you call the service and cannot be null.
HTH. -
Consume external webservice from ABAP
Hello all,
Can we consume external web service from ABAP??
If yes please gimme a sample code to do that..
Thanks in advance..
Regards,
MayaCan we consume external web service from ABAP in version 4.7??
-
Consuming Sharepoint webservice from Abap
Hi, I have a need to access a Sharepoint database from SAP. I am using the search.aspx webservice that sharepoint offers, or at least trying to. I set up an abap proxy from the WSDL that sharepoint supplied (which was not the best WSDL). From my ABAP I need to call the sharepoint service and I am having a little difficulty getting a result back.
Here is the ABAP code I have so far:
DATA: gr_query TYPE REF TO zgms_cycletimeco_query_service,
gs_input TYPE zgms_cycletimequery_soap_in,
gs_output TYPE zgms_cycletimequery_soap_out.
DATA: oref TYPE REF TO cx_root,
text TYPE string,
oref2 TYPE REF TO cx_root,
text2 TYPE string.
CREATE OBJECT gr_query.
CONCATENATE 'get_text( ).
ENDTRY.
I am trying to retrieve the record that contains HE2009-0624-084648 with no luck.
The error message I get says no results found.
Does anyone know what I am doing wrong? Do I need to specify the field in sharepoint that contains this data?
Thanks in advance,
RenéThanks for your reply. I actually tested today in SE80 on the proxy, and the request was formatted as:
<n0:Query xmlns:n0="urn:Microsoft.Search" xmlns:prx="urn:sap.com:proxy:PLD:/1SAI/TAS4ADD6B94366302A825F7:700:2007/10/04">
<n0:queryXml>This is a string 6</n0:queryXml>
</n0:Query>
When I execute it, the reponse is:
- <n0:QueryResponse xmlns:n0="urn:Microsoft.Search" xmlns:prx="urn:sap.com:proxy:PLD:/1SAI/TAS4ADD6B94366302A825F7:700:2007/10/04">
<n0:QueryResult><ResponsePacket xmlns="urn:Microsoft.Search.Response"><Response domain=""><Status>ERROR_BAD_REQUEST</Status><DebugErrorMessage>Data at the root level is invalid. Line 1, position 1.</DebugErrorMessage></Response></ResponsePacket></n0:QueryResult>
</n0:QueryResponse>
I don't really know what the format would be in between the queryXml tags. If anyone knows, please help!
Thanks. -
Calling webservices from ABAP via https/ssl with p12 certificates.
Hi all,
I have a problem with calling an external webservice via HTTPS.
I configured my system as indicate in the blog /people/jens.gleichmann/blog/2008/10/31/calling-webservices-from-abap-via-httpsssl-with-pfx-certificates but when I check the RFC connection the result is: ICM_HTTP_SSL_ERROR.
I check the ICM monitor and this is the result:
[Thr 11] Thu May 26 16:02:57 2011
[Thr 11] *** ERROR during SecudeSSL_SessionStart() from SSL_connect()==SSL_ERROR_SSL
[Thr 11] session uses PSE file "/usr/sap/SV5/DVEBMGS10/sec/SAPSSLHTTPS1.pse"
[Thr 11] SecudeSSL_SessionStart: SSL_connect() failed
secude_error 536875072 (0x20001040) = "received a fatal SSLv3 handshake failure alert message from the peer"
[Thr 11] >> Begin of Secude-SSL Errorstack >>
[Thr 11] WARNING in ssl3_read_bytes: (536875072/0x20001040) received a fatal SSLv3 handshake failure alert message from the peer
WARNING in ssl3_output_cert_chain: (12354/0x3042) No hierarchy certificate in FCPath
WARNING in reduce_FCPath_by_Issuer: (12354/0x3042) No hierarchy certificate in FCPath
[Thr 11] << End of Secude-SSL Errorstack
[Thr 11] SSL_get_state() returned 0x000021d0 "SSLv3 read finished A"
[Thr 11] Server's List of trusted CA DNames (from cert-request message):
[Thr 11] #1 " certificate 1
[Thr 11] #2 " certificate 2
[Thr 11] SSL NI-sock: local=ip peer=ip2
[Thr 11] <<- ERROR: SapSSLSessionStart(sssl_hdl=6000000000652010)==SSSLERR_SSL_CONNECT
[Thr 11] *** ERROR => IcmConnInitClientSSL: SapSSLSessionStart failed (-57): SSSLERR_SSL_CONNECT [icxxconn_mt.c 2012]
SAP_ABA 700 0012 SAPKA70012 Componenti validi per tutte le applicazioni
SAP_BASIS 700 0012 SAPKB70012 Componenti di base SAP
PI_BASIS 2005_1_700 0012 SAPKIPYJ7C PI_BASIS 2005_1_700
ST-PI 2008_1_700 0001 SAPKITLRD1 SAP Solution Tools Plug-In
SAP_BW 700 0013 SAPKW70013 SAP NetWeaver BI 7.0
SAP_AP 700 0010 SAPKNA7010 Piatt. d'applicazione SAP
CCM 200_700 0010 SAPK-27010INCCM CCM 200_700 : Add-On Supplement
SRM_PLUS 550 0010 SAPKIBK010 SRM_PLUS per mySAP SRM
SRM_SERVER 550 0010 SAPKIBKT10 SRM_SERVER
BI_CONT 703 0001 SAPKIBIIP1 Contenuto Business Intelligence
ST-A/PI 01L_BCO700 0000 - Servicetools for other App./Netweaver 04
What do you think about it?
Best regards,
Norberto.Don´t forget to set your proxy settings! Be sure that the application server could establish a connection to the external server.
From the BLog.
Thr 11 WARNING in ssl3_read_bytes: (536875072/0x20001040) received a fatal SSLv3 handshake failure alert message from the peer
From the Error.
Have you looked into the above details?
Thanks
SM -
Consume webservice from ABAP : SoapFaultCode:4
Hi ,
I need your valuable ideas in overcoming the problem mentioned below.
This problem relates to consumption of a webservice from ABAP - Client Proxy without XI. The system is WAS 6.40.
I had created a client proxy (along with the corresponding methods) using a WSDL file pasted below. I had also created a logical port for the proxy class generated.
When I test the interface for one of the methods , I get the following error message.
<u>Error Message</u>
<?xml version="1.0" encoding="utf-8" ?>
- <asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
- <asx:values>
<SYSTEMFAULT href="#o103" />
</asx:values>
- <asx:heap xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:abap="http://www.sap.com/abapxml/types/built-in" xmlns:cls="http://www.sap.com/abapxml/classes/global" xmlns:dic="http://www.sap.com/abapxml/types/dictionary">
- <cls:CX_AI_SYSTEM_FAULT id="o103">
- <CX_ROOT>
<TEXTID>F63AFF63DBE4BB4786A7F52CC4167145</TEXTID>
<PREVIOUS />
<KERNEL_ERRID />
- <INTERNAL_SOURCE_POS>
<PROGID>193</PROGID>
<CONTID>1050</CONTID>
</INTERNAL_SOURCE_POS>
</CX_ROOT>
<CX_STATIC_CHECK />
- <CX_AI_SYSTEM_FAULT>
<CODECONTEXT>http://www.sap.com/xml_errorcodes</CODECONTEXT>
<CODE>SoapFaultCode:4</CODE>
<ERRORTEXT>System.Web.Services.Protocols.SoapException: Server did not recognize the value of HTTP Header SOAPAction: //10.136.129.245/PinnacleWebServices/DatabaseAvailable. at System.Web.Services.Protocols.Soap11ServerProtocolHelper.RouteRequest() at System.Web.Services.Protocols.SoapServerProtocol.Initialize() at System.Web.Services.Protocols.ServerProtocolFactory.Create(Type type, HttpContext context, HttpRequest request, HttpResponse response, Boolean& abortProcessing)</ERRORTEXT>
<LANGUAGE />
</CX_AI_SYSTEM_FAULT>
</cls:CX_AI_SYSTEM_FAULT>
</asx:heap>
</asx:abap>
<u>WDSL file used for creating the Client Proxy</u>
<?xml version="1.0" encoding="utf-8"?>
<wsdl:definitions xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="//10.136.129.245/PinnacleWebServices" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" targetNamespace="//10.136.129.245/PinnacleWebServices" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
<wsdl:types>
<s:schema elementFormDefault="qualified" targetNamespace="//10.136.129.245/PinnacleWebServices">
<s:element name="DatabaseAvailable">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="s_dbalias" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="DatabaseAvailableResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="DatabaseAvailableResult" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="AddCustomers">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="s_dbalias" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="s_xml" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="AddCustomersResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="AddCustomersResult" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="AddContracts">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="s_dbalias" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="s_xml" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="AddContractsResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="AddContractsResult" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="AddInstalledEquipment">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="s_dbalias" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="s_xml" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="AddInstalledEquipmentResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="AddInstalledEquipmentResult" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="AddProducts">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="s_dbalias" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="s_xml" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="AddProductsResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="AddProductsResult" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="AddCreditAlerts">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="s_dbalias" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="s_xml" type="s:string" />
<s:element minOccurs="1" maxOccurs="1" name="bool_updatecustomers" type="s:boolean" />
<s:element minOccurs="1" maxOccurs="1" name="bool_updatecontracts" type="s:boolean" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="AddCreditAlertsResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="AddCreditAlertsResult" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="AddStockFigures">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="s_dbalias" type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="s_xml" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="AddStockFiguresResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="AddStockFiguresResult" type="s:string" />
</s:sequence>
</s:complexType>
</s:element>
<s:element name="string" nillable="true" type="s:string" />
</s:schema>
</wsdl:types>
<wsdl:message name="DatabaseAvailableSoapIn">
<wsdl:part name="parameters" element="tns:DatabaseAvailable" />
</wsdl:message>
<wsdl:message name="DatabaseAvailableSoapOut">
<wsdl:part name="parameters" element="tns:DatabaseAvailableResponse" />
</wsdl:message>
<wsdl:message name="AddCustomersSoapIn">
<wsdl:part name="parameters" element="tns:AddCustomers" />
</wsdl:message>
<wsdl:message name="AddCustomersSoapOut">
<wsdl:part name="parameters" element="tns:AddCustomersResponse" />
</wsdl:message>
<wsdl:message name="AddContractsSoapIn">
<wsdl:part name="parameters" element="tns:AddContracts" />
</wsdl:message>
<wsdl:message name="AddContractsSoapOut">
<wsdl:part name="parameters" element="tns:AddContractsResponse" />
</wsdl:message>
<wsdl:message name="AddInstalledEquipmentSoapIn">
<wsdl:part name="parameters" element="tns:AddInstalledEquipment" />
</wsdl:message>
<wsdl:message name="AddInstalledEquipmentSoapOut">
<wsdl:part name="parameters" element="tns:AddInstalledEquipmentResponse" />
</wsdl:message>
<wsdl:message name="AddProductsSoapIn">
<wsdl:part name="parameters" element="tns:AddProducts" />
</wsdl:message>
<wsdl:message name="AddProductsSoapOut">
<wsdl:part name="parameters" element="tns:AddProductsResponse" />
</wsdl:message>
<wsdl:message name="AddCreditAlertsSoapIn">
<wsdl:part name="parameters" element="tns:AddCreditAlerts" />
</wsdl:message>
<wsdl:message name="AddCreditAlertsSoapOut">
<wsdl:part name="parameters" element="tns:AddCreditAlertsResponse" />
</wsdl:message>
<wsdl:message name="AddStockFiguresSoapIn">
<wsdl:part name="parameters" element="tns:AddStockFigures" />
</wsdl:message>
<wsdl:message name="AddStockFiguresSoapOut">
<wsdl:part name="parameters" element="tns:AddStockFiguresResponse" />
</wsdl:message>
<wsdl:message name="DatabaseAvailableHttpGetIn">
<wsdl:part name="s_dbalias" type="s:string" />
</wsdl:message>
<wsdl:message name="DatabaseAvailableHttpGetOut">
<wsdl:part name="Body" element="tns:string" />
</wsdl:message>
<wsdl:message name="AddCustomersHttpGetIn">
<wsdl:part name="s_dbalias" type="s:string" />
<wsdl:part name="s_xml" type="s:string" />
</wsdl:message>
<wsdl:message name="AddCustomersHttpGetOut">
<wsdl:part name="Body" element="tns:string" />
</wsdl:message>
<wsdl:message name="AddContractsHttpGetIn">
<wsdl:part name="s_dbalias" type="s:string" />
<wsdl:part name="s_xml" type="s:string" />
</wsdl:message>
<wsdl:message name="AddContractsHttpGetOut">
<wsdl:part name="Body" element="tns:string" />
</wsdl:message>
<wsdl:message name="AddInstalledEquipmentHttpGetIn">
<wsdl:part name="s_dbalias" type="s:string" />
<wsdl:part name="s_xml" type="s:string" />
</wsdl:message>
<wsdl:message name="AddInstalledEquipmentHttpGetOut">
<wsdl:part name="Body" element="tns:string" />
</wsdl:message>
<wsdl:message name="AddProductsHttpGetIn">
<wsdl:part name="s_dbalias" type="s:string" />
<wsdl:part name="s_xml" type="s:string" />
</wsdl:message>
<wsdl:message name="AddProductsHttpGetOut">
<wsdl:part name="Body" element="tns:string" />
</wsdl:message>
<wsdl:message name="AddCreditAlertsHttpGetIn">
<wsdl:part name="s_dbalias" type="s:string" />
<wsdl:part name="s_xml" type="s:string" />
<wsdl:part name="bool_updatecustomers" type="s:string" />
<wsdl:part name="bool_updatecontracts" type="s:string" />
</wsdl:message>
<wsdl:message name="AddCreditAlertsHttpGetOut">
<wsdl:part name="Body" element="tns:string" />
</wsdl:message>
<wsdl:message name="AddStockFiguresHttpGetIn">
<wsdl:part name="s_dbalias" type="s:string" />
<wsdl:part name="s_xml" type="s:string" />
</wsdl:message>
<wsdl:message name="AddStockFiguresHttpGetOut">
<wsdl:part name="Body" element="tns:string" />
</wsdl:message>
<wsdl:message name="DatabaseAvailableHttpPostIn">
<wsdl:part name="s_dbalias" type="s:string" />
</wsdl:message>
<wsdl:message name="DatabaseAvailableHttpPostOut">
<wsdl:part name="Body" element="tns:string" />
</wsdl:message>
<wsdl:message name="AddCustomersHttpPostIn">
<wsdl:part name="s_dbalias" type="s:string" />
<wsdl:part name="s_xml" type="s:string" />
</wsdl:message>
<wsdl:message name="AddCustomersHttpPostOut">
<wsdl:part name="Body" element="tns:string" />
</wsdl:message>
<wsdl:message name="AddContractsHttpPostIn">
<wsdl:part name="s_dbalias" type="s:string" />
<wsdl:part name="s_xml" type="s:string" />
</wsdl:message>
<wsdl:message name="AddContractsHttpPostOut">
<wsdl:part name="Body" element="tns:string" />
</wsdl:message>
<wsdl:message name="AddInstalledEquipmentHttpPostIn">
<wsdl:part name="s_dbalias" type="s:string" />
<wsdl:part name="s_xml" type="s:string" />
</wsdl:message>
<wsdl:message name="AddInstalledEquipmentHttpPostOut">
<wsdl:part name="Body" element="tns:string" />
</wsdl:message>
<wsdl:message name="AddProductsHttpPostIn">
<wsdl:part name="s_dbalias" type="s:string" />
<wsdl:part name="s_xml" type="s:string" />
</wsdl:message>
<wsdl:message name="AddProductsHttpPostOut">
<wsdl:part name="Body" element="tns:string" />
</wsdl:message>
<wsdl:message name="AddCreditAlertsHttpPostIn">
<wsdl:part name="s_dbalias" type="s:string" />
<wsdl:part name="s_xml" type="s:string" />
<wsdl:part name="bool_updatecustomers" type="s:string" />
<wsdl:part name="bool_updatecontracts" type="s:string" />
</wsdl:message>
<wsdl:message name="AddCreditAlertsHttpPostOut">
<wsdl:part name="Body" element="tns:string" />
</wsdl:message>
<wsdl:message name="AddStockFiguresHttpPostIn">
<wsdl:part name="s_dbalias" type="s:string" />
<wsdl:part name="s_xml" type="s:string" />
</wsdl:message>
<wsdl:message name="AddStockFiguresHttpPostOut">
<wsdl:part name="Body" element="tns:string" />
</wsdl:message>
<wsdl:portType name="Pinnacle_x0020_Web_x0020_ServicesSoap">
<wsdl:operation name="DatabaseAvailable">
<documentation xmlns="http://schemas.xmlsoap.org/wsdl/">Checks if a connection to the selected database is available.</documentation>
<wsdl:input message="tns:DatabaseAvailableSoapIn" />
<wsdl:output message="tns:DatabaseAvailableSoapOut" />
</wsdl:operation>
<wsdl:operation name="AddCustomers">
<documentation xmlns="http://schemas.xmlsoap.org/wsdl/">Add or Update Customers within Service Director</documentation>
<wsdl:input message="tns:AddCustomersSoapIn" />
<wsdl:output message="tns:AddCustomersSoapOut" />
</wsdl:operation>
<wsdl:operation name="AddContracts">
<documentation xmlns="http://schemas.xmlsoap.org/wsdl/">Add or Update Contracts within Service Director</documentation>
<wsdl:input message="tns:AddContractsSoapIn" />
<wsdl:output message="tns:AddContractsSoapOut" />
</wsdl:operation>
<wsdl:operation name="AddInstalledEquipment">
<documentation xmlns="http://schemas.xmlsoap.org/wsdl/">Add or Update Installed Equipment within Service Director</documentation>
<wsdl:input message="tns:AddInstalledEquipmentSoapIn" />
<wsdl:output message="tns:AddInstalledEquipmentSoapOut" />
</wsdl:operation>
<wsdl:operation name="AddProducts">
<documentation xmlns="http://schemas.xmlsoap.org/wsdl/">Add or Update Products within Service Director</documentation>
<wsdl:input message="tns:AddProductsSoapIn" />
<wsdl:output message="tns:AddProductsSoapOut" />
</wsdl:operation>
<wsdl:operation name="AddCreditAlerts">
<documentation xmlns="http://schemas.xmlsoap.org/wsdl/">Add Credit Alerts to Customers and/or Contracts within Service Director. Warning - Will remove all credit alerts first as it assumes a full list is provided every time.</documentation>
<wsdl:input message="tns:AddCreditAlertsSoapIn" />
<wsdl:output message="tns:AddCreditAlertsSoapOut" />
</wsdl:operation>
<wsdl:operation name="AddStockFigures">
<documentation xmlns="http://schemas.xmlsoap.org/wsdl/">Add Stock Figures to mobile_data_connector within Service Director in order that the PDA get updated.</documentation>
<wsdl:input message="tns:AddStockFiguresSoapIn" />
<wsdl:output message="tns:AddStockFiguresSoapOut" />
</wsdl:operation>
</wsdl:portType>
<wsdl:portType name="Pinnacle_x0020_Web_x0020_ServicesHttpGet">
<wsdl:operation name="DatabaseAvailable">
<documentation xmlns="http://schemas.xmlsoap.org/wsdl/">Checks if a connection to the selected database is available.</documentation>
<wsdl:input message="tns:DatabaseAvailableHttpGetIn" />
<wsdl:output message="tns:DatabaseAvailableHttpGetOut" />
</wsdl:operation>
<wsdl:operation name="AddCustomers">
<documentation xmlns="http://schemas.xmlsoap.org/wsdl/">Add or Update Customers within Service Director</documentation>
<wsdl:input message="tns:AddCustomersHttpGetIn" />
<wsdl:output message="tns:AddCustomersHttpGetOut" />
</wsdl:operation>
<wsdl:operation name="AddContracts">
<documentation xmlns="http://schemas.xmlsoap.org/wsdl/">Add or Update Contracts within Service Director</documentation>
<wsdl:input message="tns:AddContractsHttpGetIn" />
<wsdl:output message="tns:AddContractsHttpGetOut" />
</wsdl:operation>
<wsdl:operation name="AddInstalledEquipment">
<documentation xmlns="http://schemas.xmlsoap.org/wsdl/">Add or Update Installed Equipment within Service Director</documentation>
<wsdl:input message="tns:AddInstalledEquipmentHttpGetIn" />
<wsdl:output message="tns:AddInstalledEquipmentHttpGetOut" />
</wsdl:operation>
<wsdl:operation name="AddProducts">
<documentation xmlns="http://schemas.xmlsoap.org/wsdl/">Add or Update Products within Service Director</documentation>
<wsdl:input message="tns:AddProductsHttpGetIn" />
<wsdl:output message="tns:AddProductsHttpGetOut" />
</wsdl:operation>
<wsdl:operation name="AddCreditAlerts">
<documentation xmlns="http://schemas.xmlsoap.org/wsdl/">Add Credit Alerts to Customers and/or Contracts within Service Director. Warning - Will remove all credit alerts first as it assumes a full list is provided every time.</documentation>
<wsdl:input message="tns:AddCreditAlertsHttpGetIn" />
<wsdl:output message="tns:AddCreditAlertsHttpGetOut" />
</wsdl:operation>
<wsdl:operation name="AddStockFigures">
<documentation xmlns="http://schemas.xmlsoap.org/wsdl/">Add Stock Figures to mobile_data_connector within Service Director in order that the PDA get updated.</documentation>
<wsdl:input message="tns:AddStockFiguresHttpGetIn" />
<wsdl:output message="tns:AddStockFiguresHttpGetOut" />
</wsdl:operation>
</wsdl:portType>
<wsdl:portType name="Pinnacle_x0020_Web_x0020_ServicesHttpPost">
<wsdl:operation name="DatabaseAvailable">
<documentation xmlns="http://schemas.xmlsoap.org/wsdl/">Checks if a connection to the selected database is available.</documentation>
<wsdl:input message="tns:DatabaseAvailableHttpPostIn" />
<wsdl:output message="tns:DatabaseAvailableHttpPostOut" />
</wsdl:operation>
<wsdl:operation name="AddCustomers">
<documentation xmlns="http://schemas.xmlsoap.org/wsdl/">Add or Update Customers within Service Director</documentation>
<wsdl:input message="tns:AddCustomersHttpPostIn" />
<wsdl:output message="tns:AddCustomersHttpPostOut" />
</wsdl:operation>
<wsdl:operation name="AddContracts">
<documentation xmlns="http://schemas.xmlsoap.org/wsdl/">Add or Update Contracts within Service Director</documentation>
<wsdl:input message="tns:AddContractsHttpPostIn" />
<wsdl:output message="tns:AddContractsHttpPostOut" />
</wsdl:operation>
<wsdl:operation name="AddInstalledEquipment">
<documentation xmlns="http://schemas.xmlsoap.org/wsdl/">Add or Update Installed Equipment within Service Director</documentation>
<wsdl:input message="tns:AddInstalledEquipmentHttpPostIn" />
<wsdl:output message="tns:AddInstalledEquipmentHttpPostOut" />
</wsdl:operation>
<wsdl:operation name="AddProducts">
<documentation xmlns="http://schemas.xmlsoap.org/wsdl/">Add or Update Products within Service Director</documentation>
<wsdl:input message="tns:AddProductsHttpPostIn" />
<wsdl:output message="tns:AddProductsHttpPostOut" />
</wsdl:operation>
<wsdl:operation name="AddCreditAlerts">
<documentation xmlns="http://schemas.xmlsoap.org/wsdl/">Add Credit Alerts to Customers and/or Contracts within Service Director. Warning - Will remove all credit alerts first as it assumes a full list is provided every time.</documentation>
<wsdl:input message="tns:AddCreditAlertsHttpPostIn" />
<wsdl:output message="tns:AddCreditAlertsHttpPostOut" />
</wsdl:operation>
<wsdl:operation name="AddStockFigures">
<documentation xmlns="http://schemas.xmlsoap.org/wsdl/">Add Stock Figures to mobile_data_connector within Service Director in order that the PDA get updated.</documentation>
<wsdl:input message="tns:AddStockFiguresHttpPostIn" />
<wsdl:output message="tns:AddStockFiguresHttpPostOut" />
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="Pinnacle_x0020_Web_x0020_ServicesSoap" type="tns:Pinnacle_x0020_Web_x0020_ServicesSoap">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
<wsdl:operation name="DatabaseAvailable">
<soap:operation soapAction="//10.136.129.245/PinnacleWebServices/DatabaseAvailable" style="document" />
<wsdl:input>
<soap:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="AddCustomers">
<soap:operation soapAction="//10.136.129.245/PinnacleWebServices/AddCustomers" style="document" />
<wsdl:input>
<soap:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="AddContracts">
<soap:operation soapAction="//10.136.129.245/PinnacleWebServices/AddContracts" style="document" />
<wsdl:input>
<soap:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="AddInstalledEquipment">
<soap:operation soapAction="//10.136.129.245/PinnacleWebServices/AddInstalledEquipment" style="document" />
<wsdl:input>
<soap:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="AddProducts">
<soap:operation soapAction="//10.136.129.245/PinnacleWebServices/AddProducts" style="document" />
<wsdl:input>
<soap:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="AddCreditAlerts">
<soap:operation soapAction="//10.136.129.245/PinnacleWebServices/AddCreditAlerts" style="document" />
<wsdl:input>
<soap:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="AddStockFigures">
<soap:operation soapAction="//10.136.129.245/PinnacleWebServices/AddStockFigures" style="document" />
<wsdl:input>
<soap:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:binding name="Pinnacle_x0020_Web_x0020_ServicesHttpGet" type="tns:Pinnacle_x0020_Web_x0020_ServicesHttpGet">
<http:binding verb="GET" />
<wsdl:operation name="DatabaseAvailable">
<http:operation location="/DatabaseAvailable" />
<wsdl:input>
<http:urlEncoded />
</wsdl:input>
<wsdl:output>
<mime:mimeXml part="Body" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="AddCustomers">
<http:operation location="/AddCustomers" />
<wsdl:input>
<http:urlEncoded />
</wsdl:input>
<wsdl:output>
<mime:mimeXml part="Body" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="AddContracts">
<http:operation location="/AddContracts" />
<wsdl:input>
<http:urlEncoded />
</wsdl:input>
<wsdl:output>
<mime:mimeXml part="Body" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="AddInstalledEquipment">
<http:operation location="/AddInstalledEquipment" />
<wsdl:input>
<http:urlEncoded />
</wsdl:input>
<wsdl:output>
<mime:mimeXml part="Body" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="AddProducts">
<http:operation location="/AddProducts" />
<wsdl:input>
<http:urlEncoded />
</wsdl:input>
<wsdl:output>
<mime:mimeXml part="Body" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="AddCreditAlerts">
<http:operation location="/AddCreditAlerts" />
<wsdl:input>
<http:urlEncoded />
</wsdl:input>
<wsdl:output>
<mime:mimeXml part="Body" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="AddStockFigures">
<http:operation location="/AddStockFigures" />
<wsdl:input>
<http:urlEncoded />
</wsdl:input>
<wsdl:output>
<mime:mimeXml part="Body" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:binding name="Pinnacle_x0020_Web_x0020_ServicesHttpPost" type="tns:Pinnacle_x0020_Web_x0020_ServicesHttpPost">
<http:binding verb="POST" />
<wsdl:operation name="DatabaseAvailable">
<http:operation location="/DatabaseAvailable" />
<wsdl:input>
<mime:content type="application/x-www-form-urlencoded" />
</wsdl:input>
<wsdl:output>
<mime:mimeXml part="Body" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="AddCustomers">
<http:operation location="/AddCustomers" />
<wsdl:input>
<mime:content type="application/x-www-form-urlencoded" />
</wsdl:input>
<wsdl:output>
<mime:mimeXml part="Body" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="AddContracts">
<http:operation location="/AddContracts" />
<wsdl:input>
<mime:content type="application/x-www-form-urlencoded" />
</wsdl:input>
<wsdl:output>
<mime:mimeXml part="Body" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="AddInstalledEquipment">
<http:operation location="/AddInstalledEquipment" />
<wsdl:input>
<mime:content type="application/x-www-form-urlencoded" />
</wsdl:input>
<wsdl:output>
<mime:mimeXml part="Body" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="AddProducts">
<http:operation location="/AddProducts" />
<wsdl:input>
<mime:content type="application/x-www-form-urlencoded" />
</wsdl:input>
<wsdl:output>
<mime:mimeXml part="Body" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="AddCreditAlerts">
<http:operation location="/AddCreditAlerts" />
<wsdl:input>
<mime:content type="application/x-www-form-urlencoded" />
</wsdl:input>
<wsdl:output>
<mime:mimeXml part="Body" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="AddStockFigures">
<http:operation location="/AddStockFigures" />
<wsdl:input>
<mime:content type="application/x-www-form-urlencoded" />
</wsdl:input>
<wsdl:output>
<mime:mimeXml part="Body" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="Pinnacle_x0020_Web_x0020_Services">
<wsdl:port name="Pinnacle_x0020_Web_x0020_ServicesSoap" binding="tns:Pinnacle_x0020_Web_x0020_ServicesSoap">
<soap:address location="http://10.136.129.245/pinnaclewebservices/maintenance.asmx" />
</wsdl:port>
<wsdl:port name="Pinnacle_x0020_Web_x0020_ServicesHttpGet" binding="tns:Pinnacle_x0020_Web_x0020_ServicesHttpGet">
<http:address location="http://10.136.129.245/pinnaclewebservices/maintenance.asmx" />
</wsdl:port>
<wsdl:port name="Pinnacle_x0020_Web_x0020_ServicesHttpPost" binding="tns:Pinnacle_x0020_Web_x0020_ServicesHttpPost">
<http:address location="http://10.136.129.245/pinnaclewebservices/maintenance.asmx" />
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
Thanks in advance.Hi Raja,
Thanks for your prompt reply. I tried changing in the WSDL file the SOAP action parameters (http) like you said and still I got the same error message while testing the interface.
I have corrected the problem by trying a different approach. Earlier I used file option for Client Proxy creation and I got the error message.
Now I created the Client Proxy by using the option URL/HTTP destination ( which was also showing errors earlier but it is OK now after our Network Specialists opened the concerned port.)
Your reply was usefull as it helped me to check the "Soap Action" in the "OPERATIONS" tab of the "LOGICAL PORT" for the client proxy. I have awarded the points for that.
I have seen your Blogs and the your replies to the questions in this form. I would like to thank you and all the like minded contributors of this forum. Keep up the good work.
Regards.
François -
Method class for calling/executing VB script from abap
Hi All,
I need to call a vb script from abap.
This vb script performs some function then.
For executing this VB script i use the method CL CL_GUI_FRONTEND_SERVICES=>Execute.
Now i need to pass data to the vb script in the from of a structure/workarea.
Does anyone have any idea on what class/method shoul i use?
Regards,
Harshit RungtaCheck Connect VB to SAP
Kanagaraja L -
CALL A JAVA PROGRAM FROM ABAP -- NEED HELP
Hi all,
Can somebody tell me how to call a java xml code from an ABAP program? First let me know if at all, is it possible to call a java program from SAP that is from an ABAP executable progam?
Please suggest me in this. All your inputs in this is valuable to me and highly appreciated.
Thanks in advance,
Vaishnavi VaradarajanHi,
Previous explanation i gave is not correct.
ABAP web services expose the function modules outside R/3, so that other technologies like Java can consume that webservice and read the data in R/3 using the function module.
For your requirement, create a Java web service to read the XML. Consume this webservice in ABAP. This way you can read the XML from ABAP.
Regards
Srikanth KV. -
Calling external web service from ABAP Program
Hi All,
Can somebody point me to the documentation where how to call an external (3rd party) web service from ABAP program is explained?
Thanks & Regards,
-Smitawhich version of R/3 you are using. if you are on was 6.40 its very simple, there are delivered tools to generate client proxy for consuming webservice. if you are on wa 6.20 you can use cl_http_client to achieve the same. check out the following weblogs.
/people/durairaj.athavanraja/blog/2005/07/12/send-sms-to-india-from-abap
/people/thomas.jung3/blog/2005/05/13/calling-webservices-from-abap-via-https
/people/thomas.jung3/blog/2004/11/17/bsp-a-developers-journal-part-xiv--consuming-webservices-with-abap
Regards
Raja -
Calling a web service from abap
Hi all,
I want to call a webservice from ABAP.
In my report i use the below code .
web_rul =' http://test.asmx'.
CALL METHOD CL_HTTP_CLIENT=>CREATE_BY_URL
EXPORTING
URL = WEB_URL
IMPORTING
CLIENT = CLIENT
EXCEPTIONS
ARGUMENT_NOT_FOUND = 1
PLUGIN_NOT_ACTIVE = 2
INTERNAL_ERROR = 3
OTHERS = 4.
CLIENT->REQUEST->SET_HEADER_FIELD( NAME = '~REQUEST_METHOD' VALUE = 'GET' ).
CLIENT->SEND( ).
CALL METHOD CLIENT->RECEIVE
EXCEPTIONS
HTTP_COMMUNICATION_FAILURE = 1
HTTP_INVALID_STATE = 2
HTTP_PROCESSING_FAILED = 3
OTHERS = 4.
RET_DATA = CLIENT->RESPONSE->GET_CDATA( ).
REPLACE ALL OCCURRENCES OF '<' IN RET_DATA WITH '<' .
REPLACE ALL OCCURRENCES OF '>' IN RET_DATA WITH '>' .
Please correct me if my approach is wrong. when i execute the report the value in ret_Data is
####<html>#### <head><link rel="alternate" type="text/xml" href="test.asmx?disco" />#### <style type="text/css">## ####BODY { color: #000000; background-color: white; font-family: Verdana; margin-left: 0px; margin-top: 0px
what is the mistake in this. how should i call the webservice from abap.
Regards,
SubasreeHi,
Here is a sample code I've been using for CL_HTTP_CLIENT.
PARAMETERS pa_symbl TYPE string.
CONSTANTS:
cv_host TYPE string VALUE 'www.webservicex.net',
cv_host1 TYPE string VALUE 'http://www.webservicex.net:80',
cv_service TYPE string VALUE '80',
cv_soapaction TYPE string VALUE 'http://www.webserviceX.NET/GetQuote'.
DATA: li_client TYPE REF TO if_http_client,
lv_path TYPE string VALUE '/stockquote.asmx/GetQuote?symbol=',
lv_tmp TYPE string.
CL_HTTP_CLIENT=>CREATE(
EXPORTING
HOST = cv_host
SERVICE = cv_service
SCHEME = '1'
IMPORTING
CLIENT = li_client
EXCEPTIONS
ARGUMENT_NOT_FOUND = 1
INTERNAL_ERROR = 2
PLUGIN_NOT_ACTIVE = 3
OTHERS = 4 ).
*CL_HTTP_CLIENT=>CREATE_BY_URL(
* EXPORTING
* URL = cv_host1
* IMPORTING
* CLIENT = li_client
* EXCEPTIONS
* ARGUMENT_NOT_FOUND = 1
* INTERNAL_ERROR = 2
* PLUGIN_NOT_ACTIVE = 3
* OTHERS = 4 ).
CONDENSE pa_symbl.
CONCATENATE lv_path pa_symbl INTO lv_path.
li_client->REQUEST->SET_HEADER_FIELD(
EXPORTING
NAME = '`~request_method'
VALUE = 'GET' ).
li_client->REQUEST->SET_HEADER_FIELD(
EXPORTING
NAME = '~server_protocol'
VALUE = 'HTTP/1.1' ).
li_client->REQUEST->SET_HEADER_FIELD(
EXPORTING
NAME = '~request_uri'
VALUE = lv_path ).
li_client->SEND( "sends the HTTP REQUEST
EXPORTING
TIMEOUT = 300
EXCEPTIONS
HTTP_COMMUNICATION_FAILURE = 1
HTTP_INVALID_STATE = 2
HTTP_PROCESSING_FAILED = 3
OTHERS = 4 ).
li_client->RECEIVE( "receives the HTTP RESPONSE
EXCEPTIONS
HTTP_COMMUNICATION_FAILURE = 1
HTTP_INVALID_STATE = 2
HTTP_PROCESSING_FAILED = 3
OTHERS = 4 ).
lv_tmp = li_client->RESPONSE->GET_CDATA( ).
The code will allow you to call the stockquote webservice using GET
http://www.webservicex.net/stockquote.asmx?op=GetQuote
Your code is missing the request uri which is needed in a GET call.
Hope this helps,
Mark -
Consuming PI Webservice from Webdynpro Java Not working
Hello SAP,
Environment: CE 7.2.
Resolution expected immediately, Helpful answer is highly appreciated.
Is the namespace should not exceed 60char for PI Webservice, for executing the webservice from Webdynpro Java.
I tried with all the options in executing the PI Service from Webdynpro Java, None of the options worked. I am facing the below error while I was calling the PI Webservice.
I don't see any problem from Webdynpro Java, what ever the procedure I have followed is the standard procedure.
Fortunately when I execute the service from Webservice Navigator, it is working as expected. The same webservice when I consume it from Webdynpro Java it is not working
Options tried so far:
1) Published the Services to Service Registry and there by consuming the PI Service from Service Registry - Not worked
2) Tweaked the URL with few options - Not worked (Tweaking the URL, ex: portType, Binding)
3) Changing the Business Systems in PI and there after calling the service - Not worked
4) Initializing the code, instead of creating Service Controller and calling the PI Service - Not worked.
5) Created a Provider System and tried to call the PI Webservice from Provider System - Not Worked
For all the Options, I am facing the same error which is provided in the screenshot.
Below procedure which I have followed for calling the PI Webservice:
1) Created Adaptive Webservice Model
2) Provided PI Webservice URL (It prompts for PI System UserId and Password)
3) Selected Option - No Service Group Configuration
4) Provided Logical Destination
6) Completed creation of Model
7) Added the model as a UsedModel
8) Right Click on Comp Contr. and selected Apply Template and Created a ServiceController for the model (Entire mapping to comp contr, Initializing the nodes is taken care by Service Contr.)
9) Created an Template Action button and there by calling execute method which is auto rendered from CompContr..
10) Build the project.
11) Activated the code and Run the Application.
12) Getting the below error which is showed in the message.
ERROR MESSAGE:
Exception on execution of web service on destination 'GetPIHRPeopleData' for operation 'SI_CreateHRPeopleData_OS' in interface 'SI_CreatePeopleCompany_OS'Hi Sankar,
If the webservice is working fine in the Wsnavigator then there is some problem with importing the webservice in webdynpro for Java. Please check the required parameter for creating the Adaptive Webservice Model. After adding in the used model and compoent controller binding, you need to write code for to execute the webservice model.
Please check the code for initialization and execution for the webservice and then test it.
Best Regards,
Arun Jaiswal -
Problem while Consuming Java Webservice from WCF client
Hi,
I am trying to Consume Java Webservice from WCF client.The webservice main functionality is digital data management.The client can Query Digital data and upload digital data by calling webservice methods.Problem is when i am trying to call webmethod from WCF client its giving "Unrecognised message versions".I have no idea about how the message objects are processed at serverside.but at server side they have used JAXP for XML document parsing.
The response content type is Multipart/related and applicatio/XOP+XML.
Can u plz help me how to handle this situation.I have minimum knowledge in Java WS architecture.Basically i am .Net programmer.
Can U please guide me in a proper way to resolve the problem.Hi Abinash,
I have the same problem. Have you solve that problem?
I am using a java program to call a webservice too. And I have generated the client proxy definition for Stand alone proxy using NWDS. When I call the method of the webservice I am getting the correct result but along with the result I am getting one error and one warning message in the output.
The java code to call the webservice is as follows.
MIDadosPessoaisSyncService service = new MIDadosPessoaisSyncServiceImpl();
MIDadosPessoaisSync port = service.getLogicalPort("MIDadosPessoaisSyncPort");
port._setProperty("javax.xml.rpc.security.auth.username","xpto");
port._setProperty("javax.xml.rpc.security.auth.password","xpto");
String out = port.MIDadosPessoaisSync("xpto", "xpto");
System.out.println(out);
The result I am getting is :
Warning ! Protocol Implementation [com.sap.engine.services.webservices.jaxrpc.wsdl2java.features.builtin.MessageIdProtocol] could not be loaded (NoClassDefFoundError) !
Error Message is :com/sap/guid/GUIDGeneratorFactory
<b>The result of the WS is correct!!!</b>
The Java project does not have any warning. But the stand alone proxy project has following warnings associated with it.
This method has a constructor name MIDadosPessoaisSync.java
The import javax.xml.rpc.holders is never used MIDadosPessoaisSyncBindingStub.java
The import javax.xml.rpc.encoding is never used MIDadosPessoaisSyncBindingStub.java
The constructor BaseRuntimeException(ResourceAccessor, String, Throwable) is deprecated MIDadosPessoaisSyncBindingStub.java
It is very similar with your problem, could you help me?
Thanks
Gustavo Freitas -
How to consume WEB SERVICES from ABAP ??
Q: How to consume WEB SERVICES from ABAP program??
the point here is i am using SAP release 620 and the creation of proxy is out of scenario
and also no XI. Its only through ABAP program i need to consume one web service (its a HTTPS one ),
Using cl_http_client... i tried it but i am totally confused of whats happening ???
Req some senior ppl advice on the same/approach.
any hints will suffice my way of approach...!!!
Please do put in your valuable advices..!!
Thanks in advance..!!!!Hello Srinivas,
Following is the code for calling web service:
data: client type ref to if_http_client,
host type string value 'server url',
service type string value '8080',
path type string value '/sap/public/ping',
errortext type string,
proxy_service type string,
scheme type i value 1.
call method cl_http_client=>create
exporting host = host
service = service
proxy_host = host
proxy_service = service
scheme = scheme
importing client = client
exceptions
argument_not_found = 1
internal_error = 2
plugin_not_active = 3
others = 4.
case sy-subrc.
when 0.
write 'Server reached successfully'.
when others.
write: 'sy-subrc =', sy-subrc.
endcase.
Once you got the client object you can call following methods:
"Set the requrie URL for the web service you want to call. This is not WSDL anyway!!
cl_http_utility=>set_request_uri( request = client->request
uri =' url 2 be called ').
*Then you can call send method with proper inputs for sending request to WS
CALL METHOD client->send
Then you can use receive method for getting the response
CALL METHOD client->receive
*You can get last error in case of exceptions
CALL METHOD cl_http_client=>get_last_error
*Close the client object
CALL METHOD client->close
For more information on full code refer my link in previous replay.
Thanks,
Augustin.
Edited by: Augustarian on Aug 18, 2009 1:49 PM -
As I can call to a API from ABAP (46C) ?
Hello.
As I can call to a API from ABAP (46C)?
Any idea?
THANKS.The answer to that question really depends upon the SAP WebAS (or Basis as it used to be known) release you are on.
Did you have a look at the weblog mentioned earlier in this thread:
/people/thomas.jung3/blog/2004/11/17/bsp-a-developers-journal-part-xiv--consuming-webservices-with-abap
It shows some examples on 620 and 640. Let us know what you have to work with, and we will see if we can help.
Maybe you are looking for
-
Adobe After Effects CS6 - how to uninstall/reinstall or transfer license to a new computer
My old computer has crashed, and so I built a new one recently. I have been installing all the applications for it, downloading files, so on and so forth. I recently insterted one of the hardrives from my old computer, and was able to see the fi
-
Prog. o/p in Italian language
Hi All, I need a favour from you. There is a report called RFUMSV00 (in ALV) which we want to run in Italian language. But when we run the program it doesn't show a column HEADING, with logon language italian. And we have a mini language pack for ita
-
Adobe Reader 10.0.1 on same machine as Acrobat 8 and 9
We are about to upgrade to Adobe Reader 10.0.1. In our environment we have one platform with WinXP SP3 and Adobe Acrobat Standard 8.2.5 and Adobe Acrobat Pro 8.2.5. The other platform is a Win 7 and Adobe Acrobat Standard 9.4.1 and Adobe Acrobat Pro
-
I want to buy iphone accessories for my iphone5
I want to buy iphone accessories for my iphone5, so that my iphone 5 can be more functional and more perfect.Anyone have any idea?
-
Rouge alerts on iPhone for events created on Mountain Lion
When I add calendar events in iCal the event shows no alerts, but when syncing the calendar with the iPhone there is an alert for 15 hours before. I can delete this alert off on the iPhone but it is a pain to have the computer show no alerts and then