aspose file tools*
The moose likes Web Services and the fly likes .Net Client for Axis Web services Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark ".Net Client for Axis Web services" Watch ".Net Client for Axis Web services" New topic
Author

.Net Client for Axis Web services

Lilly Wiesie
Greenhorn

Joined: Jan 20, 2005
Posts: 26
I was testing a very simple web services written in Axis (1.2RC2) with just a single method, returning a string "test". The method doesn't need any parameters. when I tested it using .Net client, it returns null. Could anyone please tell me what could ne wrong? I've beening fighting this problem for days now, but still no luck..

Could anyone tell me what could be wrong? Where can I find sample code for Axis/.Net combination?

Thanks.

Lilly
Ashutosh Shahi
Ranch Hand

Joined: Feb 06, 2005
Posts: 36
With the little information that u provided, i can only suggest that u use document/literal or rpc/literal as your Style/Use in the Wsdl, as, as far as i know, .NET doesn't support rpc/encoded, and axis uses rpc/encoded by default.
Ashutosh


<a href="http://blogs.sun.com/roller/page/ashutosh" target="_blank" rel="nofollow">http://blogs.sun.com/roller/page/ashutosh</a>
Lilly Wiesie
Greenhorn

Joined: Jan 20, 2005
Posts: 26
Sorry - here is the information:

InterOpTest.wsdl:
---------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<wsdl efinitions targetNamespace="http://localhost:8080/axis/services/InterOpTest"
xmlns:apachesoap="http://xml.apache.org/xml-soap"
xmlns:impl="http://localhost:8080/axis/services/InterOpTest"
xmlns:intf="http://localhost:8080/axis/services/InterOpTest"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<!--WSDL created by Apache Axis version: 1.2RC2
Built on Nov 16, 2004 (12:19:44 EST)-->
<wsdl:types>
<schema elementFormDefault="qualified"
targetNamespace="http://localhost:8080/axis/services/InterOpTest"
xmlns="http://www.w3.org/2001/XMLSchema">
<element name="getStringReturn" type="xsd:string"/>
</schema>
</wsdl:types>

<wsdl:message name="getStringRequest">

</wsdl:message>

<wsdl:message name="getStringResponse">

<wsdl art element="impl:getStringReturn" name="getStringReturn"/>

</wsdl:message>

<wsdl ortType name="InterOpTest">

<wsdl peration name="getString">

<wsdl:input message="impl:getStringRequest" name="getStringRequest"/>

<wsdl utput message="impl:getStringResponse" name="getStringResponse"/>

</wsdl peration>

</wsdl ortType>

<wsdl:binding name="InterOpTestSoapBinding" type="impl:InterOpTest">

<wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>

<wsdl peration name="getString">

<wsdlsoap peration soapAction=""/>

<wsdl:input name="getStringRequest">

<wsdlsoap:body use="literal"/>

</wsdl:input>

<wsdl utput name="getStringResponse">

<wsdlsoap:body use="literal"/>

</wsdl utput>

</wsdl peration>

</wsdl:binding>

<wsdl:service name="InterOpTestService">

<wsdl ort binding="impl:InterOpTestSoapBinding" name="InterOpTest">

<wsdlsoap:address location="http://localhost:8080/axis/services/InterOpTest"/>

</wsdl ort>

</wsdl:service>

</wsdl efinitions>

============================================================================




.Net client proxy (InterOpTest.cs):
//--------------------------------------------------------------------------// <autogenerated>
// This code was generated by a tool.
// Runtime Version: 1.1.4322.2032
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </autogenerated>
//------------------------------------------------------------------------

//
// This source code was auto-generated by wsdl, Version=1.1.4322.2032.
//
using System.Diagnostics;
using System.Xml.Serialization;
using System;
using System.Web.Services.Protocols;
using System.ComponentModel;
using System.Web.Services;


/// <remarks/>
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Web.Services.WebServiceBindingAttribute(Name="InterOpTestSoapBinding", Namespace="http://localhost:8080/axis/services/InterOpTest")]
public class InterOpTest : System.Web.Services.Protocols.SoapHttpClientProtocol {

/// <remarks/>
public InterOpTest() {
this.Url = "http://localhost:8080/axis/services/InterOpTest";
}

/// <remarks/>
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Bare)]
[return: System.Xml.Serialization.XmlElementAttribute("getStringReturn")]
public string getString() {
object[] results = this.Invoke("getString", new object[0]);
return ((string)(results[0]));
}

/// <remarks/>
public System.IAsyncResult BegingetString(System.AsyncCallback callback, object asyncState) {
return this.BeginInvoke("getString", new object[0], callback, asyncState);
}

/// <remarks/>
public string EndgetString(System.IAsyncResult asyncResult) {
object[] results = this.EndInvoke(asyncResult);
return ((string)(results[0]));
}
}

=====================================================================

Java service (InterOpTest.java)

public class InterOpTest
{
public InterOpTest()
{

}

public String getString()
{
return "Test";
}
}


==================================================

I tried many things, noone of them work. I can clearly see the response on t
Lilly Wiesie
Greenhorn

Joined: Jan 20, 2005
Posts: 26
continue from the above post - I can see the response on tcpmon as:


------------------------------------------------------------------
HTTP/1.1 100 Continue



HTTP/1.1 200 OK

X-Powered-By: Servlet 2.4; Tomcat-5.0.28/JBoss-4.0.1 (build: CVSTag=JBoss_4_0_1 date=200412230944)

Content-Type: text/xml;charset=utf-8

Transfer-Encoding: chunked

Date: Fri, 11 Feb 2005 05:11:31 GMT

Server: Apache-Coyote/1.1



10f

<soapenv:Envelope 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><getStringReturn xmlns="">Test</getStringReturn></soapenv:Body></soapenv:Envelope>
0

---------------------------------------------------------------------------

I am almost clueless on what went wrong

Any help welcome.

Lilly
JeanLouis Marechaux
Ranch Hand

Joined: Nov 12, 2001
Posts: 906
Hi Lilly,

My understanding of your problem is that you have checked the response is sent back (TCPMon) but the .Net client seems to ignore it and display NULL.

Is that right ?

I have no .Net knowledge, but could you double check it supports HTTP 100 - continue and chunked messages ??


/ JeanLouis<br /><i>"software development has been, is, and will remain fundamentally hard" (Grady Booch)</i><br /> <br />Take a look at <a href="http://www.epfwiki.net/wikis/openup/" target="_blank" rel="nofollow">Agile OpenUP</a> in the Eclipse community
Lilly Wiesie
Greenhorn

Joined: Jan 20, 2005
Posts: 26
Hi Jean-Louis,

Thanks for you reply.

That's exactly what happened - the web services is set up using Axis 1.2 in doc/literal, and the client is c# in .net. There is no problem for .net client to send the request to the server, and there is no problem for the server sending out the response (I can see both in tcpmon). The problem is that the response doesn't show up in the client program (the return string is null). .Net doesn't show any exception. It just silently shows nothing (on the return string).

I did set up accepting "chunk" in iis, but it doesn't solve the problem.

I am going to use .net XMLSerilizer to test the return SOAP message to see if it can give me any hint.

Thanks for your help.

Lilly
Kelly Dolan
Ranch Hand

Joined: Jan 08, 2002
Posts: 109
Did you ever figure this out? I'm having the same problem. My .NET client successfully calls my Java web service and the logs show that the SOAP response contains the correct information but when the .NET client gets the result, it is either null, 0, true, etc. depending on the return type.
Srikanth
Greenhorn

Joined: Nov 17, 2005
Posts: 4
hi guys,

I have developed a webservice using Axis1.1 and a java Client. Webservice is a simple file mangement system where it receives file from client and sends requested files as Attachment.

Problem is function in webservice return a string with success or failure code. When i am sending a file as an attachment from the webservice, client receives a null value. Service return a null when there is Attachment to be sent is there is no attachment client receives what evermessage service return.

String str = VET_GetFile(ID, Filename);
the above function return a string and also a file as an attachment. but the str value is received as null.

have Any body faced this kind of error.


Dove
r kitt
Greenhorn

Joined: Dec 08, 2005
Posts: 1
Hello!

Lili, take a close look at your reply, you will spot a number before and after the soap-reply envelope. We have that problem too:

When we access our AXIS-Service by Excel the returned soap message have a number between http header and soap message. This number together with the Transfer-encoding: chunked makes the Soap Mapper unable to interprete the result. If we call by a java servlet, everyting is fine.


It seems to be an issue about this attribute chunked that is from the HTTP protokol 1.1, at the end of the header follows the size of the content. this is exactly the number that cause all the trouble. But somehow .net/VB is unable to interprete this.

EXCEL Request:
_____________________________________________

_______________________________________________
Response:
_______________________________________________

___________________________________________________

The number 1b96 represents equals the length of the content (<xml ..) There is an additional 0 st the end.

The same request from java is in http1.0 and returns fine, without the Transfer-encoding : chunked

JAVA-SERVLET Request:
____________________________________________________

____________________________________________________
AXIS response:
____________________________________________________

____________________________________________________

The response is just nice.

Some suggest to use downgrade to 1.0 commands in http.conf but in my tomcat this is not an option, it runs under Windows.

May this is a hint for any professional ,,, Any suggestions are welcome!
[ December 08, 2005: Message edited by: r kitt ]
Balaji Loganathan
author and deputy
Bartender

Joined: Jul 13, 2001
Posts: 3150
just read the whole message above...
My suggestion is....Download the latest axis that axis1.3 and then the things will start working for both rpc and document/literal.
And Yes! you can even exchange complex array objects from axis to .net and vice versa.


Spritle Software Blogs
Yorkshire Lad
Greenhorn

Joined: May 09, 2006
Posts: 2
Just been trawling the web to find an answer to this question.

I have Axis 1.3 installed but am getting exactly the same issue.

Did anyone get a resolution to this problem?

Cheers

Brian
Balaji Loganathan
author and deputy
Bartender

Joined: Jul 13, 2001
Posts: 3150
Can you post the Server-side code and deploy.wsdd using UBB Code tag ? I can test it in my PC and see whats happening.
Yorkshire Lad
Greenhorn

Joined: May 09, 2006
Posts: 2
See direct email containing info.

Thanks in advance.

Brian
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: .Net Client for Axis Web services