cancel
Showing results for 
Search instead for 
Did you mean: 

Webservices in Webdynpro for java.

Former Member
0 Kudos

I want to use any external webservice in a webdynpro for java application.Can any one guide me withe steps for the same?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Friend,

you can use external web services in web Dynpro java as adaptive web services model.

1. You need To import the webservice as model for that go to model right click on that and from context menu choose create model.

2. it will open a popup window where you have to select adaptive webservice model.

3. it will ask for Model Name And Model Package. Specify the same.

4. At available WSDL sources select Remote Location/File System.

5. Press Next and it will ask for the WSDL. Here either you can specify the URL of the WSDl or Browse the WSDL file.

6. It will ask for Create Service Group. Select No service Group Configuration.

7. After that it will ask for Logical destination for time being you can use no logical destination latter you can create and specify if required.

8. Click next and Click Finish.

Once model is imported you can use the service. For that you can follow these links it would be very helpful and let us know if you face any issue.

[FAQ - Models - Adaptive Web Service |http://wiki.sdn.sap.com/wiki/display/WDJava/FAQ-Models-AdaptiveWebService]

[Implementing Web service in Web Dynpro Java using Placeholder for WSDL|http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/a0eb8b47-f44d-2c10-628c-f9ffb3c762c7]

[Web Dynpro Java Adaptive Web Service Model u2013 Controller Coding Explained|http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/900bbf94-a7a8-2910-e298-a651b4706c1e]

[NetWeaver Developers Guide 2004s: Model and Java Dictionary|http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/22b0ade5-0601-0010-a68c-cc38c2f549c9]

Regards

Jeetendra

Former Member
0 Kudos

Thankyou for your help.Now when I am giving the url of webservice as http://webservices.matlus.com/scripts/emailwebservice.dll/wsdl/IemailService

But I am getting the error as

"Error in loading WSDL file .check error log for more details."

Can you tell me do we need to do some configurations on the basis side.

Former Member
0 Kudos

Hi Friend,

I don't think That WSDL is valid. Make Sure its Proper And Working You can copy the service URL and Paste it to your browser and If that would give proper details then only you can say that is a valid WSDL. In your Case i am afraid its a proper WSDL its not working at my end. The Format of a valid WSDL is something Like

http://xxx.xx.xx.xxx:xxxx/services/xxxxxxxService?wsdl.

Regards

Jeetendra

Former Member
0 Kudos

I am creating a sample application. Can you tell me any such url which I can use and try out. Or tell me where I will get proper url for wsdl.I need any sample webservice url to try out.

Former Member
0 Kudos

Hi,

Search SDN for the sample WSDL and import it in the project and check it also please check the webservices available in Internet

using the following URL

http://www.webservicex.net/

http://wiki.sdn.sap.com/wiki/display/VC/WebservicesforVisual+Composer

Regards,

Saravanan K

Edited by: Saravanan K on Dec 21, 2009 8:12 AM

Former Member
0 Kudos

Hi friend,

You can use above provided Links for WSDl and let us know if you need any further help.

Thanks Saravanan K for Links its really helpful.

Regards

Jeetendra.

Former Member
0 Kudos

Now I am using this http://www.webservicex.net/sunsetriseservice.asmx?wsdl .

When I type this link in browser it opens an xml file.But when I add it in the wizard I get the same error.

I am working on nwds 7.0.9 and I am doing the following steps.

1. I have created a new webdynpro project.

2.Now I right click on models and select create model.

3. Then I select Import Adaptive webservice model.

4.I enter model name as "Sunsettimemodel" and model package as "com.essar.sunset" and select WSDL source as local file system or url.

5.I select no logical destinations.

6. Then I paste the above url in wsdl source or url where I get the following error

"Error in loading WSDL file. Check error log for more details."

Please correct me if I am wrong or missing any steps. Do we have to do anything with the xml file that we get when we open the url in a browser?

Former Member
0 Kudos

Do we need to do any configurations on the basis side like adding some url in visual admin or something.Please specify any such steps if required.

Former Member
0 Kudos

Hi Friend,

1. I have created a new webdynpro project.

2.Now I right click on models and select create model.

3. Then I select Import Adaptive webservice model.

4.I enter model name as "Sunsettimemodel" and model package as "com.essar.sunset" and select WSDL source as local file system or url.

5.I select no logical destinations.

Up-til here all the process are ok. now do one thing open the wsdl in webbrowser (internet explorer ) and from file menu select save as and give the name with extension wsdl and save the wsdl file. Now instead of giving URL brows for this file and once validation is done proceed further. By this way you will be able to import the model. I have checked it its working on my side. Sometime this happens due to some network problem or slow net connection.

Let us know if you face any issue.?

Regards

Jeetendra

Former Member
0 Kudos

Hi Friend,

No We don't need to do any configuration on basis side like adding some url in visual admin or something.

Regards

Jeetendra.

Former Member
0 Kudos

Ya .I got it this time. Now when I m adding existing model in the diagram view it is not appearing there like normal rfc models.

Former Member
0 Kudos

Hi Friend,

Do One thing You want to bond the model data with component controller context node or View Controller context node..?

If you want with component controller right click on controller's context select new node-> select model Binding-> select add used model and select your model -> select the nodes and click on finish. done you don't need to add in the diagram view as used model.

Hope It will help.

Regards

Jeetendra.

Former Member
0 Kudos

I want to bind model with the component controller and there is no option as new node.it adds either value node or model node when I right click on controller's context.Which one should I select model node or value node and the how to bind it to my model.please guide me.

Former Member
0 Kudos

Hi friend,

I think You are using old version of NWDS. Select model node instead of new node. Although i don't have much idea about old version.

Regards

Jeetendra

Former Member
0 Kudos

try{

Model1= new Suntimingsmodel();

Request_GetSunSetRiseTime =new Request_GetSunSetRiseTime(Model1);

GetSunSetRiseTime =new GetSunSetRiseTime(Model1);

wdContext.currentModelElement().modelObject().execute();

}

catch(Exception ex)

{

}

I am writing this code on the component controller's doinit method.

Words in bold are marked red and giving the error cannot be resolved. What should I do?

Former Member
0 Kudos

Hi Friend,

Try With This Code.


Model1 suntimesmodel = new Model1();
		Request_GetSunSetRiseTime getSunSetRiseTimeRequest = new Request_GetSunSetRiseTime(suntimesmodel);
		wdContext.nodeRequest_GetSunSetRiseTime().bind(getSunSetRiseTimeRequest);
		GetSunSetRiseTime getSunSetRiseTimeNode = new GetSunSetRiseTime(suntimesmodel);
		LatLonDate latLonDate = new LatLonDate(suntimesmodel);

		latLonDate.setDay(value);
		latLonDate.setLatitude(value);
		latLonDate.setLongitude(value);
		latLonDate.setMonth(value);
		latLonDate.setSunRiseTime(value);
		latLonDate.setSunSetTime(value);
		latLonDate.setTimeZone(value);
		latLonDate.setYear(value);

		getSunSetRiseTimeNode.setL(latLonDate);
		getSunSetRiseTimeRequest.setGetSunSetRiseTime(getSunSetRiseTimeNode);
		
		try {
			getSunSetRiseTimeRequest.execute();
		} catch (WDWSModelExecuteException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

Regards

Jeetendra

Former Member
0 Kudos

Friend tell me one thing when I am adding the adaptive webservice model using create model icon in the data modeler upon succesful completion of the wizard why is it not showing the model in Used models area of the data modeler.

Former Member
0 Kudos

If I create a model node and then do the structure binding it does not show the structure when I try to bind the uielements to the model attributes.

Also when I try to bind controller to view through data modeller I get both the context as empty although I created a model node in controller and binded it to the webservice model by right clicking on the context.

I think there is some problem with the way I am going ahead.

Former Member
0 Kudos

Hi Friend,

Check whether you have selected the add used model while creating the model node.

If you have done same then the model should appear while creating structure mapping.

Regards

Jeetendra

Former Member
0 Kudos

I get the following error when I deploy the application.

The initial exception that caused the request to fail, was:

java.io.FileNotFoundException: /usr/sap/EDH/JC04/j2ee/cluster/server0/C:/Documents and Settings/anaik/Desktop/sunsetriseservice.wsdl (No such file or directory (errno:2))

at java.io.FileInputStream.open(Native Method)

at java.io.FileInputStream.<init>(FileInputStream.java:106)

at java.io.FileInputStream.<init>(FileInputStream.java:66)

at sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:69)

at sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:156)

Can anyone guide me on this.

Former Member
0 Kudos

Hi Friend,

I think The WSDL File is deleted from its location Check it if its there.

Regards

Jeetendra

Former Member
0 Kudos

No the file has not been deleted its still there.

Former Member
0 Kudos

Hi Anzar,

Test Web service URL in WSNavigator and see if service is working fine.

Regards

Pranav

Former Member
0 Kudos

where will i get the WS Navigator?

Former Member
0 Kudos

Hi Friend,

WS Navigator is Testing Tool For service Testing scenario. its a SAP propitiatory tool You can access it from NWA->web Services. But i don't think you can use this for testing external WSDL or services. as it may give some error like wsdl is not in white list.

better check it its available and working from the provider side ( i.e xmethods etc.) generally these services becomes unavailable soon. i have also faced some problem while i was learning.

Regards

Jeetendra

Former Member
0 Kudos

I still get the same exception.I am using global weather webservice which is working well on the provider side.

I have saved the wsdl file on desktop and imported it from there while importing adaptive webservice model.

ie:the path I browse for the WSDL file in nwds is C:\Documents and Settings\anaik\Desktop\WeatherForecast.WSDL

I get the following exception:

java.io.FileNotFoundException: /usr/sap/EDH/JC04/j2ee/cluster/server0/C:/Documents and Settings/anaik/Desktop/WeatherForecast.wsdl (No such file or directory (errno:2))

Do I have to save the file in some other location also on the basis side.

Former Member
0 Kudos

Hi...

Copy the WSDL file to your package, and use this path...

Don't use a path to a local machine file... using the package path, this issue will be solved...

Regards

Former Member
0 Kudos

Dear friend which package and how do I find that package path. Can you tell me with an example. Are you telling me to paste the file in the project folder in the workspace.

Former Member
0 Kudos

I placed the wsdl file in the package and tried but still the same thing .I get the following error

java.io.FileNotFoundException: /usr/sap/EDH/JC04/j2ee/cluster/server0/C:/Documents and Settings/anaik/Documents/SAP/workspace/packweb/bin/com/sap/webpack/WeatherForecast.WSDL (No such file or directory (errno:2))

Former Member
0 Kudos

Hi

if you are creating AWS model using WSDL file stored on your local system(developer's PC), you can create the Model.

When you deploy the application, at delpoy time the server will search for that WSDL file at server at same location. (location where you have stored the file on your pc). thats what is mentioned in error

/usr/sap/EDH/JC04/j2ee/cluster/server0/C:/Documents and Settings/anaik/Documents/SAP/workspace/packweb/bin/com/sap/webpack/WeatherForecast.WSDL (No such file or directory (errno:2))

try copying the WSDL file on J2EE server at same location and deploy.

Answers (0)