Showing results for 
Search instead for 
Did you mean: 

.net web services client: problems to return value

Former Member
0 Kudos

Hi, I need some suggestions from you, please.

According to what reported in the document "Building Web Services with ABAP and SAP Web Application server. Exercise / Solutions" available in, I'm trying to create a Web Service with WAS 6.20 patch 38, that should be invoked by a C# WS Client created with Visual Studio .NET.

In WebAS I built (SE37) the function ZWS01_ADD (a remote-enabled module):

FUNCTION zws01_add.


""Interfaccia locale:






ADD value TO gl_result.

result = gl_result.


At the moment the function is available as a WebService and I can obtain the WDSL file without troubles.

I created a new C# project with Visual Studio Net using the Console Application Template, I imported the wdsl to the Solution Explorer and here is the code of my MAIN function that invokes the Web Service:

int result;

calc.ZVW_ADDService s = new calc.ZVW_ADDService();

String Url = "";

s.Url = Url;

result = s.ZVW_ADD(1);

System.Console.WriteLine("Result: " + result);

When I start the test with VALUE = 1, I'm sure that the WAS service is invoked (I can trace it ABAP side - I receive the correct value), the ABAP variable RESULT is set to 1 but, debugging the Web Service Client in Visual Studio, the instruction "result = s.ZVW_ADD(1);" returns a NULL causing a null exception.

Please, is there something wrong in this exercise ?

which are the minimum required versions of WAS, .net,...?

Please help me.

Thanks in advance,

Gianluca Bonavitacola

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos


The SAP user and password are missing. The exception should contain more details on the failure. You can append sap-user=xxx and sap-password=xxx to the url:

String Url = "";