cancel
Showing results for 
Search instead for 
Did you mean: 

An issue on web service

Former Member
0 Kudos

hi,experts,

I have an issue on web service right now,pls help me solve it!

1.I have create a web service-ZWF_RENTEST1 via se37,when I open an IE and post the URL to IE,I can see the xml content,so I think it's ok.the URL is http://erpdev.qh.sgcc.com.cn:1080/sap/bc/srt/wsdl/sdef_ZWF_RENTEST1/wsdl11/ws_policy/document?sap-cl...

Then I wanna consume this web service by a simple abap program.

2.I have create a client proxy via se80.I also give the URL http://erpdev.qh.sgcc.com.cn:1080/sap/bc/srt/wsdl/sdef_ZWF_RENTEST1/wsdl11/ws_policy/document?sap-cl... to it .

3.then I create a logical port-ZWF_RENTEST1 through tcode-lpconfig and put the URL http://erpdev.qh.sgcc.com.cn:1080/sap/bc/srt/wsdl/sdef_ZWF_RENTEST1/wsdl11/ws_policy/document?sap-cl... to it.

4.finally,I create a program in se80,the code is very very simple,as belowed:

REPORT ZRENTEST5.

DATA: ZSOAP TYPE REF TO ZCALLCO_ZWF_RENTEST1 .

TRY.

CREATE OBJECT ZSOAP

EXPORTING

LOGICAL_PORT_NAME = 'ZWF_RENTEST1'.

CATCH CX_AI_SYSTEM_FAULT .

ENDTRY.

DATA: OUTPUT TYPE ZCALLZWF_RENTEST1RESPONSE.

DATA: INPUT TYPE ZCALLZWF_RENTEST1.

DATA LO_SYS_EXCEPTION TYPE REF TO CX_AI_SYSTEM_FAULT.

INPUT-IMP = 9.

TRY.

CALL METHOD ZSOAP->ZWF_RENTEST1

EXPORTING

INPUT = INPUT

IMPORTING

OUTPUT = OUTPUT.

CATCH CX_AI_SYSTEM_FAULT INTO LO_SYS_EXCEPTION.

WRITE : LO_SYS_EXCEPTION->ERRORTEXT.

ENDTRY.

ULINE.

WRITE: /'result is :', OUTPUT-EXP.

but the result is not my expected,system give me an error like this-Unexpected element -el=definitions ns=http://schemas.xmlsoap.org/wsdl/.

I think it's probably because I didn't configure the runtime by tcode-soamanager.can anybody tell me how to configure it?

pls help me as soon as possible ,thank you in advance.

Edited by: renken158 on Mar 1, 2009 10:44 AM

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

I have found the web service-zwf_rentest1 successfully in Web Service Administration via tcode-soamanager.but when I click the "Open Web Service navigator for selected binding",there is nothing to do but there is a message"javascript:void(0)".what's wrong ?

Former Member
0 Kudos

Hi Renken,

When you open the service in the SOAMANAGER, you will need to create an endpoint to that service. The endpoint logically is the BAPI/RFC (your se37) for which the Service has been created.

Now since in SOAMANAGER you have not created any endpoint you are selecting a wsdl link with a null link to a binding.

Besides that link there exists a drop down which lists the service-endpoints for that service.

Create one endpoint and then click the link you are facing the problem in. you will be able to get the wsdl for the endpoint then.

Thnks

Former Member
0 Kudos

thank you,Yogesh Bhatia,my friend,

I have tested it successfully by the following steps:

1.Call transaction SOAMANAGER.

2.Switch to the Business Administration tab page and choose Web Service Administration.

3.find my service-ZWF_RENTEST1.

4.Choose Open WSDL Document for Selected Binding.

5.Find the <soap:address location="http://erpdev.qh.sgcc.com.cn:1080/sap/bc/srt/rfc/sap/zwf_rentest1/200/zwf_rentest1/zhaha" /> from the popup IE,put it to the logical port by transaction code-lpconfig.

6.execute the program ZRENTEST5 which has been posted yesterday.

ok,the result is ok,it's my expected result!

but,what should I do if I wanna this web service to be called by other application?send the url "http://erpdev.qh.sgcc.com.cn:1080/sap/bc/srt/rfc/sap/zwf_rentest1/200/zwf_rentest1/zhaha" to it?

unfortunately,it's failed...

besides,when I open the link "Open Web Service navigator for selected binding",

there is an error,I can't test the web service in IE,could u pls tell me the reason?

Former Member
0 Kudos

Hi Renken,

To use the web service from a different application you will need a wsdl file

So in the same place where you are navigatin now

Go to

Open PortType WSDL Document.

Take that link and append an wsdl to it

http://<>/<>/.........?wsdl

Open link in IE. Save as wsdl.

And regarding your binding, i have already told you to check whether any binding exists for the service you have defined. If not define a binding, if it exists, then save the binding again.

Answers (0)