on 12-21-2009 3:48 AM
I want to use any external webservice in a webdynpro for java application.Can any one guide me withe steps for the same?
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
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
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://wiki.sdn.sap.com/wiki/display/VC/WebservicesforVisual+Composer
Regards,
Saravanan K
Edited by: Saravanan K on Dec 21, 2009 8:12 AM
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?
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
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.
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?
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
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.
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.
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
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.
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))
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.
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.