Consume .net webservice

P

Peter K

Hi,

I have a webservice written in c#, which I now want to consume from a
java application.

In the .net world it is relatively simple to use Microsoft's visual
studio IDE to automatically generate all the interface and data classes
for accessing a webservice. But I haven't successfully achieved this in
java yet - I hope I can get some help here...

I am using the Eclipse IDE and have looked at XFire and JAXWS, but
haven't managed to get them to work properly yet.

JAXWS complains with some warnings:

[WARNING] src-resolve: cannot resolve the name 's1:guid' to a(n) 'type
definition' component.

[WARNING] SOAP port "MyWSSoap12": uses a non-standard SOAP 1.2 binding

and in the generated source there is an error:

@WebEndpoint(name = "MyWSSoap")
public MyWSSoap getMyWSSoap(WebServiceFeature... features) {

Where "WebServiceFeature..." is unknown to the compiler.


XFire generates some classes with a whole lot of stub methods which just
throw UnsupportedOperationExceptions.


Can anyone give me some hints on an easy way to import WSDL data and
generate the necessary classes for accessing a webservice via java?


Thanks,
Peter
 
M

Manish Pandit

Hi,

I have a webservice written in c#, which I now want to consume from a
java application.

In the .net world it is relatively simple to use Microsoft's visual
studio IDE to automatically generate all the interface and data classes
for accessing a webservice. But I haven't successfully achieved this in
java yet - I hope I can get some help here...

I am using the Eclipse IDE and have looked at XFire and JAXWS, but
haven't managed to get them to work properly yet.

JAXWS complains with some warnings:

[WARNING] src-resolve: cannot resolve the name 's1:guid' to a(n) 'type
definition' component.

[WARNING] SOAP port "MyWSSoap12": uses a non-standard SOAP 1.2 binding

and in the generated source there is an error:

@WebEndpoint(name = "MyWSSoap")
public MyWSSoap getMyWSSoap(WebServiceFeature... features) {

Where "WebServiceFeature..." is unknown to the compiler.

XFire generates some classes with a whole lot of stub methods which just
throw UnsupportedOperationExceptions.

Can anyone give me some hints on an easy way to import WSDL data and
generate the necessary classes for accessing a webservice via java?

Thanks,
Peter

Hi,

I use eclipse with WTP (Web Tools Platform) which supports WSDL
import. Right click the WSDL and it will give you options to generate
test client, stubs etc. It will even give you a test GUI (Web Services
Explorer) where in you can populate the SOAP request and send it to
the endpoint and view the SOAP response.

http://www.eclipse.org/webtools/jst...ls/WebServiceExplorer/WebServiceExplorer.html

-cheers,
Manish
 
?

=?ISO-8859-1?Q?Arne_Vajh=F8j?=

Peter said:
I have a webservice written in c#, which I now want to consume from a
java application.

In the .net world it is relatively simple to use Microsoft's visual
studio IDE to automatically generate all the interface and data classes
for accessing a webservice. But I haven't successfully achieved this in
java yet - I hope I can get some help here...

I am using the Eclipse IDE and have looked at XFire and JAXWS, but
haven't managed to get them to work properly yet.

Axis comes with a command line tool WSDL2Java that works very
much like the .NET wsdl utility.

There are also an ant task, so if you are using ant for build,
then you are all set.

I think you can get a plugin to Eclipse that makes you do it
from within Eclipse similar to Visual Studio.

Arne
 
T

Twisted

Hi,

I have a webservice written in c#, which I now want to consume from a
java application.

Consume ... yes ... yes ... consume ... Consume .NET service! CONSUME!
EAT! CRUSH! DESTROY! DESTROY .NET SERVICE! CONSUME IT, MY CREATION,
AND GROW STRONGER! TOGETHER WE SHALL ELIMINATE THE MIGHTY MICROSOFT
THREAT! TOGETHER WE SHALL RULE THE WORLD! MUAHAHAHAHAHA!

Er, yeah, go kill that evil Microsoft dreck, and bring me back its
steaming entrails.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,015
Latest member
AmbrosePal

Latest Threads

Top