Consume SOAP WebService Workaround

March 30, 2018 | Author: RupakBhattacharjee | Category: Proxy Server, Web Service, Data Type, Internet Forum, String (Computer Science)


Comments



Description

Consume SOAP WebService by SAP and add custom Header  Added by Roland Jungnickel, last edited by Roland Jungnickel on Sep 13, 2011 Goal We like to consume an external webservice by SAP. In other words: we should call the webservice using some given values and get the result back. We need a username+password for the webservice. Preparations     get the WSDL file from the webservice provider get a set of values for calling the webservice from the webservice provider download and install soapUI ( http://www.soapui.org/ ), we need this for testing! If you like to access a webservice outside of your company, configure the proxy in soapUI. get auth.+dev.key in SAP for SE80, LPCONFIG, SMICM Pre-Dev Testing We should make sure the webservice works as espected before we go into ABAP. Using soapUI, 1. 2. 3. 4. 5. File > New soapUI Project give a project name (free to choose) and provide the WSDL file. Create everything soapUI provides (except the webTest-Case) in "generate testsuite", select "one testcase for each operation" and select all soapActions we require in "generate mock service" select also "starts the mock service immediately" once created, in the project tree, look for the soapAction you like to test, below "Test Steps" doubbleclick on the soapAction. You should now get a new window containing two sides: the request and the response window. In the request window, fill in all "?" with the set of values you got from the webservice provider. Click run (at the top left) and look at the result in the right window. If it works, start in SAP... Generate Enterprise Service Proxy        in SE80, select you Package on the Package name, right-click and select Create > Enterprise Service Select "Service Consumer", Continue Select URL (or local file, but URL is best!), Continue copy the URL into the URL field, continue select Package, Prefix (ZWM, ZMM, ZSD... ?) and create a new Request/Task. Click Continue. again, continue... Now, the Proxy should generate. If there is no error, you should see the generated proxy class. Save it and activate. Copy the generated class name. error handling in proxy generation If you recieve an error like ""Incorrect value: Unknown Type...": 1. 2. 3. Execute TA SPROXSET. Create a new parameter NO_RPC_STYLE with your username and set the value to 'X' Try the proxy generation as mentioned above again. The switch NO_RPC_STYLE might be used only if the WSDL is NOT RPC-style! Background info: The error message you get is raised by the so called SIDL library. The sidl library is called to check wether the WSDL is document-style or rfc-style. In case of rfc-style the SIDL library is also used to handle rfc-style. Your WSDL might be document-style and can be processed without help of the SIDL library. As workaround to avoid this error message we can disable usage of the SIDL library. To achive this we have to cal TA SPROXSET and set the value X for for name NO_RPC_STYLE. Create Local Port In LPCONFIG,          give the Proxy Class Name we copied Enter a reasonable Logical Port name tick "Default Port" (otherwise you need to give the port name each time you instantiate the proxy class) click "New" provide a description on tab "Call Parameters" tick and provide the Call URL. This is *NOT* the WSDL file! Most times, thats the URL just without the "?WSDL" suffix. But take a look at the WSDL file itself, usually there is an entry "address location="[http://|stage:../../../../../../../../../../]..", use this URL. on tab "Operations", for each operations listed, we need to find out the soapAction URL and enter it there. This information you can find in the WSDL file. Sometimes it's called "soapAction URL="[http://| stage:../../../../../../../../../../]..". but in other cases there is just the reference to the main address in the "soapAction" mentioned. In this case, use this address (NOT the WSDL file itself!). save and activate if requested, tick "State Management" in "Application-Specific Settings". Test generate class and port Back in SE80,       navigate to your generated enterprise service. (Select your package > Enterprise Service > Client Proxies) test the class if you ticket "default port" in LPCONFIG, you do not need to provide the logical port name, tick "Generate Template data" and "Extended XML Handling" now you should see some generated XML, on the top, click edit. enter your test values run it If you are lucky, you see the result... But if you are not able to enter all required data for the test (e.g. username+password, a session-id etc.), you should get an empty result or an exception. In this case, it gets a bit complicated as SAP is not able to handle header entries by itself. Read further down for the solution. Test program While proxy generation, not only the proxy is created - also the relevant datatypes. So you need to find out which ones are used. In this example, I assume we have an importing structure (workarea) and one exporting (internal) table. Also, there is at least one exception class generated. Please update this code example if you find easier ways, also the exception handling is not yet really useful. DATA: lr_proxy TYPE REF TO z<your_client_proxy_class>, lr_ex_service TYPE REF TO z<your_exception_class>, lr_ex_system type ref to cx_ai_system_fault, lr_ex_application type ref to cx_ai_application_fault, DATA: ls_req TYPE z<your_request_structure> lt_ret TYPE z<your_return_table>, ls_ret TYPE z<your_return_table_linetype>. DATA: lv_ex1 TYPE string, lv_ex2 TYPE string, lv_ex3 TYPE string. ls_req-var1 = 'foo'. ls_req-var2 = 'bar'. TRY. CREATE OBJECT lr_proxy   EXPORTING logical_port_name = '<your_lpconfig_port if not default' . CATCH cx_ai_system_fault into lr_ex_system. ENDTRY.  make use of the abap pattern, it makes the life easy... TRY. lr_proxy-><your_ws_soapAction( EXPORTING <request> = ls_req IMPORTING <return> = lt_ret ). CATCH cx_ai_system_fault into lr_ex_system. CATCH z<your_exception_class> INTO lr_ex_service. CATCH cx_ai_application_fault into lr_ex_application. ENDTRY.  o o o o o o o exceptions for debugging... o if lr_ex_system is not INITIAL. lv_ex1 = lr_ex_system->if_message~get_text( ). lv_ex2 = lr_ex_system->if_message~get_longtext( ). *lv_ex3 = lr_ex->if_ai_application_fault~get_rt_fault_text( ). endif. if lr_ex_service is not INITIAL. an api-key etc. copy it into a new file. Use column mode to select the text. Unlike in other programming frameworks where such values are added to the generated class constructors. a session-id. structure etc. endif. xml_document TYPE REF TO if_ixml_document. Goto > Trace File > Reset. Example code: DATA: ixml TYPE REF TO if_ixml. lv_ex3 = lr_ex_application->if_ai_application_fault~get_rt_fault_text( ). if the request fails. unfortunately.. But there is a tricky way to add a custom header.ht m Using the IF_WSPROTOCOL* we have also access to the WS_HEADER. All this we need to do before we call the soapAction.g. endif. That way. The class documentation from SAP: http://help. Enter value '3'. but requires you to provide the xml-name.) you should get the result in your lt_res table. run your test programm Goto > Trace File > Show all. The POST / GET is shown in HEX and a in a small text area.lv_ex1 = lr_ex_service->if_message~get_text( ).com/saphelp_nw70ehp1/helpdata/en/47/3d95b07e1a20cae10000000a155369/frameset.sap.      Goto > Trace Level > Set. If you are lucky . xml_element TYPE REF TO if_ixml_element. To create this value out of a given xml-header. This one does not take just a string. we need to use method set_request_header of the interface-classif_wsprotocol_ws_header. xml-namespace and the xml-element as a dom element. BREAK-POINT. You can export the whole trace file and open it in a professional text editor (such like ultraedit or similar). you could also copy the generated POST xml into soapUI and play around with the values. xml_root TYPE REF TO if_ixml_element. SAP does not support them. (remove the whole HTML header out of the trace before) Add custom header Sometimes you need to add a header to the SOAP message. do not forget to set the trace level back to 1. See whats sent/recieved You can see what is sent/recieved using SMICM. lv_ex3 = lr_ex_service->if_ai_application_fault~get_rt_fault_text( ). xml_node TYPE REF TO if_ixml_node. a username and password. if lr_ex_application is not INITIAL. lv_ex2 = lr_ex_application->if_message~get_longtext( ). lv_ex1 = lr_ex_application->if_message~get_text( ). . Then you could read the get/response easier. we have to use FM SDIXML_XML_TO_DOM. remove all line-breaks and replace "><" with ">_<" (_ represents line-break). But we can not easily add a header. e. ok.. lv_ex2 = lr_ex_service->if_message~get_longtext( ). is the FM is successful. notice.provider.com">YOURpassword</n1:password>' '<n1:username xmlns:n1="http://webservices.com/">' '<n1:password xmlns:n1="http://webservices. xml_root = xml_document->get_root_element( ). ENDIF. that just a missing slash (/) in the XML can ruin your result. DATA: name TYPE string..com">YOURusername</n1:username>' '</n0:UserToken>' '</soapenv:Header>' INTO l_string. lr_header_protocol->set_request_header( name = name namespace = namespace dom = xml_element ).provider. IF sy-subrc = 0 AND xml_document IS NOT INITIAL. name = xml_element->get_name( ). ENDWHILE. The main reason for errors from this FM is a malformed XML header you provided. xml_element ?= xml_element->get_next( ).       convert to xstring l_xstring = cl_proxy_service=>cstring2xstring( l_string ).. look at the exceptions thrown while sending the soap request (we catch them at the end of the test programm) the returned exception texts usually do not tell you much. xml_element ?= xml_root->get_first_child( ). play around until it works. CONCATENATE '<soapenv:Header>' '<n0:UserToken xmlns:n0="http://services. reformat XML until it works.provider. ENDIF. 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. add header element by element to soap header WHILE xml_element IS NOT INITIAL. Test your header in soapUI before copy into the concatenate. The common problems here are: SDIXML_XML_TO_DOM needs to be successful. Use SMICM to look at the response. This is maybe hard and time-consuming. If it still fails. . namespace = xml_element->get_namespace_uri( ). IF l_string IS NOT INITIAL. otherwise the header is not added.DATA l_xstring TYPE xstring. DATA l_string TYPE string. namespace TYPE string. Get some good coffee and music. Below are the steps required for consuming a webservice WSDL with ABAP and SE80.Access ABAP proxy creation wizard via SE80 Execute transaction SE80 and within the the 'edit object' popup screen select Client proxy from the 'Enterprise Services' tab and press create. but the concept can be applied to any webservice you find. give the reference on each data element. Instead. watch out for slahes. because in soapUI it does. Step 2 .) the namespace names (xmlns:) might be different.>. . if you send the header successfully.) it looks not sufficient if you provide the reference information (xmlns:.. but the webservice does not accept your username+password (but should... spaces and so on. Step 1 . It is using a webservice called Currency converter available on thexmethods.com website.Create ABAP proxy You should now be presented with the first screen of the ABAP proxy generation wizard where you need to enter URL/HTTP Destination and press continue.. Make sure lower/uppercase is correct.. other tricks:   make sure your reference names do not contain special chars. as long as you have the url of its WSDL. n1. preferably use short reference names (n0...) in the <soapenv:Header xmlns. When the auto generation occurs SAP only has a finite number of of characters for the name of the proxy. enter the url of your webservice WSDL and press continue.Next you need to select URL. this prefix helps ensure it does not encounter any duplication problems when it trims dowm names to fit in the field available. Now press Continue and on the next screen press Complete. .asmx?WSDL Now enter the package details or just click the local object checkbox and enter a prefix of 'ZES_'. For this example the WSDL will be http://webservice.webserviceshare.com/currencyconverter/rates. Save and activate it! Step 3 . Then with the Logical Port enter an appropriate name such as CURR_CONV_XMETHODS. . Tick the Default Port checkbox and press create.Your ABAP proxy should now generate and you should be presented with the following screen.Create a logical port Execute transaction LPCONFIG and within Proxy class enter the proxy you just created ZES_CO_CURRENCY_CONVERTER_SOAP in SE80. .webserviceshare.com/currencyconverter/rates.asmx?WSDL).Setup Call parameters Within the 'Call Parameters' tab select URL and enter the url of the WSDL again (http://webservice.Step 4 . Basiaclly within the WSDL there is a section which details each operation and specifies a soapAction url. I am just going to set up the 'GET_SUPPORTED_CURRENCIES' operation but feel setup the others at any point. This was found in the following section of the WSDL: <wsdl:operation name="GetSupportedCurrencies"> .Step 5 .com/GetSupportedCurrencies".Setup Operations Right this is where it gets a little messy as now we need to add the reference from the actual WSDL code into each operation. To do this select the GET_SUPPORTED_CURRENCIES operation and enter the SOAP Action as "http://websevriceshare. We simply need to find this soapAction url and enter it into the operations tab for the appropriate operation. Now press execute! .Test your webservice ABAP proxy Make sure you save and activate the logical port and return to your ABAP proxy with SE80.com/GetSupportedCurrencies" style="document"/> Step 6 . Hit the test button and enter CURR_CONV_XMETHODS as your logical port name and GET_SUPPORTED_CURRENCIES as the method name (action).<soap:operation soapAction="http://websevriceshare. Step 8 .Enter input details The webservice results should now be displayed.Enter input details As this method/action of the webservice does not require an input values simply press the execute button again.Step 7 . . a list of all the currency codes supported by the webservice. Report Reply . the URL should NOT end with "?WSDL". Otherwise you might get the error "Unexpected element -el=definitions ns =http://schemas.. I am struck up with support issue.Click here to Add transition layers to your VC application so that each form is on a separate page.. as this does not run the webservice it returns the WSDL which starts with definitions.org/" (or similar. Thank you! Report Reply 0 Roland· 21 weeks ago In step 4.xmlsoap.Operations tab do we need to provide SOAP Actions? (with out providing also will it work?) Please respond ASAP.) Report Reply 0 Chandra· 52 weeks ago I have a question. 1) Do we need to pass WSDL or URL in LPCONFIG (Do we can pass URL also?) 2) LPCONFIG . it is going live next weekend. and successfully implemented a call to a web service.. Buzz ItShare Login Follow the discussion Comments (4) Sort by: Date Rating Last Activity 0 Iwan· 6 days ago That is fantastic! I've followed all your steps. 2. in TYPE z_ser_tst_per. 3. lt_return TYPE bapirettab. I use this code to call to the service : DATA: lv_port_name TYPE srt_lp_name. Create WS on the Target system (in the Server). I Create WS in BE1 (Server ) and i want to call it explicitly via Code from other backend BE2 (Client) . .0 schunder chitrapu· 86 weeks ago Very useful Report Reply Reply Call to WS from abap program Posted: May 5. lv_text TYPE string. I followed this procedure 1. Create logical port Via Lpconfig (in client). out TYPE z_ser_tst_per_r. Generate proxy on the client (in the client). 2009 9:13 PM Hi. DATA: lref_client_proxy TYPE REF TO z_ser_test_perf. * Get Default Logical Port for Proxy CONSTANTS: lc_proxy TYPE srt_lp_proxyclass VALUE 'ZHCO_SER_T_PER'. . ENDTRY. in-work_id = '00570538637'. CREATE OBJECT lref_client_proxy EXPORTING logical_port_name = lv_port_name. CATCH cx_ai_system_fault. CALL METHOD cl_srt_lp_maintenance=>get_default_port_by_proxy EXPORTING proxyclass = lc_proxy RECEIVING lp_name = lv_port_name. in-user = 'AST'. TRY. i get exception : SOAP:14 Unexpected element -el=definitions ns=http://schemas. me again .S. CALL METHOD lref_client_proxy>z_tst_performance EXPORTING input = in IMPORTING output = out. CATCH cx_ai_application_fault. ENDTRY. In the method lref_client_proxy. Best Regards Nina Edited by: Nina C on May 5.TRY.xmlsoap.org/wsdl/ Does anyone have an idea how to avoid this exception? P. I also create logical port via Soamanager but the first and the second method don't find it (i saw the entry in table SRT_CFG_CLI_ASGN ) and when i call to the third method alone i get dump for null reference. i want u to ask wether u r trying the webservice for just . catch CX_AI_SYSTEM_FAULT into lr_error. 2009 6:40 AM in response to: Nina C hi nina. 2009 10:33 PM mohammad afzal Posts: 750 Registered: 3/16/07 Forum Points: 982 Re: Call to WS from abap program Reply Posted: May 6. lv_message = lr_error->get_text( ). org/wsdl/ . as u said in ur queries the problem ur facing it is coincidence i too faced them . the program u have used to call is also correct and no need to give the logical port name as it will be picked from runtime. i too did the same and it was successful when i tried to call from the same server if u have java stack u can test ur webservice throuhg webservice client if any queries u can aks afzal Nina C Posts: 212 Registered: 3/22/09 Forum Points: 0 Re: Call to WS from abap program Reply Posted: May 6. if u want to check the webservice funtionality u can do from the same server also i mean create client proxy in the server in which u have created the server and try to call it i hope it will run successfully . i too tried the same callign webservice from another r/3 and faced all these problems u r creating the logical port from soamanager and the method the other guy mentioned is correct and when u try to run it u get an excepetion SOAP:14 Unexpected element -el=definitions ns=http://schemas. ur web service is working fien the proof is that it is prompting for user id and password of server . So you think that i need to connect to the basis guy ? if so what i need tell him exactly i'm not familiar with this part. this is due to the problem from the client server some soap runime configuration problem which u have to take help from basis as we should have admin rights.testing purpose or u need really for any of u work. Thanks Again :) This for work not for test. 2009 7:04 AM in response to: mohammad afzal Hi Mohammad.when i create it via soamanager i can't use the first and the second method because they query other tables SRT_LT and not .xmlsoap. The problem happen when i create LP VIA LPCONFIG and use the code i post . but do u want to use the web service from r/3 to r/3 or to call from external system to r/3. if u want to call from external system like java and . it will ask for user login and then u get the webservice tesstign client and u have a test option if u click it it will ask for the parameters and if u enter and execute it will return the result .net u can use the webservice .SRT_CFG_CLI_ASGN so i don't try to to call it via code (when i try to call just the third method i get dump null reference ) because i don't find method that can do so. u can try this sap notes 1043195 this is for chekcing the SOAP runtime environment Reply . 2009 8:42 AM in response to: Nina C hi nina. 2009 8:40 AM mohammad afzal Posts: 750 Registered: 3/16/07 Forum Points: 982 Re: Call to WS from abap program Posted: May 6. if u want to call r/3 to r/3 then u can use rfc instead of rfc. There is other way to call it? Best Regards Nina mohammad afzal Posts: 750 Registered: 3/16/07 Forum Points: 982 Re: Call to WS from abap program Reply Posted: May 6. as u said u want to use this webservice thats fine . 2009 8:04 AM in response to: Nina C hi nina. if it is fien then ur webservice is workign fine and cna be used the problem with r/3 is some soap runtime problem which we have to search for some note regards afzal Edited by: mohammad afzal on May 6. if u have java stack u can test the webservice wether workign or not for this the procedure is in ur server where u created the webservice go to transaction WSADMIN under node SOAP Application for RFC complaints FMs search for ur webservice and test it . 2009 12:11 PM Nina C Posts: 212 Registered: 3/22/09 Forum Points: 0 Re: Call to WS from abap program Reply Posted: May 6. build the program like i wrote in the previous post . i take the URL from the WSDL tab and create a proxy class in the back-end ( client ) via SE80 -> proxy class -> service consumer I put the WSDL .URL in the URL package and finish. and if the endpoint is not active how i can active it? Thanks !!!! You are great ! Best Regards Nina .I create the WS via SE37 at the and I get some tabs one of them is WSDL .Go to transaction LPCONFIG and put the proxy class name that i build and some perfix name like test in the logical port and assign the defult port .please try with ur basis guy and if solved please reply so that it wil be helpful afzal Edited by: mohammad afzal on May 6.1 there in the in run time tab choose the web service infrastructure after Goto call parameter tab and put the same URL that i put in the proxy class and activate (in the tab operation i don't see the operation just the service name). Thanks a lot for your time!!! I think that maybe the problem is with the LP or the proxy classsince i create it for the first time. 3. 3.i try to create it via soamanager and but i don't see the URL of it . 1. if i have to put the endpoint . One concerns is if i have to enter the WSDL there or the endpoint. I bring more detail for what i was doing to create the proxy and the logical port. 4. 2. 2009 11:00 PM in response to: mohammad afzal Hi Mohammad. Check note 944029. 7.Nina C Posts: 212 Registered: 3/22/09 Forum Points: 0 Re: Call to WS from abap program Reply Posted: May 6.0 Best Regards Nina mohammad afzal Posts: 750 Registered: 3/16/07 Forum Points: 982 Re: Call to WS from abap program Reply Posted: May 7. Gabriel P.40. 2009 11:47 PM in response to: Nina C Hello Nina. Thanks. the procedure u have done is correct may be some mis matching i will tell u the steps to follow 1) create a RFC and from it create a webservice and activate it . Depending of you abap version (6. I Use 7.20. 2009 11:50 PM in response to: Gabriel Pulido V HI Gabriel. it explains depending on your ABAP version. which wsdl tags are supported or not. Hope this helps. 2009 6:23 AM in response to: Nina C hi nina.016 Re: Call to WS from abap program Reply Posted: May 6.Gabriel Pulido V Posts: 870 Registered: 10/9/09 Forum Points: 1.0) abap itself cannot recognize some some wsdl elements. 6. in that business administration tab u have web service administration link . which method i need to use only . do not use the logical port option while instantiating the proxy class it will be automatically picked form run time. go to SOAMANAGER of ur client system . 2009 9:58 AM in response to: mohammad afzal Hi mohammad Thanks again. the problem is with the wsdl file instead u try to do alternate way 3) Go to transaction soamanager . 8) u can write the program for calling it . search for ur client proxy and select it and under this proxy try to create the logical port . i too faced the problem and after trying a lot i got the break through yesterday . try this and if any problems revert back. and give the login details of the wsdl i. click on it and to search ur services wsdl . under overview tab u get three links for wsdl one is for port type oen is for binding one is for policy the correct file is the wsdl file for binding 4) select the link and ur wsdl file opens . so it might solve ur problem too cheers afzal Nina C Posts: 212 Registered: 3/22/09 Forum Points: 0 Re: Call to WS from abap program Reply Posted: May 7. search with server proxy and when u select ur service and apply selection u get a screen below . use the same URL which u haev used in creating the proxy. IF i don't use the first two methods. copy the url this is the wsdl file u have to use in creating the client proxy not any other wsdl file 5) in client system create the client proxy and use the url of this wsdl and activate it 6) instead of creating logical port in LPCONFIG .e server and save it 7) Now u can test ur client proxy from SE80 by giving the logical port .2) Do not pick the WSDL file from the tab u mentioned . An object reference must point to an object (an instance of a class) before it can be used to access components. 2009 10:11 AM mohammad afzal Posts: 750 Registered: 3/16/07 Forum Points: 982 Re: Call to WS from abap program Reply Posted: May 7. The exception. Another thing 7) Now u can test ur client proxy from SE80 by giving the logical port . out type ZSTRZSTAR_RESPONSE. 2009 10:50 AM in response to: Nina C hi . lo_sys_exception TYPE REF TO cx_ai_system_fault. Can u explain how to do so please? Best Regards Nina Edited by: Nina C on May 7.the third ? the problem is when i use only the third method i get dump An exception occurred that is explained in detail below. The reason for the exception is: You attempted to use a 'NULL' object reference (points to 'nothing') access a component (variable: "LREF_CLIENT_PROXY"). just use create object proxy name Data : l_proxy type ref to ZSTRCO_ZSTARWEB. which is assigned to class 'CX_SY_REF_IS_INITIAL'. was not caught and therefore caused a runtime error. Either the reference was never set or it was set to 'NULL' using the CLEAR statement. nina the null poitnexception is that u r referring to the logicl port while creatign the object dotn pass anything . . in type ZSTRZSTAR. 2009 10:07 AM Edited by: Nina C on May 7. then ur method wil be shown execute it and u get ur input paramters just clikc them. i created it but never used just instantiate the object and pass the input an dout put paramters . i never used logical port . give the logical port name and click the instance button. u will get a screen where the input values will be autmatically proposed and then u execute from there u wil get the output. TRY. in-b = 4. .it_controller type PRXCTRLTAB. write : out-c. create object l_proxy. then test this class by using execute button u get a screen where u haev to instantiate the class . CALL METHOD l_proxy->zstar EXPORTING input = in IMPORTING output = out . u can select the package in which u created the pproxy . wa_controller type prxctrl. CATCH cx_ai_system_fault into lo_sys_exception . ENDTRY. the logical port will be picked form run time and u can test the proxy from se80 1) just double click on th eproxy name in SE80 . give the values and come back and execute u will get the output hope it solves ur prob regards afzal Nina C Re: Call to Reply . 2) seond method is when in SE80 when u select the proxy u can see the prxy name in the prpoerties which will be Proxy Class (generated) . then under enterprise services --> client proxy and ur proxy name just test from there u get a pop up of test service consumer and select the logical port from drop down and seelct the generate template data and execute it . in-a = 8. Posts: 212 Registered: 3/22/09 Forum Points: 0 WS from abap program Posted: May 7.007 SRT: Unsupported xstream found: ("HTTP Code 401 : Unauthorized") Which user and pass i need to provide? There is a way to avoid this pop-up ? P. I also activate the service via SICF :/sap/bc/srt/wsdl/ 2. Best Regards Nina Edited by: Nina C on May 7.e server 2) u can avoid the pop up of the same for this u have to do little settings . then u r calling from sys2 so give the details of login of sys1 i.S.e if u have created web service in sys1 and client proxy in sys2 . 2009 12:02 PM in response to: mohammad afzal HI mohammad. Thanks Again You Are great !!! News!!! i get other exception :( Now i do like you tell and when i came to the method in debug mode i get pop-up for user and pass When i try to provide the user and pass for the backend that the service persist there (probably it's not it) after 2 attempts i get new exception : SOAP:1. 1. 2009 12:49 PM in response to: Nina C hi . the error is coming also when i test the proxy. 2009 12:45 PM mohammad afzal Posts: 750 Registered: 3/16/07 Forum Points: 982 Re: Call to WS from abap program Reply Posted: May 7. nina u may get authorization problem u have to give the user id and password of the server where u created teh webservice i. under it rfc . under it srt. under it sap . 2009 1:53 PM in response to: mohammad afzal Hi Muhammad . Do u have any idea what to do now? Best Regards Nina mohammad afzal Posts: 750 Registered: 3/16/07 Forum Points: 982 Re: Call to WS from abap program Posted: May 7. so when ever u call thsi servcie the login detials are autmoatically picked path for the webservice default_host -->sap-->bc-->srt-->rfc-->sap-->webservice name created regards afzal Nina C Posts: 212 Registered: 3/22/09 Forum Points: 0 Re: Call to WS from abap program Reply Posted: May 7. under it sap. i give the user and pass of the backend i create the WS and i get the same issue . Thanks!!!. udner it u fidn the webservice name u have created double click on it and u have logon data tab under it maintain the logon detilas of the system u have created the webservice . under it bc. Do u have idea why? I add to the service in transcription sicf user and pass (in the server side of the server side ) and when i test the proxy from the client i get the same pop-up asking user and pass. 2009 2:08 PM in response to: Nina C Reply .a) go to transaction SICF in that enter hierarchy type as SERVICES b) you get tree of default_host . i try to avoid the user and pass from the service provider ->configuration ->Authentication -> none. and then create the client proxy in the same system instead of secodn system . and when i test the proxy i get the same popup for user and pass. Thanks . I close this treat and open new one for the user and pass problem. r u able to call the service i mean is it working after u provide user id and password if u get the exception it is bcos of wrong user id and password . if u want to avoid the user name and password pop up then we can do it that is not a big issue one more simple suggestion form me to you to test service is just create a simple rfc which simplly returns the string no import paramters create webservice in ur first system .hi nina. Thanks again you are great!!! . follow the same steps and try to test it will ask same user and password and try to test if ur able to do it then u can try to call from secodn system dotn use two ssytems use single systme for server and client if ur able to do it then doing with two systems will not be a big deal regards afzal HI Mohammad. There is a way to avoid it? Best Regards Nina Nina C Posts: 212 Registered: 3/22/09 Forum Points: 0 Re: Call to WS from abap program Reply Posted: May 7. 2009 5:01 PM in response to: mohammad afzal HI mohammad. . I have a local WSDL file .http://www...wdtp The WSDL file read like...wdtp"/> </port> </service> i dont understand whats going wrong.. using a Local WSDL file. 2009 9:26 PM Hi Experts. When i call the method SendEmailResponse from an ABAP Report i get the error SOAP:14 Unexpected element -el=SendEmailResponse ns= i guess there is ERROR in my Logical Port Connection..Best Regards Nina Proxy Generation Error: SOAP:14 Unexpected element Reply Posted: Feb 5... <service name="SendEmailService"> <documentation xmlns="http://schemas.abysal. only setting i have done is with CALL PARAMETERS as Runtime ... since i am using a Locally Downloaded WSDL file. i create a Proxy object in ABAP..com/soap/soapmail.. WSDL is correct & webservice call works when using Java WebDynpro.. Any pointers would be help full Regards Prashant Marcelo Almeida Re: Proxy Generation Error: Reply .xmlsoap.com/soap/soapmail.Web Service Infra URL ...abysal.org/wsdl/"> Abysal Systems Web Service demonstration example </documentation> <port binding="tns:SendEmailBinding" name="SendEmailPort"> <soap:address location="http://www. Check if you are following the below steps to consume the webservice in Proxy generation. CALL METHOD my_proxy->flight_get_detail EXPORTING input = input IMPORTING output = output. Posts: 1. ENDTRY.272 Re: Proxy Generation Error: SOAP:14 Unexpected element Reply Posted: Feb 6. input-connection_id = p_connid. input-flight_date = p_fldate.084 Registered: 7/13/06 Forum Points: 1. CATCH cx_ai_application_fault. See the example below ( the source code): TRY. ENTRY.. TRY. CREATE OBJECT my_proxy EXPORTING logical_port_name = 'LP01'.Posts: 113 Registered: 1/15/08 Forum Points: 84 SOAP:14 Unexpected element Posted: Feb 6. After this you need to put the RFC in HTTP Destination. input-airline_id = p_carrid. Regards. Shiva Kumar Tir. 2009 12:09 PM in response to: Prashant Try to create a connection in SM59 Type H. CATCH cx_ai_system_fault.. 2009 12:39 PM in response to: Prashant Hi. CATCH cx_ai_system_fault. . N.abysal..This will create the Proxy class and the methods based on the WSDL.1) Create a Proxy Object in SE80 using the WSDL path. 2009 1:29 PM to: Prashant Reply in response Hi Prashant . 3) Go to LPCONFIG transaction and the create a default port for the proxy object..sdn.. Entire WSDL that i use is downloadable from http://www.com/thread. any idea why error?? Greetings Prashant . 2009 2:04 PM response to: Marcelo Almeida Reply in Hi Marcelo Almeida .Hope this solves your problem Regards Shiva Guest Re: Proxy Generation Error: SOAP:14 Unexpected element Posted: Feb 6.wsdl.Neelima. i Created a RFC destination in SM59 of type H as RFC_DEST_1 & used your coding now the error i recoeve is SOAP:14 Unexpected element -el=root ns= while creating the Logical port. i specified HTTP destination as my RFC_DEST_1 Path Prefix is empty.sap. 2) Save and Activate the Proxy.jspa?threadID=1182392&tstart=0 check with this link. https://forums. Prashant Posts: 373 Registered: 2/25/08 Forum Points: 412 Re: Proxy Generation Error: SOAP:14 Unexpected element Posted: Feb 6. Then you call the proxy in the program. regards..(You might not be having access then in debugging change the access and create a default port)....com/soap/AbysalEmail. CATCH cx_ai_system_fault . DATA: output TYPE zproxysend_email_response . 2009 5:38 PM in response to: Marcelo Almeida If the connection is OK. CALL METHOD my_proxy->send_email EXPORTING input = input IMPORTING output = output. DATA: input TYPE zproxysend_email_input . CREATE OBJECT my_proxy EXPORTING logical_port_name = 'MY_PROXY' .Marcelo Almeida Posts: 113 Registered: 1/15/08 Forum Points: 84 Re: Proxy Generation Error: SOAP:14 Unexpected element Reply Posted: Feb 6. Prashant Re: Proxy Generation Error: SOAP:14 Unexpected element Reply . TRY. TRY. ENDTRY. CATCH cx_ai_application_fault . Try to get the WSDl again and use this code below: DATA: my_proxy TYPE REF TO zproxyco_send_email_port_type . 2009 5:30 PM in response to: Prashant Did you test the connection in SM59?? Is OK?? Marcelo Almeida Posts: 113 Registered: 1/15/08 Forum Points: 84 Re: Proxy Generation Error: SOAP:14 Unexpected element Reply Posted: Feb 6. ENDTRY. CATCH cx_ai_system_fault . lv_subject type string. lv_input-from_address = 'DUMMYMAILADDRESS HERE'. lv_input-to_address = 'MAILADDRESS APPEARS HERE'. lv_input-from = 'MYSAPTEST'. 2009 11:44 AM to: Marcelo Almeida Posts: 373 Registered: 2/25/08 Forum Points: 412 in response Sorry it still does not work :( i still get error SOAP:14 Unexpected element -el=root ns= data: sys_exception type ref to cx_ai_system_fault. . lv_to type string. lv_from_address type string. data: lv_from type string. lv_response type zsend_email_response. lv_input-subject = ' TEST'. lv_input-to = 'Prashant'. lv_to_address type string. client_proxy type ref to zco_myesa.Posted: Feb 9. sys_exception2 type ref to cx_ai_application_fault. lv_input type zsend_email_input. lv_msg type string. lv_ret_code type int4. lv_input-msg_body = ' Hi this is wonderfull to see it work'. data lv_err type string. into sys_exception . create object client_proxy exporting logical_port_name = 'BASIC'. . lv_err = sys_exception->if_message~get_text( ). call method client_proxy->send_email exporting input = lv_input importing output = lv_response catch cx_ai_system_fault . write: / lv_err. write: / lv_err. try. lv_err = sys_exception->if_message~get_text( ). catch cx_ai_application_fault into sys_exception2 . endtry. write: /'Not Executed'. write: /'Did Execute'. else. Prashant Posts: 373 Registered: 2/25/08 Forum Points: 412 Re: Proxy Generation Error: SOAP:14 Unexpected element Posted: Apr 17. endif.if lv_response is initial. 2009 1:33 PM in response to: Prashant Closed due to further posting requirement Reply .
Copyright © 2024 DOKUMEN.SITE Inc.