Consuming Web Service from ABAP Web Dynpro
I have written program to consume KM Web Service through ABAP as well as ABAP Dynpro in SAP R/3 by calling Consumer Proxy.
When I run the program from SE38, it prompts me for user-id & password. If I pass KM Server user-id and password I am able to execute the web service successfully.
However, while I execute the same code through Web Dyn-pro , it does not ask for user-id and password & terminates with CX_AI_SYSTEM_FAULT : SOAP:1,007 SRT: Unsupported xstream found: ("HTTP Code 401 : Unauthorized")
I have created a Logical Port in R/3 & I am using this Logical Port while creating an Object of Consumer Proxy.
Kindly let me know how to resolve this issue.
The 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.
Similar Messages
-
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.
-
Create an SAP Web Service Consumer (calling External Sharepoint Web Service from ABAP)
hi all,
i am trying to
Create an SAP Web Service Consumer (calling sharepoint Web Service from ABAP) using blog given on following link
Create an SAP Web Service Consumer (calling External Web Service from ABAP)
but when i am using my url at the end of step 3, i am getting error as follows:
i dont want to use local file option. Can anyone help me in this??
thanks in advance
regards,
SDSHi SDS,
you recieved a http 404 error when trying to access the Sharepoint Web service. Http 404 indicates that the resource is not reachable (cf. HTTP 404 - Wikipedia, the free encyclopedia). There could be different reasons for that. I'd suggest rubble checking the URL of the Web service first. Try to access it from a browser on you desktop. If the URL is correc. Most likely the SAP system is not able to connect to the URL. This could, for example, be due to some firewall restrictions. You should ask a SAP Basis colleague if they are able to access the URL of the Web service from the server on which the SAP system is running.
Christian -
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 -
How to use web service with ABAP Web Dynpro
Hi.
do you know, how to web service with ABAP Web Dynpro?Hi,
If you have a webservice ready with you then you can generate a proxy from SE80 and you can use that. You just have to create a port and assign to that generated proxy(CLASS) and you are good to go.
Let me know if you need more information.
Thank You,
Gajendra. -
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 web service from ABAP - version 4.6C
Hi,
I would like to know how to call a web service from ABAP. Version is 4.6C. Any help would be greatly appreciated.
Thank you,
RekhaHi Rekha,
Please go through these..
call web service using ABAP
http://help.sap.com/saphelp_nw04/helpdata/en/a0/da0710b6560a4e80fb94f3f712dfc0/frameset.htm
http://help.sap.com/saphelp_nw04/helpdata/en/e9/ae1b9a5d2cef4ea4b579f19d902871/frameset.htm
Hope these help you!
cheers,
Prashanth -
Error during creation of web service from abap rfc
Hi,
I'm creating a web service from abap rfc (SE37), but at the end of Creation Wizard I have this error:
"web service object already exist".
This is my first web service creation. Into WSADMIN there are not web services with the same name.
How can I solve this problem?
Thanks!Hi,
What system/release/SP do you use ?
Beginning with Netweaver 7.0 SP14, you configure Web services with SOAMANAGER and you don't see them with WSADMIN...
Regards,
Olivier -
Is it possible to call web service from ABAP SAP 4.6 c..If yes how
Hi Friends,
Is it possible to call web service from ABAP-SAP 4.6 c..If yes Could you please let me know how.
Thanks in Advance.
Murali Krishna K
Edited by: Murali Krishna Kakarla on Jan 26, 2008 7:09 PM
Edited by: Murali Krishna Kakarla on Jan 26, 2008 7:11 PMOlivier CHRETIEN wrote:>
> Hi Terry,
>
> So these function modules must use the SAPHTTPA RFC destination which uses the exe saphttp.exe ?
>
> How much abap code lines do you have for a web service call ?
> Do you have to code the call specifically for each different web service ?
> Are you able to use the WSDL ?
>
> Nice job if you have coded your own private SOAP runtime !
>
> But I don't think this is an easy solution for everybody...
>
> Regards,
>
> Olivier
Yes, SAPHTTPA (runs on application server) and/or SAPHTTP (runs on front-end pc), one of which, is required for HTTP communication. So far, nothing too elaborate as far as SOAP goes, but the logic is simplistic. Here's some sample code:
DEST = 'SAPHTTPA'.
TRANSLATE HOST TO LOWER CASE.
MYURL = 'wssrvTest/Service.asmx/GetByOrderItem'.
CONCATENATE HOST MYURL INTO MYURL.
REQUEST_HEADERS-DATA =
'Content-type: application/x-www-form-urlencoded'.
APPEND REQUEST_HEADERS.
CLEAR REQUEST_HEADERS.
*........Convert Order Number to External Format........................
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
EXPORTING
INPUT = ORDER
IMPORTING
OUTPUT = ORDER.
*........Convert Item Number to External Format.........................
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
EXPORTING
INPUT = ITEM
IMPORTING
OUTPUT = ITEM.
*........Convert Material Number to External Format.....................
CALL FUNCTION 'CONVERSION_EXIT_ALPHA_OUTPUT'
EXPORTING
INPUT = MATERIAL
IMPORTING
OUTPUT = MATERIAL.
CONCATENATE 'sOrder=' ORDER
INTO REQUEST_BODY-DATA.
APPEND REQUEST_BODY.
CLEAR REQUEST_BODY.
CONCATENATE '&sItem=' ITEM
INTO REQUEST_BODY-DATA.
APPEND REQUEST_BODY.
CLEAR REQUEST_BODY.
CONCATENATE '&sMaterial=' MATERIAL
INTO REQUEST_BODY-DATA.
APPEND REQUEST_BODY.
CLEAR REQUEST_BODY.
CALL FUNCTION 'HTTP_POST'
EXPORTING
ABSOLUTE_URI = MYURL
RFC_DESTINATION = DEST
BLANKSTOCRLF = 'X'
TABLES
RESPONSE_ENTITY_BODY = RESPONSE_BODY
REQUEST_ENTITY_BODY = REQUEST_BODY
RESPONSE_HEADERS = RESPONSE_HEADERS
REQUEST_HEADERS = REQUEST_HEADERS
EXCEPTIONS
CONNECT_FAILED = 1
TIMEOUT = 2
INTERNAL_ERROR = 3
TCPIP_ERROR = 4
DATA_ERROR = 5
SYSTEM_FAILURE = 6
COMMUNICATION_FAILURE = 7
OTHERS = 8.
CHECK SY-SUBRC = 0. "more appropriate msg goes here
LOOP AT RESPONSE_BODY.
IF RESPONSE_BODY+0(7) <> '<string' AND
RESPONSE_BODY+0(8) <> '</string' AND
RESPONSE_BODY+0(5) <> '<?xml'.
SPLIT RESPONSE_BODY-DATA AT '=' INTO FIELD_NAME FIELD_VALUE.
TRANSLATE FIELD_NAME TO UPPER CASE.
CASE FIELD_NAME.
WHEN 'HEIGHT'.
HEIGHT = FIELD_VALUE.
WHEN 'WIDTH'.
WIDTH = FIELD_VALUE.
WHEN 'LENGTH'.
LENGTH = FIELD_VALUE.
WHEN 'WEIGHT'.
WEIGHT = FIELD_VALUE.
WHEN 'QTY'.
QTY = FIELD_VALUE.
ENDCASE.
ENDIF.
ENDLOOP.
Hope this helps...
Terry
Edited by: Terry West on Feb 4, 2008 3:08 PM -
Call webdynpro java Web Service from ABAP
Hello,
This is regarding calling portal web service from ABAP.
1. created web service in NWDS and deployed it to portal server
2. created abap proxy to call this web service from abap SE80 transaction
3. created logical portal for the above proxy LPCONFIG transaction
this is working perfectly. the web service is getting called from abap and funcitonality is working
but my doubt is we have no where given the login password for portal server in the abap system
then how come it works without login password
if i run this web service directly from portal in wsnavigator, then portal login is required.
If we want to incorporate authentication then how to do that ?
thankyou,
BWhen you are testing the application in SE80.
Is it ot asking for the user id password.
I created a similar service and for me its asking for user id and password.
Go to SM59 and there look for a RFC destination of type HTTP Connection to External Serv. usually will be named as
SAP_PROXY_ESR.
for this connection check the logon and security tab.
may be some user id and password is given there. means hardcoded.
thanks
sarbjeet singh -
Consume a Web Service from a Web Page
I had tried out the Tutorial "Consume a Web Service from a Web Page". I have encountered this error :
; nested exception is: java.lang.NullPointerException.
oracle.adf.model.adapter.AdapterException: DCA-40010: The Web Service call failed. The service returned a SOAP fault with the message: [S:Receiver] EJB Exception: : java.lang.NullPointerException
at oracle.model.freightjb.CalculateFreightBean.calculateFreightCost(CalculateFreightBean.java:23)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.bea.core.repackaged.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310)
at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at com.bea.core.repackaged.springframework.jee.spi.MethodInvocationVisitorImpl.visit(MethodInvocationVisitorImpl.java:37)
at weblogic.ejb.container.injection.EnvironmentInterceptorCallbackImpl.callback(EnvironmentInterceptorCallbackImpl.java:55)
at com.bea.core.repackaged.springframework.jee.spi.EnvironmentInterceptor.invoke(EnvironmentInterceptor.java:50)
at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at com.bea.core.repackaged.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at com.bea.core.repackaged.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
at $Proxy170.calculateFreightCost(Unknown Source)
at oracle.model.freightjb.CalculateFreight_5vfuh6_WSOImpl.__WL_calculateFreightCost_WS(CalculateFreight_5vfuh6_WSOImpl.java:72)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
I tried to modify abit the code as i changed the web method parameter from object (BatchOrder order) to variables(eg. int) and it works. When I test the Web Services I need to select the include checkbox den it works nicely else i will also encounter this problem. Does this mean the web services can not take it object as parameter?Hi Paolo,
maybe I faced the same issue. I solved it reading the thread:
web service deployable client
Hope this help
Cheers
Roberto -
Invoking one web service from another web service
Hi there,
I want to invoke a web service lets say X. But befor sending parameters to this web service, what i want to do is first pass the parameters to a web service called Y and Y will decide wether to call X or not. In other words i want to invoke a web service from another web service.
Its kind of urget so do the needful asap.
ThanksCalling another webservice from within a webservice does not require anything special. The service (say svc1) that calls another service (svc2) will be a web svc client. So you will have to do the same steps for svc1 as you would do for any other web service client
-
Consuming Web Service from ABAP
I'm using WAS 6.4 SP10.
I'm trying to consume a web service from our Intranet using instructions from ABAP256 from Teched 04.
I get an error when I try to create a Proxy object.
From SE80
Enterprise Services>Create>Proxy Object
URL/HTTP Destination:
http://server/ServiceGATP/ServiceGATP.asmx?wsdl
HTTP error (return code 400, message
"ICM_HTTP_CONNECTION_FAILED")
I've tried with ABAP web services and that works great. But no success with non ABAP Web Services.
From internet explorer the URL above seems fine. I can call it from a .NET application and it works great.
Any suggestions?
Could it be a system setup issue.
Regards,
LavaughnHi Lavaughn,
Try maintaining HTTP proxy setting using transaction SM59->RFC->HTTP Proxy Configuration. I suspect your WAS server also need to use proxy server for accessing internet.
Regards,
Sanjeev -
Consume External Web Service from ABAP
Hello All,
I have a Web Service existing on a Non R/3 system.
I want to access this Web Service from my Development system (SAP 6.40).
I created a Client Proxy pointing to this WSDL named "ZUSER_ARS_EXCHANGECO_UPDATE".
I have created an FM to call this Web Service and update the data to it with the following code ->
DATA: lv_proxy TYPE REF TO zuser_ars_exchangeco_update,
ws_header TYPE REF TO if_wsprotocol_ws_header,
sys_fault TYPE REF TO cx_ai_system_fault,
appl_fault TYPE REF TO cx_ai_application_fault,
lv_request TYPE zuser_ars_exchangecreate_soap1,
lv_response TYPE zuser_ars_exchangecreate_soap.
TRY.
CREATE OBJECT lv_proxy
EXPORTING
logical_port_name = 'TO_ARS'
CATCH cx_ai_system_fault .
ENDTRY.
MOVE-CORRESPONDING ip_userdata TO lv_request-parameters.
TRY.
CALL METHOD lv_proxy->create
EXPORTING
input = lv_request
IMPORTING
output = lv_response.
CATCH cx_ai_system_fault INTO sys_fault.
IF sys_fault IS NOT INITIAL.
RAISE proxy_create_system_fault.
ENDIF.
CATCH cx_ai_application_fault INTO appl_fault.
IF appl_fault IS NOT INITIAL.
RAISE proxy_create_appl_fault.
ENDIF.
ENDTRY.
But when I am trying to execute, I am getting the error "cx_ai_system_fault " with the following Error Text -> "ARERR [149] Im Steuerungsdatensatz muss ein Benutzername angegeben werden." When translated to English, using Google, it is "ARERR [149] The control record must be a user name."
The WSDL has a line as follows -> soap:header message="s0:ARAuthenticate"
How do I pass the username and password to this "ARAuthenticate" parameter?
Can someone please help me in getting this fixed?
Thanks and Regards
Gladson JacobI created an HTTP RFC Destination to the WSDL URL and provided the username and password in the RFC Connection. And called the RFC Destination in the Proxy, instead of calling the URL directly in the proxy. But after that, I am getting some new errors, for which I have not received a solution yet. So, still stuck!!!
For steps on creating a Proxy, I need to know the ABAP version your are using. -
Problem with consuming web service from abap
Hello,
I want to consume this web service VatatWebService Web Service From SAP.
The transaction code soamanager doesn't exist in our system, i'm the only man who use SAP in our company(we don't have BC peoples....).
I find some advice to use "wsadmin" and "lpconfig", but i do not know the step: wish data i have to fill in in tcode "wsadmin" or "lpconfig".
I'm very new in this case...
Is there any doc showing the step to consume a web service?
Thank u very match.
OuailHi,
Have you tried to search using that magical tool called Google? If I search for "SAP LPConfig" I get lots of promising looking answers:
You could also try searching help.sap.com
I appreciate you are new but one of the best skills you can learn in the world of SAP is how to search out and find information, so you aren't dependant upon SCN and/or others to help you when you get stuck.
Cheers,
G.
Maybe you are looking for
-
Our Verizon account has 10 lines and I figure we're paying over $7,000 a year, when I think of how much money total we have payed to Verizon only to be jerked around and around and lied too over and over again really does make me sick. 6 of these co
-
GeForce2 with Solaris question
Hello. I asked if Solaris 8 works with an Geforce2 video adapter. Someone gave me this answer (and I am very grateful for it): "You might want to use the XFree86 X Server, with the nv driver. Binaries and source are available from: http://soldc.sun.c
-
I've just installed Mountain Lion and the new version of OS X server on my Mac mini Server. I had not yet configured the server settings and I'm not particularly server savy but had been planning on using it for offsite access in my small business. T
-
Adding navigator panel to 2nd monitor
I love the 2nd monitor feature in LR2, but it might be cool to allow the navigator to display on the 2nd monitor and disable on the main one. I'll get over it, but it seems to be a bit limited on what can go on the 2nd screen. ..as well as having to
-
Secret 8 and 9 vs. secret 4
Hi all not a long time ago, Cisco introduced the secret 4 (for enable secret and username), now this secret 4 no longer seems to be an option (within the 3650 switch with the IOS-XE 03.03.01SE. There are the hashes 8 (PBKDF2) and 9 (SCRYPT) instead.