cancel
Showing results for 
Search instead for 
Did you mean: 

ABAP Coding in Consumer Proxy

Former Member
0 Kudos

I Created a Client Proxy using WSDL file and all the methods are generated into sap, Now I have created report with the Proxy and using the Proxy-method search_vendor to retrieve the vendor details so Iu2019m sending vendor no as input to this method I tried to write the code in Proxy method to retrieve the details Here Iu2019m facing the issue that unable to edit the Proxy-Method. How to handle this operation?

Example Report fromat

Proxy_Class->search_vendor(

EXPORTING

input = input

IMPORTING

output = output

Please Provide your valuable inputs to me.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

>

> I Created a Client Proxy using WSDL file and all the methods are generated into sap, Now I have created report with the Proxy and using the Proxy-method search_vendor to retrieve the vendor details so Iu2019m sending vendor no as input to this method I tried to write the code in Proxy method to retrieve the details Here Iu2019m facing the issue that unable to edit the Proxy-Method. How to handle this operation?

>

> Example Report fromat

>

> Proxy_Class->search_vendor(

> EXPORTING

> input = input

> IMPORTING

> output = output

>

> Please Provide your valuable inputs to me.

My valuable input is to simply use the output variable to retrieve the details or what did you think what's it good for? Thats why this consumer proxy is called PROXY, it is a (program local) proxy object representing the (remote) service. you give it the input , which itself xml-ifies and sends to the service and it returns you the de-xml-ified output which it received from the service.

anton

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

You will not be able to edit "Client Proxies" you can only edit methods in "Server Proxies".

When you are calling "Search Vendor" method it is calling endpoint (actual service) of this particular client proxy and giving back you result.

If you want to edit methods then goto Server proxy.

For supplying vendor number see the correct structure of method in SE80/SPROXY (Input/Output are outermost variables and actual variables are nested inside it).

Hope this helps, see some tutorial availables in SDN for consuming services in ABAP.

Regards,

Gourav

Former Member
0 Kudos

>

> If you want to edit methods then goto Server proxy.

excellent hint! nodding my head

may I add that, if you really want to edit any methods, write yourself some Z-class first and edit methods as you like.

Former Member
0 Kudos

I appreciate your reply dude,

Actually I'm getting a WSDL file from web method team using that i have created Consumer Proxy in system and then Written the report using this PROXY, Now when i try to execute it generate the connection and similarly when i execute the consumer proxy it generate the request with dummy values, Now what i need to know is while executing the proxy to the request structure how we will pass the value and get the response.

Here Input as a request structure, the Service Search_Vendor doesnu2019t have a code to retrieve the response structure Output because directly this service is created while WSDL is consumed

Example Report fromat

Proxy_Class->search_vendor(

EXPORTING

input = input

IMPORTING

output = output

Clear me, if we consume the WSDL in our sap system the method automatically getting generated then do we need to write a code to send value to response, as this point of time what do I need to do, bcoz client proxy is not editable.

When PROXY executed Iu2019m getting like as below

<Message> STR 123 </Message>

<BusinessPartnerID> STR 456 </BusinessPartnerID>

.......

Now I need to pass the value to this structure how it's possible, expect your valuable inputs

Thanks

Muralitharan

Former Member
0 Kudos

Hi Murali,

Set the vendor no in the "input" structure.

The result will be in the "output" structure. Read the output structure to get the details you are looking for.

Does this help ?

Regards

BHarathwaj

Former Member
0 Kudos

Hello BHarath,

Thanks for your reply

My scenario is like getting a WSDL from Webmethod and consuming it directly into SAP, I need to know once i have consumed the WSDL into sap i'm getting the Operation Method "Search Method" but they have designed in webmethod given to us.

After consiuming this WSDL i not able to see the any logic to retive the details from SAP, because WSDL is generate in webmethod and incorporate in SAP, Now As per the Output structure i need retrive the values from SAP so Where do we write the coding part? when we pass the Input method where it will be triggered?

Please Help me and explain me about this process.

Former Member
0 Kudos

Hello Murali,

As I understand you have WSDL from webMethods and you want to consume webMethods exposed webservice in SAP.

Then here are the steps

First You have to go the SE80 T-code and create a client proxy.

Then you have to create a logical port for that client proxy. While creating the logical port you have to give the URL specified in the WSDL document. It would look like this http://XXXXX.com/Service.asmx. You can use LPCONFIG or SOAMANGER for creating the port. for older version SOAMANGER is not available I guess.

Once you have done that you can execute the client proxy directly giving the logical port in the test service consumer.

When you do that you get a XML structure LIKe this

- <n0:FMC_Mile_Maker xmlns:n0="http://tempuri.org/" xmlns:prx="urn:sap.com:proxy:DV2:/1SAI/TXS25CDAF344473F22FEDAA:700:2008/01/11">

<n0:SPLC1>This is a string 4</n0:SPLC1>

<n0:SPLC2>This is a string 5</n0:SPLC2>

</n0:FMC_Mile_Maker>

You can enter the values for testing purpose in here by clicking the fourth button left to right.

If you execute it will give another XML string like this

- <n0:FMC_Mile_MakerResponse xmlns:n0="http://tempuri.org/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">

<n0:FMC_Mile_MakerResult>Invalid SPLC code</n0:FMC_Mile_MakerResult>

</n0:FMC_Mile_MakerResponse>

You can call web service In abap program . I have written this code in a function module. I have created only one logical port and made that port default. In that case you dont need to mention the port during the coding.My input has two variables check that.

EXAMPLE CODE:

DATA: zproxy TYPE REF TO ZMILEMAKERCO_SERVICE_SOAP,

lo_sys_exception TYPE REF TO CX_AI_SYSTEM_FAULT,

ZINPUT TYPE ZMILEMAKERFMC_MILE_MAKER_SOAP1,

ZOUTPUT TYPE ZMILEMAKERFMC_MILE_MAKER_SOAP,

ZCONTROLLER TYPE PRXCTRLTAB.

TRY.

CREATE OBJECT zproxy.

CATCH CX_AI_SYSTEM_FAULT INTO lo_sys_exception.

ENDTRY.

*" Trim the inputs to nine characters.

ORIGIN_SPLC = ORIGIN_SPLC(9).

DEST_SPLC = DEST_SPLC(9).

ZINPUT-CONTROLLER = ZCONTROLLER.

ZINPUT-SPLC1 = ORIGIN_SPLC.

ZINPUT-SPLC2 = DEST_SPLC.

TRY.

CALL METHOD zproxy->fmc_mile_maker

EXPORTING

INPUT = ZINPUT

IMPORTING

OUTPUT = ZOUTPUT.

CATCH CX_AI_SYSTEM_FAULT INTO lo_sys_exception.

ENDTRY.

MILES = zoutput-fmc_mile_maker_result.

Edited by: Nanda kishore Kuchana on Nov 30, 2009 10:27 PM

Edited by: Nanda kishore Kuchana on Nov 30, 2009 10:27 PM

Former Member
0 Kudos

Hello Murali,

As I understand you have WSDL from webMethods and you want to consume webMethods exposed webservice in SAP.

Then here are the steps

First You have to go the SE80 T-code and create a client proxy.

Then you have to create a logical port for that client proxy. While creating the logical port you have to give the URL specified in the WSDL document. It would look like this http://XXXXX.com/Service.asmx. You can use LPCONFIG or SOAMANGER for creating the port. for older version SOAMANGER is not available I guess.

Edited by: Nanda kishore Kuchana on Nov 30, 2009 10:34 PM

Former Member
0 Kudos

Hello Murali,

As I understand you have WSDL from webMethods and you want to consume webMethods exposed webservice in SAP.

Then here are the steps

First You have to go the SE80 T-code and create a client proxy.

Then you have to create a logical port for that client proxy. While creating the logical port you have to give the URL specified in the WSDL document. It would look like this http://XXXXX.com/Service.asmx. You can use LPCONFIG or SOAMANGER for creating the port. for older version SOAMANGER is not available I guess.

Once you have done that you can execute the client proxy directly giving the logical port in the test service consumer.

You can enter the values for testing purpose in here by clicking the fourth button left to right.

You can call web service In abap program . I have written this code in a function module. I have created only one logical port and made that port default. In that case you dont need to mention the port during the coding.My input has two variables check that.

EXAMPLE CODE:

DATA: zproxy TYPE REF TO ZMILEMAKERCO_SERVICE_SOAP,

lo_sys_exception TYPE REF TO CX_AI_SYSTEM_FAULT,

ZINPUT TYPE ZMILEMAKERFMC_MILE_MAKER_SOAP1,

ZOUTPUT TYPE ZMILEMAKERFMC_MILE_MAKER_SOAP,

ZCONTROLLER TYPE PRXCTRLTAB.

TRY.

CREATE OBJECT zproxy.

CATCH CX_AI_SYSTEM_FAULT INTO lo_sys_exception.

ENDTRY.

*" Trim the inputs to nine characters.

ORIGIN_SPLC = ORIGIN_SPLC(9).

DEST_SPLC = DEST_SPLC(9).

ZINPUT-CONTROLLER = ZCONTROLLER.

ZINPUT-SPLC1 = ORIGIN_SPLC.

ZINPUT-SPLC2 = DEST_SPLC.

TRY.

CALL METHOD zproxy->fmc_mile_maker

EXPORTING

INPUT = ZINPUT

IMPORTING

OUTPUT = ZOUTPUT.

CATCH CX_AI_SYSTEM_FAULT INTO lo_sys_exception.

ENDTRY.

MILES = zoutput-fmc_mile_maker_result.

Edited by: Nanda kishore Kuchana on Nov 30, 2009 10:34 PM