C# client consuming a Java Axis (1.2RC2) web service

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jamie Phillips

    #1

    C# client consuming a Java Axis (1.2RC2) web service

    I'm sure this topic has been "around the block" a few times, but I have not
    been able to find ANY solutin that fits this particular problem. I have
    written a Java Axis web service that has a method which returns an object
    with the following characteristics :

    public class MMPerson {
    public string firstName;
    public string surname;
    public int age;
    public MMAddress address;
    }

    public class MMAddress {
    public string street;
    public string city;
    public string state;
    public string country;
    public string postcode;
    }

    The method is called and via SOAPMonitor (utility to trace the SOAP messages
    from server to client) I can see that the Request and Response messages are
    fine and dandy:

    Request:
    --------
    <?xml version="1.0" encoding="utf-8"?>
    <soap:Envelop e xmlns:soap="htt p://schemas.xmlsoap .org/soap/envelope/"
    xmlns:xsi="http ://www.w3.org/2001/XMLSchema-instance"
    xmlns:xsd="http ://www.w3.org/2001/XMLSchema">
    <soap:Body>
    <test_Person
    xmlns="http://localhost:8080/axis/services/MarketManagerWe bService">
    <Username>guest </Username>
    </test_Person>
    </soap:Body>
    </soap:Envelope>

    Response:
    ---------
    <soapenv:Envelo pe xmlns:soapenv=" http://schemas.xmlsoap .org/soap/envelope/"
    xmlns:xsd="http ://www.w3.org/2001/XMLSchema"
    xmlns:xsi="http ://www.w3.org/2001/XMLSchema-instance">
    <soapenv:Body >
    <test_PersonRes ponse
    xmlns="http://localhost:8080/axis/services/MarketManagerWe bService">
    <test_PersonRet urn>
    <firstName>John </firstName>
    <surname>Doe</surname>
    <age>26</age>
    <address>
    <street>51 New Street</street>
    <city>London</city>
    <state>N/A</state>
    <country>UK</country>
    <postCode>SW1 5XZ</postCode>
    </address>
    </test_PersonRetu rn>
    </test_PersonResp onse>
    </soapenv:Body>
    </soapenv:Envelop e>

    Unfortunately, when the proxy instantiates the relevant class in c#, all of
    the parameters (member variables) are un-initialised...

    oPerson.firstNa me = null
    oPerson.surname = null
    oPerson.age = 0
    oPerson.address = null

    I will provide the relevant proxy code (Autogenerated by the reference to
    the WSDL) OR the WSDL to whoever thinks that they can help me out.
    --
    Kind regards,

    Jamie
  • Dilip Krishnan

    #2
    Re: C# client consuming a Java Axis (1.2RC2) web service

    Jamie,
    Check if the namespace in the c# proxy uses the same namespace [0]
    as the mesage coming in.

    [0] - http://localhost:8080/axis/services/...agerWebService

    Jamie Phillips wrote:[color=blue]
    > I'm sure this topic has been "around the block" a few times, but I have not
    > been able to find ANY solutin that fits this particular problem. I have
    > written a Java Axis web service that has a method which returns an object
    > with the following characteristics :
    >
    > public class MMPerson {
    > public string firstName;
    > public string surname;
    > public int age;
    > public MMAddress address;
    > }
    >
    > public class MMAddress {
    > public string street;
    > public string city;
    > public string state;
    > public string country;
    > public string postcode;
    > }
    >
    > The method is called and via SOAPMonitor (utility to trace the SOAP messages
    > from server to client) I can see that the Request and Response messages are
    > fine and dandy:
    >
    > Request:
    > --------
    > <?xml version="1.0" encoding="utf-8"?>
    > <soap:Envelop e xmlns:soap="htt p://schemas.xmlsoap .org/soap/envelope/"
    > xmlns:xsi="http ://www.w3.org/2001/XMLSchema-instance"
    > xmlns:xsd="http ://www.w3.org/2001/XMLSchema">
    > <soap:Body>
    > <test_Person
    > xmlns="http://localhost:8080/axis/services/MarketManagerWe bService">
    > <Username>guest </Username>
    > </test_Person>
    > </soap:Body>
    > </soap:Envelope>
    >
    > Response:
    > ---------
    > <soapenv:Envelo pe xmlns:soapenv=" http://schemas.xmlsoap .org/soap/envelope/"
    > xmlns:xsd="http ://www.w3.org/2001/XMLSchema"
    > xmlns:xsi="http ://www.w3.org/2001/XMLSchema-instance">
    > <soapenv:Body >
    > <test_PersonRes ponse
    > xmlns="http://localhost:8080/axis/services/MarketManagerWe bService">
    > <test_PersonRet urn>
    > <firstName>John </firstName>
    > <surname>Doe</surname>
    > <age>26</age>
    > <address>
    > <street>51 New Street</street>
    > <city>London</city>
    > <state>N/A</state>
    > <country>UK</country>
    > <postCode>SW1 5XZ</postCode>
    > </address>
    > </test_PersonRetu rn>
    > </test_PersonResp onse>
    > </soapenv:Body>
    > </soapenv:Envelop e>
    >
    > Unfortunately, when the proxy instantiates the relevant class in c#, all of
    > the parameters (member variables) are un-initialised...
    >
    > oPerson.firstNa me = null
    > oPerson.surname = null
    > oPerson.age = 0
    > oPerson.address = null
    >
    > I will provide the relevant proxy code (Autogenerated by the reference to
    > the WSDL) OR the WSDL to whoever thinks that they can help me out.[/color]

    --
    HTH
    Regards,
    Dilip Krishnan
    MCAD, MCSD.net
    dkrishnan at geniant dot com
    Experience is the advantage. AI is the multiplier.

    Comment

    • Jamie Phillips

      #3
      Re: C# client consuming a Java Axis (1.2RC2) web service

      Dilip,

      Everything appears to be fine in the c# proxy ie the namespace is the same
      as the message coming in :-(

      Kind regards,

      Jamie

      "Dilip Krishnan" wrote:
      [color=blue]
      > Jamie,
      > Check if the namespace in the c# proxy uses the same namespace [0]
      > as the mesage coming in.
      >
      > [0] - http://localhost:8080/axis/services/...agerWebService
      >
      > Jamie Phillips wrote:[color=green]
      > > I'm sure this topic has been "around the block" a few times, but I have not
      > > been able to find ANY solutin that fits this particular problem. I have
      > > written a Java Axis web service that has a method which returns an object
      > > with the following characteristics :
      > >
      > > public class MMPerson {
      > > public string firstName;
      > > public string surname;
      > > public int age;
      > > public MMAddress address;
      > > }
      > >
      > > public class MMAddress {
      > > public string street;
      > > public string city;
      > > public string state;
      > > public string country;
      > > public string postcode;
      > > }
      > >
      > > The method is called and via SOAPMonitor (utility to trace the SOAP messages
      > > from server to client) I can see that the Request and Response messages are
      > > fine and dandy:
      > >
      > > Request:
      > > --------
      > > <?xml version="1.0" encoding="utf-8"?>
      > > <soap:Envelop e xmlns:soap="htt p://schemas.xmlsoap .org/soap/envelope/"
      > > xmlns:xsi="http ://www.w3.org/2001/XMLSchema-instance"
      > > xmlns:xsd="http ://www.w3.org/2001/XMLSchema">
      > > <soap:Body>
      > > <test_Person
      > > xmlns="http://localhost:8080/axis/services/MarketManagerWe bService">
      > > <Username>guest </Username>
      > > </test_Person>
      > > </soap:Body>
      > > </soap:Envelope>
      > >
      > > Response:
      > > ---------
      > > <soapenv:Envelo pe xmlns:soapenv=" http://schemas.xmlsoap .org/soap/envelope/"
      > > xmlns:xsd="http ://www.w3.org/2001/XMLSchema"
      > > xmlns:xsi="http ://www.w3.org/2001/XMLSchema-instance">
      > > <soapenv:Body >
      > > <test_PersonRes ponse
      > > xmlns="http://localhost:8080/axis/services/MarketManagerWe bService">
      > > <test_PersonRet urn>
      > > <firstName>John </firstName>
      > > <surname>Doe</surname>
      > > <age>26</age>
      > > <address>
      > > <street>51 New Street</street>
      > > <city>London</city>
      > > <state>N/A</state>
      > > <country>UK</country>
      > > <postCode>SW1 5XZ</postCode>
      > > </address>
      > > </test_PersonRetu rn>
      > > </test_PersonResp onse>
      > > </soapenv:Body>
      > > </soapenv:Envelop e>
      > >
      > > Unfortunately, when the proxy instantiates the relevant class in c#, all of
      > > the parameters (member variables) are un-initialised...
      > >
      > > oPerson.firstNa me = null
      > > oPerson.surname = null
      > > oPerson.age = 0
      > > oPerson.address = null
      > >
      > > I will provide the relevant proxy code (Autogenerated by the reference to
      > > the WSDL) OR the WSDL to whoever thinks that they can help me out.[/color]
      >
      > --
      > HTH
      > Regards,
      > Dilip Krishnan
      > MCAD, MCSD.net
      > dkrishnan at geniant dot com
      > http://www.geniant.com
      >[/color]

      Comment

      • Dino Chiesa [Microsoft]

        #4
        Re: C# client consuming a Java Axis (1.2RC2) web service

        Best way to get interop is to start with thw WSDL, and generate the server
        and client-side stubs from that.

        Usually it's necessary to see the WSDL to figure out interop problems.

        -D


        "Jamie Phillips" <JamiePhillips@ discussions.mic rosoft.com> wrote in message
        news:5F8D4283-B6D3-42F2-9AE4-94C2B9B24593@mi crosoft.com...[color=blue]
        > Dilip,
        >
        > Everything appears to be fine in the c# proxy ie the namespace is the same
        > as the message coming in :-(
        >
        > Kind regards,
        >
        > Jamie
        >
        > "Dilip Krishnan" wrote:
        >[color=green]
        >> Jamie,
        >> Check if the namespace in the c# proxy uses the same namespace [0]
        >> as the mesage coming in.
        >>
        >> [0] - http://localhost:8080/axis/services/...agerWebService
        >>
        >> Jamie Phillips wrote:[color=darkred]
        >> > I'm sure this topic has been "around the block" a few times, but I have
        >> > not
        >> > been able to find ANY solutin that fits this particular problem. I have
        >> > written a Java Axis web service that has a method which returns an
        >> > object
        >> > with the following characteristics :
        >> >
        >> > public class MMPerson {
        >> > public string firstName;
        >> > public string surname;
        >> > public int age;
        >> > public MMAddress address;
        >> > }
        >> >
        >> > public class MMAddress {
        >> > public string street;
        >> > public string city;
        >> > public string state;
        >> > public string country;
        >> > public string postcode;
        >> > }
        >> >
        >> > The method is called and via SOAPMonitor (utility to trace the SOAP
        >> > messages
        >> > from server to client) I can see that the Request and Response messages
        >> > are
        >> > fine and dandy:
        >> >
        >> > Request:
        >> > --------
        >> > <?xml version="1.0" encoding="utf-8"?>
        >> > <soap:Envelop e xmlns:soap="htt p://schemas.xmlsoap .org/soap/envelope/"
        >> > xmlns:xsi="http ://www.w3.org/2001/XMLSchema-instance"
        >> > xmlns:xsd="http ://www.w3.org/2001/XMLSchema">
        >> > <soap:Body>
        >> > <test_Person
        >> > xmlns="http://localhost:8080/axis/services/MarketManagerWe bService">
        >> > <Username>guest </Username>
        >> > </test_Person>
        >> > </soap:Body>
        >> > </soap:Envelope>
        >> >
        >> > Response:
        >> > ---------
        >> > <soapenv:Envelo pe
        >> > xmlns:soapenv=" http://schemas.xmlsoap .org/soap/envelope/"
        >> > xmlns:xsd="http ://www.w3.org/2001/XMLSchema"
        >> > xmlns:xsi="http ://www.w3.org/2001/XMLSchema-instance">
        >> > <soapenv:Body >
        >> > <test_PersonRes ponse
        >> > xmlns="http://localhost:8080/axis/services/MarketManagerWe bService">
        >> > <test_PersonRet urn>
        >> > <firstName>John </firstName>
        >> > <surname>Doe</surname>
        >> > <age>26</age>
        >> > <address>
        >> > <street>51 New Street</street>
        >> > <city>London</city>
        >> > <state>N/A</state>
        >> > <country>UK</country>
        >> > <postCode>SW1 5XZ</postCode>
        >> > </address>
        >> > </test_PersonRetu rn>
        >> > </test_PersonResp onse>
        >> > </soapenv:Body>
        >> > </soapenv:Envelop e>
        >> >
        >> > Unfortunately, when the proxy instantiates the relevant class in c#,
        >> > all of
        >> > the parameters (member variables) are un-initialised...
        >> >
        >> > oPerson.firstNa me = null
        >> > oPerson.surname = null
        >> > oPerson.age = 0
        >> > oPerson.address = null
        >> >
        >> > I will provide the relevant proxy code (Autogenerated by the reference
        >> > to
        >> > the WSDL) OR the WSDL to whoever thinks that they can help me out.[/color]
        >>
        >> --
        >> HTH
        >> Regards,
        >> Dilip Krishnan
        >> MCAD, MCSD.net
        >> dkrishnan at geniant dot com
        >> http://www.geniant.com
        >>[/color][/color]


        Comment

        • Jamie Phillips

          #5
          Re: C# client consuming a Java Axis (1.2RC2) web service

          Hi Dino,

          Unfortunately in the final version of the client I will not have any
          influence on the Java web service, hence why I was writing the server client
          in this manner.

          As I stated in the original post, I will supply the WSDL to whoever thinks
          they can give me a helping hand, simply so as not to fill this thread up with
          so much text :-D


          "Dino Chiesa [Microsoft]" wrote:
          [color=blue]
          > Best way to get interop is to start with thw WSDL, and generate the server
          > and client-side stubs from that.
          >
          > Usually it's necessary to see the WSDL to figure out interop problems.
          >
          > -D
          >
          >
          > "Jamie Phillips" <JamiePhillips@ discussions.mic rosoft.com> wrote in message
          > news:5F8D4283-B6D3-42F2-9AE4-94C2B9B24593@mi crosoft.com...[color=green]
          > > Dilip,
          > >
          > > Everything appears to be fine in the c# proxy ie the namespace is the same
          > > as the message coming in :-(
          > >
          > > Kind regards,
          > >
          > > Jamie
          > >
          > > "Dilip Krishnan" wrote:
          > >[color=darkred]
          > >> Jamie,
          > >> Check if the namespace in the c# proxy uses the same namespace [0]
          > >> as the mesage coming in.
          > >>
          > >> [0] - http://localhost:8080/axis/services/...agerWebService
          > >>
          > >> Jamie Phillips wrote:
          > >> > I'm sure this topic has been "around the block" a few times, but I have
          > >> > not
          > >> > been able to find ANY solutin that fits this particular problem. I have
          > >> > written a Java Axis web service that has a method which returns an
          > >> > object
          > >> > with the following characteristics :
          > >> >
          > >> > public class MMPerson {
          > >> > public string firstName;
          > >> > public string surname;
          > >> > public int age;
          > >> > public MMAddress address;
          > >> > }
          > >> >
          > >> > public class MMAddress {
          > >> > public string street;
          > >> > public string city;
          > >> > public string state;
          > >> > public string country;
          > >> > public string postcode;
          > >> > }
          > >> >
          > >> > The method is called and via SOAPMonitor (utility to trace the SOAP
          > >> > messages
          > >> > from server to client) I can see that the Request and Response messages
          > >> > are
          > >> > fine and dandy:
          > >> >
          > >> > Request:
          > >> > --------
          > >> > <?xml version="1.0" encoding="utf-8"?>
          > >> > <soap:Envelop e xmlns:soap="htt p://schemas.xmlsoap .org/soap/envelope/"
          > >> > xmlns:xsi="http ://www.w3.org/2001/XMLSchema-instance"
          > >> > xmlns:xsd="http ://www.w3.org/2001/XMLSchema">
          > >> > <soap:Body>
          > >> > <test_Person
          > >> > xmlns="http://localhost:8080/axis/services/MarketManagerWe bService">
          > >> > <Username>guest </Username>
          > >> > </test_Person>
          > >> > </soap:Body>
          > >> > </soap:Envelope>
          > >> >
          > >> > Response:
          > >> > ---------
          > >> > <soapenv:Envelo pe
          > >> > xmlns:soapenv=" http://schemas.xmlsoap .org/soap/envelope/"
          > >> > xmlns:xsd="http ://www.w3.org/2001/XMLSchema"
          > >> > xmlns:xsi="http ://www.w3.org/2001/XMLSchema-instance">
          > >> > <soapenv:Body >
          > >> > <test_PersonRes ponse
          > >> > xmlns="http://localhost:8080/axis/services/MarketManagerWe bService">
          > >> > <test_PersonRet urn>
          > >> > <firstName>John </firstName>
          > >> > <surname>Doe</surname>
          > >> > <age>26</age>
          > >> > <address>
          > >> > <street>51 New Street</street>
          > >> > <city>London</city>
          > >> > <state>N/A</state>
          > >> > <country>UK</country>
          > >> > <postCode>SW1 5XZ</postCode>
          > >> > </address>
          > >> > </test_PersonRetu rn>
          > >> > </test_PersonResp onse>
          > >> > </soapenv:Body>
          > >> > </soapenv:Envelop e>
          > >> >
          > >> > Unfortunately, when the proxy instantiates the relevant class in c#,
          > >> > all of
          > >> > the parameters (member variables) are un-initialised...
          > >> >
          > >> > oPerson.firstNa me = null
          > >> > oPerson.surname = null
          > >> > oPerson.age = 0
          > >> > oPerson.address = null
          > >> >
          > >> > I will provide the relevant proxy code (Autogenerated by the reference
          > >> > to
          > >> > the WSDL) OR the WSDL to whoever thinks that they can help me out.
          > >>
          > >> --
          > >> HTH
          > >> Regards,
          > >> Dilip Krishnan
          > >> MCAD, MCSD.net
          > >> dkrishnan at geniant dot com
          > >> http://www.geniant.com
          > >>[/color][/color]
          >
          >
          >[/color]

          Comment

          • singhalkapil

            #6
            Re: C# client consuming a Java Axis (1.2RC2) web service


            hello
            I m creating a C# client that connects to Java Web Service for
            accessing events using Systinet Web Server.
            The connection to the service is done but it does not get the events
            from the service.
            secondly it is very inconsisitent. it runs once n then keep on showing
            exception. the complete stack trace is here:
            Connecting EventService...
            Connected: SampleClient.Ev entService.Even tService
            Subscribing...
            System.Net.WebE xception: The underlying connection was closed: The
            proxy name could not be resolved, verify correct proxy configuration.
            at System.Net.Http WebRequest.Chec kFinalStatus()
            at System.Net.Http WebRequest.EndG etRequestStream (IAsyncResult
            asyncResult)
            at System.Net.Http WebRequest.GetR equestStream()
            at
            System.Web.Serv ices.Protocols. SoapHttpClientP rotocol.Invoke( String
            methodName, Object[] parameters)
            at SampleClient.Ev entService.Even tService.subscr ibe(String p0) in
            D:\Users\KASI\S andboxes\Compos e_ScenarioMgt\S ubsystems\Scena rioMgt\C#\Sampl eClient\Web
            References\Even tService\Refere nce.cs:line 121
            at AppMain.testEve ntService() in
            d:\users\kasi\s andboxes\compos e_scenariomgt\s ubsystems\scena riomgt\c#\sampl eclient\appmain .cs:line
            34
            System.Net.WebE xception: The underlying connection was closed: The
            proxy name could not be resolved, verify correct proxy configuration.
            at System.Net.Http WebRequest.Chec kFinalStatus()
            at System.Net.Http WebRequest.EndG etRequestStream (IAsyncResult
            asyncResult)
            at System.Net.Http WebRequest.GetR equestStream()
            at
            System.Web.Serv ices.Protocols. SoapHttpClientP rotocol.Invoke( String
            methodName, Object[] parameters)
            at SampleClient.Ev entService.Even tService.getNex tEvent() in
            D:\Users\KASI\S andboxes\Compos e_ScenarioMgt\S ubsystems\Scena rioMgt\C#\Sampl eClient\Web
            References\Even tService\Refere nce.cs:line 68
            at AppMain.testEve ntService() in
            d:\users\kasi\s andboxes\compos e_scenariomgt\s ubsystems\scena riomgt\c#\sampl eclient\appmain .cs:line
            58
            The program '[1744] SampleClient.ex e' has exited with code 0 (0x0).

            Regards,
            Kapil



            --
            singhalkapil
            ------------------------------------------------------------------------
            Posted via http://www.mcse.ms
            ------------------------------------------------------------------------
            View this thread: http://www.mcse.ms/message1448629.html

            Comment

            • zmbharmal
              New Member
              • Jul 2006
              • 4

              #7
              Did you find a solution to the problem of a .NET client not been able to access a Axis/Java web service. I am also getting NULL in the response though the Java webservice is returning the correct object. I am writing the .NET client

              Comment

              • zmbharmal
                New Member
                • Jul 2006
                • 4

                #8
                Did you find a solution to the problem of a .NET client not been able to access a Axis/Java web service. I am also getting NULL in the response though the Java webservice is returning the correct object. I am writing the .NET client

                My email ID is zmbharmal@hotma il.com
                My desk # in USA is 214 540 8970 extn 175.

                Comment

                Working...