• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

access to .net web service

 
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have created .net web service, that accepts some arguments and return results. I have SOAP xml document available.

So how can i access this web service from my java desktop application? I am using SWING. Is there quick way to do this? Thanks
 
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi!
Yes, you can access your web service if you are using JavaSE 6, which has all the necessary classes built in.
If you are using earlier versions of JavaSE, then you can still access the web service but have to include additional libraries.
The Metro web service stack also includes client libraries. It can be found here: https://metro.dev.java.net/
Use the wsimport command included in the JDK to generate client artifacts (classes etc) from the WSDL of the .NET web service.
Here is a tutorial showing how to develop SOAP web service clients in NetBeans: http://netbeans.org/kb/docs/websvc/client.html
If you need additional help, please do not hesitate to post again!
Best wishes!
 
bostian tov
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
.net generated wsdl for me, but i see there are some diffrences if i look at example java WSDL file (eclipse generated example). One thing for example is s:element where java wsdl has xsd:element. I have fixed that, somehow connected web service with web service methods, because by default in design this wasnt set. So everything looks ok, but when i try to add this file in web service client, i get this:

Selection must be WSDL.


So what should i set or change, to get this stuff working? Thanks

Generated code:


 
Ivan Krizsan
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi!

bostian tov wrote:.net generated wsdl for me, but i see there are some diffrences if i look at example java WSDL file (eclipse generated example). One thing for example is s:element where java wsdl has xsd:element.


Eh, that was the namespace prefix, which is not significant and should not be changed. Thus <s:element> and <xsd:element> are equally valid, provided that the corresponding namespace declarations refer to the same namespace.
Can you enclose the unmodified WSDL?
Best wishes!
 
bostian tov
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is unmodified wsdl...
 
Ivan Krizsan
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi!
The WSDL you have enclosed lacks a number of necessary namespace declarations.
Try changing the first part of the document to:

...and see if that helps.
Best wishes!
 
What's gotten into you? Could it be this tiny ad?
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic