.NET/JAVA Interoperability

Discussion in 'ASP .Net Web Services' started by arun_005, Dec 3, 2003.

  1. arun_005

    arun_005 Guest

    Hi,
    I'm facing some problem with respect to .NET client invoking a Java
    WebService.
    I'm able to access a Java WebService, whose binding is RPC/Encoded.But
    the same
    WebService when deployed using Document/Literal gives a problem.

    Please find below my problem:
    I have a method being exposed in Java WebService by name callMethod()
    that returns a string.
    The proxy generated for this method using wsdl.exe is as follows:
    -----------------------------------------------------------------------
    [System.Web.Services.Protocols.SoapDocumentMethodAttribute("",
    Use=System.Web.Services.Description.SoapBindingUse.Literal,
    ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Bare)]
    [return: System.Xml.Serialization.XmlElementAttribute("callMethodResponse",
    Namespace="http://arun:8080/Training/services/Sample11")]
    public callMethodResponse callMethod()
    {
    object[] results = this.Invoke("callMethod", new object[0]);
    return ((callMethodResponse)(results[0]));
    }
    -----------------------------------------------------------------------

    I invoke the method from C# using the following syntax:
    -------------------------------------
    Sample11 obj = new Sample11();
    callMethodResponse objRes;
    objRes = obj.callMethod();
    string str;
    str = objRes.callMethodReturn;
    -------------------------------------

    Initially I recieved an error saying "java.lang.exception:Body not
    found".
    I could set this right by changing the SoapParameterStyle in
    SoapDocumentMethodAttribute
    from SoapParameterStyle.Bare to SoapParameterStyle.Wrapped.

    Now objRes has a null value.I'm not able to receive the simple string
    "Hello", which I'm returning
    from the Java WebService.

    Thanks,
    Arun.
     
    arun_005, Dec 3, 2003
    #1
    1. Advertising

  2. did you use proxytrace to view the outgoing and incoming traffic ?


    "arun_005" <> wrote in message
    news:...
    > Hi,
    > I'm facing some problem with respect to .NET client invoking a Java
    > WebService.
    > I'm able to access a Java WebService, whose binding is RPC/Encoded.But
    > the same
    > WebService when deployed using Document/Literal gives a problem.
    >
    > Please find below my problem:
    > I have a method being exposed in Java WebService by name callMethod()
    > that returns a string.
    > The proxy generated for this method using wsdl.exe is as follows:
    > -----------------------------------------------------------------------
    > [System.Web.Services.Protocols.SoapDocumentMethodAttribute("",
    > Use=System.Web.Services.Description.SoapBindingUse.Literal,
    > ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Bare)]
    > [return:

    System.Xml.Serialization.XmlElementAttribute("callMethodResponse",
    > Namespace="http://arun:8080/Training/services/Sample11")]
    > public callMethodResponse callMethod()
    > {
    > object[] results = this.Invoke("callMethod", new object[0]);
    > return ((callMethodResponse)(results[0]));
    > }
    > -----------------------------------------------------------------------
    >
    > I invoke the method from C# using the following syntax:
    > -------------------------------------
    > Sample11 obj = new Sample11();
    > callMethodResponse objRes;
    > objRes = obj.callMethod();
    > string str;
    > str = objRes.callMethodReturn;
    > -------------------------------------
    >
    > Initially I recieved an error saying "java.lang.exception:Body not
    > found".
    > I could set this right by changing the SoapParameterStyle in
    > SoapDocumentMethodAttribute
    > from SoapParameterStyle.Bare to SoapParameterStyle.Wrapped.
    >
    > Now objRes has a null value.I'm not able to receive the simple string
    > "Hello", which I'm returning
    > from the Java WebService.
    >
    > Thanks,
    > Arun.
     
    Dino Chiesa [Microsoft], Dec 8, 2003
    #2
    1. Advertising

  3. arun_005

    arun_005 Guest

    Hi Dino Chiesa,
    Thanks for replying.I have NOT used proxytrace.I've even appended the
    port number 8080 to the URL in the proxy class file.But the same
    webservice works with RPC/Encoded, but gives a problem in
    DOCUMENT/LITERAL.

    Please Help!

    Arun.

    "Dino Chiesa [Microsoft]" <> wrote in message news:<>...
    > did you use proxytrace to view the outgoing and incoming traffic ?
    >
    >
    > "arun_005" <> wrote in message
    > news:...
    > > Hi,
    > > I'm facing some problem with respect to .NET client invoking a Java
    > > WebService.
    > > I'm able to access a Java WebService, whose binding is RPC/Encoded.But
    > > the same
    > > WebService when deployed using Document/Literal gives a problem.
    > >
    > > Please find below my problem:
    > > I have a method being exposed in Java WebService by name callMethod()
    > > that returns a string.
    > > The proxy generated for this method using wsdl.exe is as follows:
    > > -----------------------------------------------------------------------
    > > [System.Web.Services.Protocols.SoapDocumentMethodAttribute("",
    > > Use=System.Web.Services.Description.SoapBindingUse.Literal,
    > > ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Bare)]
    > > [return:

    > System.Xml.Serialization.XmlElementAttribute("callMethodResponse",
    > > Namespace="http://arun:8080/Training/services/Sample11")]
    > > public callMethodResponse callMethod()
    > > {
    > > object[] results = this.Invoke("callMethod", new object[0]);
    > > return ((callMethodResponse)(results[0]));
    > > }
    > > -----------------------------------------------------------------------
    > >
    > > I invoke the method from C# using the following syntax:
    > > -------------------------------------
    > > Sample11 obj = new Sample11();
    > > callMethodResponse objRes;
    > > objRes = obj.callMethod();
    > > string str;
    > > str = objRes.callMethodReturn;
    > > -------------------------------------
    > >
    > > Initially I recieved an error saying "java.lang.exception:Body not
    > > found".
    > > I could set this right by changing the SoapParameterStyle in
    > > SoapDocumentMethodAttribute
    > > from SoapParameterStyle.Bare to SoapParameterStyle.Wrapped.
    > >
    > > Now objRes has a null value.I'm not able to receive the simple string
    > > "Hello", which I'm returning
    > > from the Java WebService.
    > >
    > > Thanks,
    > > Arun.
     
    arun_005, Dec 9, 2003
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. arun_005

    .NET/JAVA Interoperability

    arun_005, Dec 3, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    369
    arun_005
    Dec 3, 2003
  2. Replies:
    0
    Views:
    414
  3. j-integra
    Replies:
    0
    Views:
    465
    j-integra
    Jul 13, 2005
  4. Replies:
    0
    Views:
    376
  5. Replies:
    0
    Views:
    325
Loading...

Share This Page