cancel
Showing results for 
Search instead for 
Did you mean: 

Problem in Web service callable object!!

Former Member
0 Kudos

Hi,

I have created a function module in R/3, and made it RFC enabled.Now i am trying to use this webservice in creating CO for web service.Now when i test it, i am getting this error:

Web service method http://<hostname>.<fully qualified domain name>.com:8001/sap/bc/soap/wsdl11?services=ZADDITION&sap-client=400&sap-user=<user ID>&sap-password=<Password>

invocation failed: Invalid Response Code: (401) Unauthorized. The requested URL was:"http://<hostname>.<fully qualified domainname>.com:8001/sap/bc/soap/rfc"; nested exception is:

com.sap.engine.services.webservices.jaxrpc.exceptions.InvalidResponseCodeException: Invalid Response Code: (401) Unauthorized. The requested URL was:"http://<hostname>.<fully qualified domain name>.com:8001/sap/bc/soap/rfc"

What can be the reason??

any help will be highly apprecaiated!!

Thanks & Regards

Ameya

Accepted Solutions (1)

Accepted Solutions (1)

former_member188632
Active Contributor
0 Kudos

Hi,

Just one update: This WSDL URL is working fine and has no errors!! i have tested it in Browser.

Thanks in advance

Regards,

Ameya

former_member206397
Contributor
0 Kudos

Hi,

As per the error I think the problem is regarding authorization. Does the web service hold authontication? If it holds then please provide actual UserId and password at the time of creation callable object or at the exposing time you can remove the authorization check. Then try it. Bucause when you are testing the Web Service I think it is asking for UserId and password before executing it. So here also you need to specify the same userId and Password. Please check it and then let me know.

Thanks

Chandan

former_member188632
Active Contributor
0 Kudos

Hi,

Thanks a lot for the reply, Well this webservice is nothing but R/3 function module RFC enabled.So what exactly i sholud do?remove authentication means should i remove user id & pasword from URL?

Regards,

Ameya

former_member188632
Active Contributor
0 Kudos

Hi Chandan,

could you please tell me that in this error i am getting,<b>Unauthorised</b>, but what is unauthorised?in URL i specified i am giving admin credentials,please elaborate..what else can be done to solve this issue?

It very urgent!!

awaiting your reply,

Regards,

Ameya

Former Member
0 Kudos

Ciao Ameya,

You know that in order to create a WS CO, you can choose 2 options:

WDSL URL Select or

Logical Destination Select.

If i correctly understand you have used the first option,

but i think you have to use the second

(the help guide says "You use logical destination when you want to: Choose from a set of previously defined WSDL files; Invoke web services that need authentication; Invoke ABAP web services.")

and then you have to configure the logical destination (<a href="http://help.sap.com/saphelp_nw04s/helpdata/en/f8/7889ce12924273a379c1c590675573/frameset.htm">help</a>).

Hope this help.

Regards

Luca

former_member188632
Active Contributor
0 Kudos

Hi,

You mean to say i should usethe second option?i have created a RFC function module "ZADDITION" and i want to use this in my CO.

Regards,

Ameya

Former Member
0 Kudos

yes, i think so.

Configure logical destination, then select the second option while creating the CO

former_member188632
Active Contributor
0 Kudos

Hi,

Thanks for input, but do you think it will work this way??ok i will try now as you suggested and will update the thread soon!!

regards,

Ameya

former_member188632
Active Contributor
0 Kudos

Well, one more update..

i tried using other WSDL url for Webservice other that of ABAP and it is

<b>http://www.webservicex.net/WeatherForecast.asmx?WSDL</b>

But this too is giving me this following error:

Could not load WSDL: GenericServiceFactory initialization problem when trying to load Web service model for WSDL: http://www.webservicex.net/WeatherForecast.asmx?WSDL

i have configured WebService container in Visual Admin as well and set proxy settings too.

Any idea??

Regards,

Ameya

Former Member
0 Kudos

I've tried this WS, and it works.

Maybe the error is in your proxy settings (make a try and leave all proxy settings blank)

former_member188632
Active Contributor
0 Kudos

Hi,

Would you please tell me what proxy setting and Exactly where i need to do?i am unaware of proxy settings, please guide me.

Thanks for reply..

Regards,

Ameya

former_member188632
Active Contributor
0 Kudos

Also please tell me,do i need to generate the WSIL file of consuming this service? i am talking in context with the ABAP web service..for this i am doing Logical destinations configuration, but i am confused that before doing this do i need to generate any WSIL file??if yes then, what would be the <b>process template ID & process version?</b>..

I think i have messed up..not getting what exactly i need to do..

please help me..

Thanks,

Ameya

Former Member
0 Kudos

Ok, this is my method:

once you've created the web service, go to transaction WSADMIN, open folder SOAP_Application_for_RFC-compliant, search your WS and get the URL (Example: Z_My_WS URL is /sap/bc/srt/rfc/sap/Z_My_WS).

Now go to Visual Admin: ServerXXXXX>Services>Web Services Security, in run time tab, open: Security configuration>Web Services Clients>sap.com>DynamicWSProxies create; in URL form insert:

http://<hostname>.<fully qualified domain name>.com:80XX/sap/bc/srt/rfc/sap/Z_My_WS?sap-client=XXX&wsdl=1.1, insert SysID, client, lang, for authentication select BASIC and insert UID & PWD. Then SAVE.

Last Step: in GP Design time select Logical Destination and select the one which you have created previously.

Select Logical Destination EndPoint and select yours.

Hope it works.

Luca

former_member188632
Active Contributor
0 Kudos

Hi,

Thanks a lot for the info.

But when i go to transaction WSADMIN --> SOAP_Application_for_RFC-compliant

I could not find my web service out here.

Please note that i have created an RFC enabled function module.

How can i proceed?

Regards,

Ameya

Former Member
0 Kudos

I'm confused.

Sorry, in ABAP side i can't help you.

But, maybe you need an External Service CO for your function, not a WS CO.

former_member188632
Active Contributor
0 Kudos

Hi,

for ABAP i have created a web service using my RFC function module just now, made the entry as you suggested for logical destination.

For http://www.webservicex.net/WeatherForecast.asmx?WSDL Webservice too, do i need to set logical destination??

Regards,

Ameya

Former Member
0 Kudos

No, you have to insert only a WSDL URL, (first option).

Check your proxy settings first (visual admin services>Web Services Container, settings tab, for my enviroment i leave blank all the fields)

For ABAP it worked?

former_member188632
Active Contributor
0 Kudos

Hi,

For ABAP i tried as you said, i was even able to find the logical destination set by me, but when i select this logical destination, i didnt find my webservice..its all blank.

Do you know why this happened?

Regards,

Ameya

Former Member
0 Kudos

you have pushed select?

you get the error message "Could not find logical destination interfaces"? In this case check the URL inserted in visual admin.

former_member188632
Active Contributor
0 Kudos

Hi,

Yes i am getting error Could not find logical destination interfaces, check the <b>WSIL URL</b> inserted in visual admin.

Look.,

1)my function module name is ZADDITION,(RFC enabled)

2)IN transaction WSADMIN, i got the URL as

default_host/sap/bc/srt/rfc/sap/ZADDITION

in visual Admin i put this url

http://<host><fully qualified domain name>:8001/sap/bc/srt/rfc/sap/ZADDITION?sap-client=800&wsdl=1.1,

please tell me this host name is R/3 server or the portal server?

IN visual admin i put the above stated url,inserted SID,client,language, Basic Authentication,given UIDPW,

Then in Design time i was able to fine Logical destination name : Exposing,

then i clicked on search. but nothing happened

What can be the problem..is there any problem in my url??

please guide me, i think we have almost solved this..You have helpd me a lot..

Regards,

Ameya

Former Member
0 Kudos

Seems all correct. Are you able to find your wsdl in a browser?

For accuracy: have you followed the help guide, and insert two logical destination (exposing and exposing_METADATA)?

Insert only ONE logical destination and put your url in, nothing else.

former_member188632
Active Contributor
0 Kudos

Hi,

Yes i have created two destinations named Exposing and Exposing_METADATA

Should i create only one?

Well should i directly put in my browser?

ok doing this..

Thanks for your efforts..

Regards,

Ameya

former_member188632
Active Contributor
0 Kudos

Hi,

Please tell me, when i select logical destination,i am getting error saying check that destination refers to <b>WSIL URL</b> but i think we are doing this as <b>WSDL URL</b>, because in our URL too, we find WSDL=1.1

Do you have any idea?

Regards,

Ameya

Answers (0)