Skip to Content
author's profile photo Former Member
Former Member

Problems creating web service using SAP .NET Connector

I’m trying to use the SAP .NET Connector in a web service project of a Visual Studio .NET solution. I followed the DNCWebServiceSample example provided with the Connector and created a web service that tests ok (XML renders with no errors in a browser window) but I keep running into problems calling the method from an aspx page. For DNCWebServiceSample, if I use

NameSpace.WebService.BRFCKNA1Table ReturnObject=new NameSpace.WebService.BRFCKNA1Table()

to define the table object on the calling page, I get a build error that "BRFCKNA1Table doesn’t exist in the namespace." And if I try just defining BRFCKNA1

NameSpace.WebService.BRFCKNA1 ReturnObject=new NameSpace.WebService.BRFCKNA1()

I get the error:

"Cannot implicitly convert type 'NameSpace.WebService.BRFCKNA1[]' to 'NameSpace.WebService.BRFCKNA1'"

What am I doing wrong? Unfortunately, I couldn’t find any sample code that shows you how to call the DNCWebServiceSample from an aspx page.

I’ve also tried to use the ToADODataTable method within the web service to convert the SAP tables to ADO tables and add the ADO tables to a DataSet. One RFC that I’m using returns 11 tables, so I thought this would be a good way to return all that data as a single DataSet. But I keep getting XMLSchemaException errors trying to

invoke the web method from an aspx page.

Either way, I want to set up a web service using the .NET connector for other applications to consume. Any help would be greatly appreciated.

Add comment
10|10000 characters needed characters exceeded

1 Answer

  • author's profile photo Former Member
    Former Member
    Posted on Apr 15, 2004 at 12:05 PM

    Hi,

    The return type of the method is BRFCKNA1[] instead of BRFCKNA1. You should make the call like this:

    NameSpace.WebService.RFCCustService proxy =

    new NameSpace.WebService.RFCCustService();

    ...

    NameSpace.WebService.BRFCKNA1[] retrunTable

    = proxy.CustomerWebService(...);

    ...

    Please also note that you don't need to new an instance for returnTable before the method call.

    Regards,

    Guangwei Li

    Add comment
    10|10000 characters needed characters exceeded