Heybo Blog

If you look at me when I'm talking, you'll see what I'm saying ... about Tech and .NET discoveries!

My Links

News

Story Categories

Archives

Post Categories

Image Galleries

Login

Blog Stats

Links

Personal Websites

Consume .NET Webservice from JSP using BEA Workshop for JSP

I have had a hard time finding a good article on consuming .net webservices. Recently I was working on a project that requires communication between two platforms, J2EE and asp.net. I had given up on J2EE and started down the .net path in 2003. The last time I worked with jsps was before that time.

Since our production server uses weblogic, I figured the BEA Workshop IDE would be useful. The first step was to generate the java classes from the asp.net WSDL. You can get to the WSDL by adding the ?WSDL query string to the webservice url.

This process assumes you are familiar with webservices and have already created one. First create a project in the IDE. Then right click on the src folder, click New > Other > Web Service Client. It will prompt you for your webservice definition. After you enter the url for the WSDL, you finish the wizard and it generates a package based on the namespace you set in your webservice.

Next on the *-INF folder, click New > JSP. Call the jsp Index.jsp. In the code of the jsp, in the body place the jsp tags '<% %>'. Between the tags you write the java code needed to handle the request. In this example the return value from the webmethod is a String.

inc.yourcompany.webservices.YourSoapProxy proxy =

new inc.yourcompany.webservices.YourrSoapProxy();

String output =

proxy.GetString(

"firstString","SecondString");

%><%= outputID %>

 

posted on Tuesday, October 31, 2006 5:19 AM

Feedback

No comments posted yet
Title  
Name  
Url
Comments   
Protected by Clearscreen.SharpHIPEnter the code you see: