Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Call .NET web service from Java

Reply
Thread Tools

Call .NET web service from Java

 
 
John Straumann
Guest
Posts: n/a
 
      05-03-2008
Hi all:

Does anyone out there have any experience with connecting to a .NET web
service from a Java Application and/or servlet? Can anyone point me at a
tutorial or a good example?

Thanks!

John.

 
Reply With Quote
 
 
 
 
Arne Vajhøj
Guest
Posts: n/a
 
      05-03-2008
John Straumann wrote:
> Does anyone out there have any experience with connecting to a .NET web
> service from a Java Application and/or servlet? Can anyone point me at a
> tutorial or a good example?


Use a toolkit that can generate a stub from the WSDL file.

Like Axis WSDL2Java or JDK 1.6 wsimport.

Run and just call the stub code.

Very simple and easy.

Arne
 
Reply With Quote
 
 
 
 
John Straumann
Guest
Posts: n/a
 
      05-03-2008
Hi Arne:

Thanks for the reply. I used the tool and it generated a bunch of Java code
files and classes. Is there a tutorial somewhere that shows how to use the
generated files? It has been a while since I have worked with Java and I am
not sure. I don't see how the generated Java maps to the .NET web service
call that I usually work with.

John.


"Arne Vajhøj" <> wrote in message
news:481bac9b$0$90272$...
> John Straumann wrote:
>> Does anyone out there have any experience with connecting to a .NET web
>> service from a Java Application and/or servlet? Can anyone point me at a
>> tutorial or a good example?

>
> Use a toolkit that can generate a stub from the WSDL file.
>
> Like Axis WSDL2Java or JDK 1.6 wsimport.
>
> Run and just call the stub code.
>
> Very simple and easy.
>
> Arne


 
Reply With Quote
 
Arne Vajhøj
Guest
Posts: n/a
 
      05-03-2008
John Straumann wrote:
> Thanks for the reply. I used the tool and it generated a bunch of Java
> code files and classes. Is there a tutorial somewhere that shows how to
> use the generated files? It has been a while since I have worked with
> Java and I am not sure. I don't see how the generated Java maps to the
> .NET web service call that I usually work with.


I usually find it rather self explaining when browsing the
generated code.

Example:

..NET web service

public class SimpleTest : WebService
{
[WebMethod]
public int AddOne(int v)

called from Java with Axis generated stub:

SimpleTestLocator stl = new SimpleTestLocator();
SimpleTestSoap sts = stl.getSimpleTestSoap();
System.out.println(sts.addOne(2));

Arne
 
Reply With Quote
 
John Straumann
Guest
Posts: n/a
 
      05-05-2008
Thanks for the help folks.

John.

"Lew" <> wrote in message
news:. ..
> John Straumann wrote:
>>> Thanks for the reply. I used the tool and it generated a bunch of Java
>>> code files and classes. Is there a tutorial somewhere that shows how to
>>> use the generated files? It has been a while since I have worked with
>>> Java and I am not sure. I don't see how the generated Java maps to the
>>> .NET web service call that I usually work with.

>
> Arne Vajhøj wrote:
>> I usually find it rather self explaining when browsing the
>> generated code.
>>
>> Example:
>>
>> ..NET web service
>>
>> public class SimpleTest : WebService
>> {
>> [WebMethod]
>> public int AddOne(int v)
>>
>> called from Java with Axis generated stub:
>>
>> SimpleTestLocator stl = new SimpleTestLocator();
>> SimpleTestSoap sts = stl.getSimpleTestSoap();
>> System.out.println(sts.addOne(2));

>
> Or even,
>
> SimpleTest sts = stl.getSimpleTestSoap();
>
> etc.
>
> The exact flavor of the calls depends on the web-service framework you
> choose. Generally the Java code declares an interface type with the same
> name as the web service, and an implementing type such as Arne's
> 'SimpleTestSoap' class. If you crack open the implementing class's source,
> you find all the messy details of setting up a proxy object, mapping Java
> types to XML namespaces and tags, and so forth.
>
> --
> Lew


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Web service autentication problem when call another web service Redhot ASP .Net Web Services 0 07-18-2009 09:43 PM
'web service call failed: 500' using ajax hovermenu and web service Not Me ASP .Net 1 06-05-2007 03:09 PM
InvocationTargetException when calling "new Service()" in Axis web service to call another web service Michael Averstegge Java 0 01-10-2006 11:05 PM
Web service slow on first call? In memory or cache option for web service? RJ ASP .Net Web Services 4 09-22-2005 09:07 PM
help: need to call call web service from java bill sandner Java 1 07-01-2004 02:57 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57