aspose file tools*
The moose likes Web Services and the fly likes access to .net web service Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "access to .net web service" Watch "access to .net web service" New topic
Author

access to .net web service

bostian tov
Ranch Hand

Joined: Mar 11, 2010
Posts: 32
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
Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
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!


My free books and tutorials: http://www.slideshare.net/krizsan
bostian tov
Ranch Hand

Joined: Mar 11, 2010
Posts: 32
.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

Joined: Oct 04, 2006
Posts: 2198
    
    1
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

Joined: Mar 11, 2010
Posts: 32
This is unmodified wsdl...
Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
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!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: access to .net web service