Click here to Skip to main content
16,005,094 members
Home / Discussions / C#
   

C#

 
AnswerRe: web application Pin
jdkulkarni16-Jan-07 22:44
jdkulkarni16-Jan-07 22:44 
QuestionFile Attributes questions Pin
Planker16-Jan-07 19:10
Planker16-Jan-07 19:10 
Questionvisual studio can not start debugging Pin
chintan1816-Jan-07 18:53
chintan1816-Jan-07 18:53 
AnswerRe: visual studio can not start debugging Pin
Christian Graus16-Jan-07 19:26
protectorChristian Graus16-Jan-07 19:26 
AnswerRe: visual studio can not start debugging Pin
Seishin#16-Jan-07 22:56
Seishin#16-Jan-07 22:56 
QuestionWCF Service and JAVA client Pin
jdkulkarni16-Jan-07 18:34
jdkulkarni16-Jan-07 18:34 
AnswerRe: WCF Service and JAVA client Pin
KevinMac16-Jan-07 18:45
KevinMac16-Jan-07 18:45 
GeneralRe: WCF Service and JAVA client Pin
jdkulkarni16-Jan-07 18:52
jdkulkarni16-Jan-07 18:52 
Thanks for the quick reply Kevin.
Here is my code.
My Service Contract looks like this.
<br />
using System;<br />
using System.Collections.Generic;<br />
using System.Text;<br />
using System.ServiceModel;<br />
using System.Data;<br />
<br />
namespace WCFService<br />
{<br />
    [ServiceContract]    <br />
    public interface IWCFService<br />
    {<br />
        [OperationContract]<br />
        string GetSystemIPAddress();<br />
        <br />
        [OperationContract]<br />
        object[] GetEmpolyeeArray();<br />
    }<br />
}<br />

The class implementing the service contract looks like this.
<br />
using System;<br />
using System.Collections.Generic;<br />
using System.Text;<br />
using SystemInfo;<br />
using System.Data;<br />
using System.ServiceModel;<br />
<br />
namespace WCFService<br />
{<br />
    [ServiceBehavior(IncludeExceptionDetailInFaults = true)]<br />
    public class WCFService : IWCFService<br />
    {<br />
        #region IWCFService Members<br />
<br />
        public string GetSystemIPAddress()<br />
        {<br />
            return new SystemInfo.SystemInfo().GetIPAddress();<br />
        }<br />
        <br />
        public object[] GetEmpolyeeArray()<br />
        {<br />
            DataSet ds = new SystemInfo.SystemInfo().GetEmployeeList();<br />
            Employee[] emps = new Employee[ds.Tables[0].Rows.Count];<br />
            int index = 0;<br />
            foreach (DataRow row in ds.Tables[0].Rows)<br />
            {<br />
                emps[index] = new Employee();<br />
                emps[index].EmployeeID = Convert.ToInt32(row["EmployeeNo"]);<br />
                emps[index].Experience = Convert.ToDecimal(row["Experience"]);<br />
                emps[index].FirstName = row["FirstName"].ToString();<br />
                emps[index].LastName = row["LastName"].ToString();<br />
                emps[index].MiddleName = row["MiddleName"].ToString();<br />
                emps[index].Qualification = row["Qualification"].ToString();<br />
                index++;                <br />
            }<br />
            return emps;<br />
        }<br />
        #endregion<br />
    }<br />
}<br />


My DataContract is this
<br />
using System;<br />
using System.Collections.Generic;<br />
using System.Text;<br />
using System.ServiceModel;<br />
using System.Runtime.Serialization;<br />
<br />
namespace WCFService<br />
{<br />
    [DataContract]<br />
    public class Employee<br />
    {<br />
        [DataMember]<br />
        public int EmployeeID;<br />
        [DataMember]<br />
        public string FirstName;<br />
        [DataMember]<br />
        public string MiddleName;<br />
        [DataMember]<br />
        public string LastName;<br />
        [DataMember]<br />
        public decimal Experience;<br />
        [DataMember]<br />
        public string Qualification;<br />
    }<br />
}<br />


My Java client is like this:
<br />
package wcfjavaclient;<br />
<br />
/**<br />
 *<br />
 * @author jkulkarni<br />
 */<br />
public class Main {<br />
    <br />
    /** Creates a new instance of Main */<br />
    public Main() {<br />
    }<br />
    <br />
    /**<br />
     * @param args the command line arguments<br />
     */<br />
    public static void main(String[] args) {<br />
        try { // Call Web Service Operation<br />
            WS.WCFService service = new WS.WCFService();<br />
            WS.IWCFService port = service.getBasicHttpBindingIWCFService();<br />
            // TODO process result here<br />
            java.lang.String result = port.getSystemIPAddress();<br />
            System.out.println("Result = "+result);<br />
        } catch (Exception ex) {<br />
            // TODO handle custom exceptions here<br />
        }        <br />
    }    <br />
}<br />

Please let me know if you want to see anything more. First method GetSystemIP works fine. But second one does not.

Jayant D. Kulkarni
Brainbench Certified Software Engineer in C#, ASP.NET, .NET Framework and ADO.NET

GeneralRe: WCF Service and JAVA client Pin
KevinMac16-Jan-07 19:59
KevinMac16-Jan-07 19:59 
GeneralRe: WCF Service and JAVA client Pin
jdkulkarni16-Jan-07 20:31
jdkulkarni16-Jan-07 20:31 
GeneralRe: WCF Service and JAVA client Pin
jdkulkarni16-Jan-07 22:42
jdkulkarni16-Jan-07 22:42 
QuestionOpenFileDailogBox Pin
indiaone16-Jan-07 18:28
indiaone16-Jan-07 18:28 
AnswerRe: OpenFileDailogBox Pin
Flysocket16-Jan-07 18:33
Flysocket16-Jan-07 18:33 
GeneralRe: OpenFileDailogBox Pin
indiaone17-Jan-07 18:51
indiaone17-Jan-07 18:51 
AnswerRe: OpenFileDailogBox Pin
Christian Graus16-Jan-07 19:26
protectorChristian Graus16-Jan-07 19:26 
GeneralRe: OpenFileDailogBox Pin
indiaone16-Jan-07 21:34
indiaone16-Jan-07 21:34 
GeneralRe: OpenFileDailogBox Pin
Christian Graus16-Jan-07 23:52
protectorChristian Graus16-Jan-07 23:52 
QuestionUDP send file issue Pin
Flysocket16-Jan-07 18:25
Flysocket16-Jan-07 18:25 
AnswerRe: UDP send file issue Pin
raju_net181816-Jan-07 19:33
raju_net181816-Jan-07 19:33 
QuestionRegarding focus setting on a drop down in C#! Pin
Mirunab16-Jan-07 17:39
Mirunab16-Jan-07 17:39 
AnswerRe: Regarding focus setting on a drop down in C#! Pin
Christian Graus16-Jan-07 19:28
protectorChristian Graus16-Jan-07 19:28 
QuestionReverse Engineer / view C# / .NET code? Pin
JoeRip16-Jan-07 16:33
JoeRip16-Jan-07 16:33 
AnswerRe: Reverse Engineer / view C# / .NET code? Pin
Christian Graus16-Jan-07 16:53
protectorChristian Graus16-Jan-07 16:53 
QuestionC# on Linux Pin
loscarlitos16-Jan-07 14:32
loscarlitos16-Jan-07 14:32 
AnswerRe: C# on Linux Pin
Christian Graus16-Jan-07 14:57
protectorChristian Graus16-Jan-07 14:57 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.