<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Guy Burstein : Java</title><link>http://blogs.msdn.com/bursteg/archive/tags/Java/default.aspx</link><description>Tags: Java</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>How To: Call Java EE Web Service from Silverlight Client</title><link>http://blogs.msdn.com/bursteg/archive/2008/07/19/how-to-call-java-ee-web-service-from-silverlight-client.aspx</link><pubDate>Sat, 19 Jul 2008 14:30:36 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8754654</guid><dc:creator>Guy Burstein</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/bursteg/comments/8754654.aspx</comments><wfw:commentRss>http://blogs.msdn.com/bursteg/commentrss.aspx?PostID=8754654</wfw:commentRss><wfw:comment>http://blogs.msdn.com/bursteg/rsscomments.aspx?PostID=8754654</wfw:comment><description>&lt;h1&gt;How To: Call Java EE Web Service from Silverlight Client&lt;/h1&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/bursteg/WindowsLiveWriter/HowToCallJavaEEWebServicefromSilverlight_C93A/jee_2.jpg"&gt;&lt;img title="Java EE Web Service Silverlight Client" style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; margin: 0px 0px 0px 15px; border-right-width: 0px" height="48" alt="Java EE Web Service Silverlight Client" src="http://blogs.msdn.com/blogfiles/bursteg/WindowsLiveWriter/HowToCallJavaEEWebServicefromSilverlight_C93A/jee_thumb.jpg" width="48" align="right" border="0" /&gt;&lt;/a&gt; I have already posted about &lt;a href="http://blogs.microsoft.co.il/blogs/bursteg/archive/2008/07/19/how-to-call-a-java-ee-web-service-from-a-net-client.aspx"&gt;How To: Call a Java EE Web Service from a .Net Client&lt;/a&gt;, but if Silverlight is the .Net client application that consumes that service, there are several issues you should be aware of.&lt;/p&gt;  &lt;h3&gt;Only asynchronous operations&lt;/h3&gt;  &lt;p&gt;When adding a service reference from a Silverlight application to any web service, the generated proxy has only async operations. This means that instead of calling the operation and get the result:&lt;/p&gt;  &lt;div style="font-size: 11pt; background: white; color: black; font-family: consolas"&gt;   &lt;p style="margin: 0px"&gt;&lt;span style="color: #2b91af"&gt;CalculatorServiceClient&lt;/span&gt; proxy = &lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af"&gt;CalculatorServiceClient&lt;/span&gt;();&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;int&lt;/span&gt; result = proxy.Add(2, 3);&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&lt;span style="color: #2b91af"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color: #a31515"&gt;&amp;quot;Calculator Service returned: &amp;quot;&lt;/span&gt; + result.ToString());&lt;/p&gt; &lt;/div&gt;  &lt;p&gt;what you have to do is call the &lt;strong&gt;async&lt;/strong&gt; version of this method, and register to the &lt;strong&gt;completed&lt;/strong&gt; event:&lt;/p&gt;  &lt;div style="font-size: 11pt; background: white; color: black; font-family: consolas"&gt;   &lt;p style="margin: 0px"&gt;&lt;span style="color: #2b91af"&gt;CalculatorServiceClient&lt;/span&gt; proxy = &lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af"&gt;CalculatorServiceClient&lt;/span&gt;();&lt;/p&gt;    &lt;p style="margin: 0px"&gt;proxy.AddCompleted += proxy_AddCompleted;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;proxy.AddAsync(a, b);&lt;/p&gt; &lt;/div&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;and as the implementation of the proxy_AddCompleted method, get the result:&lt;/p&gt;  &lt;div style="font-size: 11pt; background: white; color: black; font-family: consolas"&gt;   &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;void&lt;/span&gt; proxy_AddCompleted(&lt;span style="color: blue"&gt;object&lt;/span&gt; sender, &lt;span style="color: #2b91af"&gt;AddCompletedEventArgs&lt;/span&gt; e)&lt;/p&gt;    &lt;p style="margin: 0px"&gt;{&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;int&lt;/span&gt; result = e.Result;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; ...&lt;/p&gt;    &lt;p style="margin: 0px"&gt;}&lt;/p&gt; &lt;/div&gt;  &lt;p&gt;&lt;/p&gt;  &lt;h3&gt;Cross Domain Calls&lt;/h3&gt;  &lt;p&gt;Since the Java service is probably hosted on another domain, calling it is considered as a cross domain access. I have posted about the &lt;a title="Silverlight WCF 404 HTTP" href="http://blogs.microsoft.co.il/blogs/bursteg/archive/2008/07/19/Silverlight-WCF-HTTP-404.aspx"&gt;HTTP 404 error when calling a service from a Silverlight Client across domains&lt;/a&gt;, and this solution applies here too.&lt;/p&gt;  &lt;p&gt;The thing is that since the &lt;strong&gt;Java EE&lt;/strong&gt; is hosted on another web server than IIS, you should place the &lt;strong&gt;clientaccesspolicy.xml&lt;/strong&gt; file on the root of your domain. On my machine, I have &lt;strong&gt;GlassFish V2&lt;/strong&gt; installed, and the file should be placed at: C:\Users\guyb\.personalDomain\personalDomain\docroot\ folder.&lt;/p&gt;  &lt;p&gt;Hope this helps!&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8754654" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/bursteg/archive/tags/WCF/default.aspx">WCF</category><category domain="http://blogs.msdn.com/bursteg/archive/tags/Silverlight/default.aspx">Silverlight</category><category domain="http://blogs.msdn.com/bursteg/archive/tags/Java/default.aspx">Java</category></item><item><title>How To: Call a Java EE Web Service from a .Net Client</title><link>http://blogs.msdn.com/bursteg/archive/2008/07/19/how-to-call-a-java-ee-web-service-from-a-net-client.aspx</link><pubDate>Sat, 19 Jul 2008 13:51:53 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8754541</guid><dc:creator>Guy Burstein</dc:creator><slash:comments>3</slash:comments><comments>http://blogs.msdn.com/bursteg/comments/8754541.aspx</comments><wfw:commentRss>http://blogs.msdn.com/bursteg/commentrss.aspx?PostID=8754541</wfw:commentRss><wfw:comment>http://blogs.msdn.com/bursteg/rsscomments.aspx?PostID=8754541</wfw:comment><description>&lt;h1&gt;How To: Call a Java EE Web Service from a .Net Client&lt;/h1&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;img title="Call a Java EE Web Service .Net Interoperability" style="margin: 10px 0px 20px 25px" height="48" alt="Call a Java EE Web Service .Net Interoperability" src="http://blogs.msdn.com/blogfiles/bursteg/WindowsLiveWriter/HowToCallaJavaEEWebServicefrom.NetClient_1138C/jee_a3a86867-dd00-496e-b6ef-ebed23e612d4.jpg" width="48" align="right" border="0" /&gt;Many organizations have server side investments in Java technologies. While they want to build a compelling UI with Microsoft’s latest technologies, such as WPF and Silverlight, they still want to benefit from those existing investments instead of rewriting them. In order to do so, we have to bridge between those technologies and allow client side technologies consume Java web services.&lt;/p&gt;  &lt;p&gt;This post is a step by step guide for building a Java EE Web Service, and a .Net client application that consumes it.&lt;/p&gt;   &lt;p&gt;&lt;/p&gt;  &lt;p&gt;Before we get started with this walkthrough, make sure you have the following installed on your machine:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://java.sun.com/javase/downloads/index.jsp"&gt;Java Development Kit (JDK) 6&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://java.sun.com/javase/downloads/index.jsp"&gt;Java EE 5 SDK&lt;/a&gt; &lt;/li&gt;    &lt;li&gt;&lt;a href="http://download.netbeans.org/netbeans/6.1/final/"&gt;NetBeans 6.1 IDE (Web &amp;amp; Java EE)&lt;/a&gt; &lt;/li&gt; &lt;/ul&gt;  &lt;h2&gt;Create a Java Web Service (Java EE, JAX-WS)&lt;/h2&gt;  &lt;h3&gt;1. Create a new Web Application&lt;/h3&gt;  &lt;p&gt;In the NetBeans 6.1 IDE, choose &lt;strong&gt;File&lt;/strong&gt; –&amp;gt; &lt;strong&gt;New Project&lt;/strong&gt;. In the New Project Dialog select the &lt;strong&gt;Web&lt;/strong&gt; category, and choose &lt;strong&gt;Web Application&lt;/strong&gt; from the projects list. Then, Click &lt;strong&gt;Next&lt;/strong&gt;.&lt;/p&gt;  &lt;p&gt;* If the web category is not available in this dialog, it means that the NetBeans version you have installed isn’t the Web and Java EE package.&lt;/p&gt;  &lt;p&gt;&lt;img title="Java EE Web Service .Net Client Interoperability" style="margin: 0px" height="370" alt="Java EE Web Service .Net Client Interoperability" src="http://blogs.msdn.com/blogfiles/bursteg/WindowsLiveWriter/HowToCallaJavaEEWebServicefrom.NetClient_1138C/image_00921b43-44c8-43e7-9954-721bb4a52316.png" width="540" border="0" /&gt; &lt;/p&gt;  &lt;p&gt;In the Name and Location page, set the &lt;strong&gt;location&lt;/strong&gt; where you want to create the web application, and provide a &lt;strong&gt;name&lt;/strong&gt; for the project. Click &lt;strong&gt;Next&lt;/strong&gt;.&lt;/p&gt;  &lt;p&gt;&lt;img title="Java EE Web Service .Net Client Interoperability" style="margin: 0px" height="334" alt="Java EE Web Service .Net Client Interoperability" src="http://blogs.msdn.com/blogfiles/bursteg/WindowsLiveWriter/HowToCallaJavaEEWebServicefrom.NetClient_1138C/image_2bb2efd0-0f14-4077-b31c-f64a16b85aef.png" width="540" border="0" /&gt; &lt;/p&gt;  &lt;p&gt;In the Server and Settings page, leave the default settings (Java EE 5, Use GlassFish V2) and Click &lt;strong&gt;Finish&lt;/strong&gt;.&lt;/p&gt;  &lt;p&gt;&lt;img title="Java EE Web Service .Net Client Interoperability" style="margin: 0px" height="334" alt="Java EE Web Service .Net Client Interoperability" src="http://blogs.msdn.com/blogfiles/bursteg/WindowsLiveWriter/HowToCallaJavaEEWebServicefrom.NetClient_1138C/image_1814c77f-f6ea-4930-be4f-42f742fb5531.png" width="540" border="0" /&gt; &lt;/p&gt;  &lt;p&gt;This creates the initial web application and opens the project for editing.&lt;/p&gt;  &lt;p&gt;&lt;img title="Java EE Web Service .Net Client Interoperability" style="margin: 0px" height="209" alt="Java EE Web Service .Net Client Interoperability" src="http://blogs.msdn.com/blogfiles/bursteg/WindowsLiveWriter/HowToCallaJavaEEWebServicefrom.NetClient_1138C/image_5d95082a-9b2f-435c-844e-7085e386dc88.png" width="153" border="0" /&gt; &lt;/p&gt;  &lt;h3&gt;2. Create the Web Service&lt;/h3&gt;  &lt;p&gt;Add a new web service to the project. &lt;strong&gt;Right click&lt;/strong&gt; the project node and choose &lt;strong&gt;New&lt;/strong&gt; –&amp;gt; &lt;strong&gt;Web Service&lt;/strong&gt;.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;img title="Java EE Web Service .Net Client Interoperability" style="margin: 0px" height="184" alt="Java EE Web Service .Net Client Interoperability" src="http://blogs.msdn.com/blogfiles/bursteg/WindowsLiveWriter/HowToCallaJavaEEWebServicefrom.NetClient_1138C/image_241fc9c1-3247-44ab-8c32-093ccdf7115b.png" width="604" border="0" /&gt; &lt;/p&gt;  &lt;p&gt;* Notice that the location of the Web Service option in the menu may change from this image and your IDE.&lt;/p&gt;  &lt;p&gt;In the New Web Service dialog, provide the &lt;strong&gt;Web Service Name&lt;/strong&gt;, and the &lt;strong&gt;Package&lt;/strong&gt;. The name of the service will affect the final URL for calling the service, and the package name will be the namespace of the service contract. Click &lt;strong&gt;Finish&lt;/strong&gt;.&lt;/p&gt;  &lt;p&gt;&lt;img title="Java EE Web Service .Net Client Interoperability" style="margin: 0px" height="403" alt="Java EE Web Service .Net Client Interoperability" src="http://blogs.msdn.com/blogfiles/bursteg/WindowsLiveWriter/HowToCallaJavaEEWebServicefrom.NetClient_1138C/image_65dcea9f-56c7-4a57-94c1-8378c0067a91.png" width="540" border="0" /&gt; &lt;/p&gt;  &lt;p&gt;The Web Service now appears in the project tree.&lt;/p&gt;  &lt;p&gt;&lt;img title="Java EE Web Service .Net Client Interoperability" style="margin: 0px" height="192" alt="Java EE Web Service .Net Client Interoperability" src="http://blogs.msdn.com/blogfiles/bursteg/WindowsLiveWriter/HowToCallaJavaEEWebServicefrom.NetClient_1138C/image_e21ceead-3b07-4f9d-b067-8359757c8f63.png" width="175" border="0" /&gt; &lt;/p&gt;  &lt;p&gt;To implement the service, double click the service node in the project tree (in the figure above – CalculatorService). This will open the Web Service in Design mode, that lets you graphically design your service.&lt;/p&gt;  &lt;p&gt;&lt;img title="Java EE Web Service .Net Client Interoperability" style="margin: 0px" height="314" alt="Java EE Web Service .Net Client Interoperability" src="http://blogs.msdn.com/blogfiles/bursteg/WindowsLiveWriter/HowToCallaJavaEEWebServicefrom.NetClient_1138C/image_65868a6a-936f-49eb-8c0f-42dd505963e9.png" width="606" border="0" /&gt; &lt;/p&gt;  &lt;p&gt;Change to &lt;strong&gt;Source View&lt;/strong&gt; by clicking on the &lt;strong&gt;Source&lt;/strong&gt; button in the upper toolbar, and this will open the CalculatorService.Java file for editing. Here is a sample implementation of the service. Notice how Java Annotations are similar to .Net Attributes, especially how similar they are to the Web Services attributes we know…&lt;/p&gt;  &lt;div style="font-size: 11pt; background: white; color: black; font-family: consolas"&gt;   &lt;p style="margin: 0px"&gt;package org.bursteg.calculator;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;import javax.jws.WebMethod;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;import javax.jws.WebParam;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;import javax.jws.WebService;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;@WebService&lt;/p&gt;    &lt;p style="margin: 0px"&gt;public class CalculatorService &lt;/p&gt;    &lt;p style="margin: 0px"&gt;{&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; @WebMethod&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; public int Add(@WebParam(name=&amp;quot;a&amp;quot;) int a, &lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; @WebParam(name=&amp;quot;b&amp;quot;) int b) &lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; return a + b;&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }&lt;/p&gt;    &lt;p style="margin: 0px"&gt;}&lt;/p&gt; &lt;/div&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;&lt;/p&gt;  &lt;p&gt;Deploy the web service to the web application server. From the NetBeans IDE this is done by &lt;strong&gt;right clicking&lt;/strong&gt; the project node, and choosing &lt;strong&gt;Undeploy and Deploy&lt;/strong&gt;.&lt;/p&gt;  &lt;p&gt;&lt;img title="Java EE Web Service .Net Client Interoperability" style="margin: 0px" height="281" alt="Java EE Web Service .Net Client Interoperability" src="http://blogs.msdn.com/blogfiles/bursteg/WindowsLiveWriter/HowToCallaJavaEEWebServicefrom.NetClient_1138C/image_d7967448-5b50-4d62-8f31-fc978b6e1933.png" width="329" border="0" /&gt; &lt;/p&gt;  &lt;p&gt;After the web application has been deployed, just to make sure the web service works as expected,&amp;#160; you can &lt;strong&gt;right click&lt;/strong&gt; the web service node, and choose &lt;strong&gt;Test Web Service&lt;/strong&gt;. &lt;/p&gt;  &lt;p&gt;&lt;img title="Java EE Web Service .Net Client Interoperability" style="margin: 0px" height="379" alt="Java EE Web Service .Net Client Interoperability" src="http://blogs.msdn.com/blogfiles/bursteg/WindowsLiveWriter/HowToCallaJavaEEWebServicefrom.NetClient_1138C/image_2c8cedcb-c60a-4550-afa9-58e091d5b0fc.png" width="403" border="0" /&gt; &lt;/p&gt;  &lt;p&gt;This will open the browser and navigate to a test page with the url of the service (&lt;a title="http://localhost:9232/Calculator/CalculatorServiceService" href="http://localhost:9232/Calculator/CalculatorServiceService"&gt;http://localhost:9232/Calculator/CalculatorServiceService&lt;/a&gt;) with a ?Tester suffix.&lt;/p&gt;  &lt;h2&gt;Call the Java Web Service from a .Net Client&lt;/h2&gt;  &lt;p&gt;In Visual Studio 2008, create a new console application.&lt;/p&gt;  &lt;p&gt;&lt;img title="Java EE Web Service .Net Client Interoperability" style="margin: 0px" height="344" alt="Java EE Web Service .Net Client Interoperability" src="http://blogs.msdn.com/blogfiles/bursteg/WindowsLiveWriter/HowToCallaJavaEEWebServicefrom.NetClient_1138C/image_b8c958f2-c672-4c84-a62c-a3a6c9de0da6.png" width="540" border="0" /&gt; &lt;/p&gt;  &lt;p&gt;This creates a new solution with a single Console Application project in it.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Right click&lt;/strong&gt; the project node and choose &lt;strong&gt;Add Service Reference&lt;/strong&gt;.&lt;/p&gt;  &lt;p&gt;&lt;img title="Java EE Web Service .Net Client Interoperability" style="margin: 0px" height="268" alt="Java EE Web Service .Net Client Interoperability" src="http://blogs.msdn.com/blogfiles/bursteg/WindowsLiveWriter/HowToCallaJavaEEWebServicefrom.NetClient_1138C/image_92498450-fd8f-4568-9191-2b7b974ed348.png" width="451" border="0" /&gt; &lt;/p&gt;  &lt;p&gt;In the Add Service Reference Dialog, paste the address of the service metadata endpoint (service address + ?wsdl suffix: &lt;a title="http://localhost:9232/Calculator/CalculatorServiceService?wsdl" href="http://localhost:9232/Calculator/CalculatorServiceService?wsdl"&gt;http://localhost:9232/Calculator/CalculatorServiceService?wsdl&lt;/a&gt;), and click&lt;strong&gt; Go&lt;/strong&gt;. The dialog will get the service metadata and understand the service contract.&lt;/p&gt;  &lt;p&gt;&lt;img title="Java EE Web Service .Net Client Interoperability" style="margin: 0px" height="435" alt="Java EE Web Service .Net Client Interoperability" src="http://blogs.msdn.com/blogfiles/bursteg/WindowsLiveWriter/HowToCallaJavaEEWebServicefrom.NetClient_1138C/image_71b74920-bf31-4aff-a377-9a1c8a20fb36.png" width="540" border="0" /&gt; &lt;/p&gt;  &lt;p&gt;Provide a &lt;strong&gt;namespace&lt;/strong&gt; for the service reference, and click &lt;strong&gt;OK&lt;/strong&gt;.&lt;/p&gt;  &lt;p&gt;This will generate the client side proxy that lets you consume the service easily, and the required configuration settings into the configuration file.&lt;/p&gt;  &lt;p&gt;&lt;img title="Java EE Web Service .Net Client Interoperability" style="margin: 0px" height="273" alt="Java EE Web Service .Net Client Interoperability" src="http://blogs.msdn.com/blogfiles/bursteg/WindowsLiveWriter/HowToCallaJavaEEWebServicefrom.NetClient_1138C/image_a57f2ea1-4133-4a36-b078-7e24c1aaa00f.png" width="287" border="0" /&gt; &lt;/p&gt;  &lt;p&gt;To call the service using the generated client side proxy, open Program.cs and use the following code:&lt;/p&gt;  &lt;div style="font-size: 11pt; background: white; color: black; font-family: consolas"&gt;   &lt;p style="margin: 0px"&gt;&lt;span style="color: blue"&gt;static&lt;/span&gt; &lt;span style="color: blue"&gt;void&lt;/span&gt; Main(&lt;span style="color: blue"&gt;string&lt;/span&gt;[] args)&lt;/p&gt;    &lt;p style="margin: 0px"&gt;{&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #2b91af"&gt;CalculatorServiceClient&lt;/span&gt; proxy = &lt;span style="color: blue"&gt;new&lt;/span&gt; &lt;span style="color: #2b91af"&gt;CalculatorServiceClient&lt;/span&gt;();&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;int&lt;/span&gt; result = proxy.Add(2, 3);&lt;/p&gt;    &lt;p style="margin: 0px"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: #2b91af"&gt;Console&lt;/span&gt;.WriteLine(&lt;span style="color: #a31515"&gt;&amp;quot;Calculator Service returned: &amp;quot;&lt;/span&gt; + result.ToString());&lt;/p&gt;    &lt;p style="margin: 0px"&gt;}&lt;/p&gt; &lt;/div&gt;  &lt;p&gt;Run the program and see that the web service is being called and the result is correct.&lt;/p&gt;  &lt;h2&gt;Conclusion&lt;/h2&gt;  &lt;p&gt;Since &lt;strong&gt;Java EE Web Services&lt;/strong&gt; (JAX-WS) are standard SOAP services, they are easily interoperable from a .Net client application with only several clicks. Visual Studio generated a &lt;strong&gt;.Net client proxy&lt;/strong&gt; that makes it very easy to connect and call the service.&lt;/p&gt;  &lt;p&gt;Enjoy!&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8754541" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/bursteg/archive/tags/.Net+Framework+3.5/default.aspx">.Net Framework 3.5</category><category domain="http://blogs.msdn.com/bursteg/archive/tags/WCF/default.aspx">WCF</category><category domain="http://blogs.msdn.com/bursteg/archive/tags/Java/default.aspx">Java</category></item></channel></rss>