Consume .net webservice

Discussion in 'Java' started by Peter K, Jun 28, 2007.

  1. Peter K

    Peter K Guest

    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
     
    Peter K, Jun 28, 2007
    #1
    1. Advertising

  2. On Jun 28, 6:06 am, Peter K <> wrote:
    > 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
     
    Manish Pandit, Jun 28, 2007
    #2
    1. Advertising

  3. Peter K wrote:
    > 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
     
    =?ISO-8859-1?Q?Arne_Vajh=F8j?=, Jul 1, 2007
    #3
  4. Peter K

    Twisted Guest

    On Jun 28, 9:06 am, Peter K <> wrote:
    > 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.
     
    Twisted, Jul 1, 2007
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Paul Hermans

    Consume php webservice in asp.net

    Paul Hermans, Jun 10, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    946
    bruce barker
    Jun 10, 2004
  2. bav
    Replies:
    8
    Views:
    974
    Дамјан ГеоргиевÑки
    May 14, 2009
  3. Timo
    Replies:
    2
    Views:
    491
  4. Pokkie
    Replies:
    1
    Views:
    254
    Keenan Newton
    May 6, 2005
  5. dgleeson422111

    consume local web service -ok consume remote service - Not OK

    dgleeson422111, Jan 26, 2010, in forum: ASP .Net Web Services
    Replies:
    2
    Views:
    1,650
    dgleeson422111
    Jan 31, 2010
Loading...

Share This Page