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 a comment
10|10000 characters needed characters exceeded

Related questions

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 a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.