cancel
Showing results for 
Search instead for 
Did you mean: 

Consume an ABAP Webservice (WAS 620) from .Net

Former Member
0 Kudos

Does anybody have a simple example of how to consume an ABAP webservice on WAS 620 (R/3 4.7) from a .net web app?

For example, consume this webservice from .Net:

http://[hostname]:[port]/sap/bc/soap/wsdl11?services=Z_GET_COST_CENTERS&sap-client=030

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Here's what I was looking for....I should award myself points...

<b>Does SAP connector for Microsoft .NET 2.0 support Soap calls to SAP Web Application Server 6.20 and higher?</b>

Yes, SAP connector for Microsoft .NET 2.0 supports Soap.

SAP connector for Microsoft .NET 1.x also supported Soap, but with version 2.0 the use of Soap is easier. It is now fully transparent to a client wheather RFC or Soap is used. The underlying idea is to extend the “Connection” and “Destination” model. With SAP connector for Microsoft .NET 2.0 as well as with SAP connector for Microsoft .NET 1.0, the SAPClient class (and thus all client proxies) have a “Connection” property. In SAP connector for Microsoft .NET 1.0, you had to assign a “SAPConnection” object that was the container for RFC connections. You were able to create such an object directly, for example

“proxy.Connection = new SAPConnection(connString)”

Or you were able to create an object indirectly with the SAPClient’s constructor or the “ConnectionString” property:

“proxy.ConnectionString = “…”” or “SAPProxy1 proxy = new SAPProxy(connStr);”

To build up a connection string, you could use a Destination or SAPLogonDestination object. In SAP connector for Microsoft .NET 2.0, this model has been extended: The SAPClient’s “Connection” property can contain either an object of class “RfcConnection” (which is the successor of SAPConnection) or an object of class “SoapConnection”. The new “SoapConnection” class builds the correct URLs and credentials as expected by the Soap entry of SAP Web Application Server 6.20.

A static function “SAP.Connector.Connection.GetConnection() is available that creates the correct “Connection” class for the connection string.

The following sets a SoapConnection to the proxy:

“proxy.Connection = Connection.GetConnection(“http://appserver:1080/sap/bc/soap/rfc”)

Compare this with the following, which sets an RFC connection:

“proxy.Connection = Connection.GetConnection(“ASHOST=iwdf9401 SYSNR=1 CLIENT=801 USER=hille PASSWD=***** LANG=de).

On the other hand, “Destination” and “SAPLogonDestination” have been extended to create URL connection strings instead of RFC connection strings. Therefore the connection classes have many new properties; of which the most important one is “UseSoap”. When it is set to “False” (default), the “Destination” classes work as before. When it is set to “True”, it produces an URL instead.

Destination destination1 = new Destination();

… // set properties here

destination1.UseSoap = false;

proxy.Connection = Connection.GetConnection(destination1);

// running with RFC

destination1.UseSoap = true;

proxy.Connection = Connection.GetConnection(destination1);

// running with Soap.

Connection.GetConnection exists in several overloads to support different kinds of connection and connection providers, automatic connection pooling, and so on. As it has also designer support (see “A4”), we recommend you to use this method for connection management.

Former Member
0 Kudos

For example, consume this <b>abap</b> webservice from a <b>.Net web app</b>:

http://[hostname]:[port]/sap/bc/soap/wsdl11?services=Z_GET_COST_CENTERS&sap-client=030

Former Member
0 Kudos

Hi kelly,

It is very simple to consume any kind of webservices from .net. Right click the reference in the solution explorer of VS.Net and add your ABAP Web service url in the URL field and Click on add reference. Then proxy with the name localhost will be created and great thing you can refer all your abap methods from your .net code and code as per your business needs. I hope this will give you clear picture for you.

cheers

ram

Former Member
0 Kudos

Hi Kelly,

how are you doing ?

please have a look at the following blogs, they should be useful to your current learning curve :

1> Access SAP Business Functions (ABAP) via Web Services - Wallace Su

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/06adbf03-0a01-0010-f386-d8e...

within is a sample of how to consume an ABAP web service from VS.NET

2> SAP Network Blog: How to debug ABAP Web services from Microsoft Visual Studio - Andre Fischer

/people/andre.fischer/blog/2007/02/07/how-to-debug-abap-web-services-from-microsoft-visual-studio

with respect,

amit

Former Member
0 Kudos

Hi Kelly,

thank you for the 'very helpful answer' reward points

with respect,

amit

Former Member
0 Kudos

can u send software requirement for working .net in net weaver.

Former Member
0 Kudos

Hi kalenthirababu paulsamy eminent tech,

how are you doing ?

i do not understand what you mean by 'requirement' in this context

and please correct me if i'm not in sync with your thoughts

solicitation of new business would probably be best done outside the forum or at least probably in u're own thread, and the moderator will decide if u're thread would stay or not

if you mean technical requirements : please have a look at the

SAP .NET Development Centre

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/webcontent/uuid/3ecbe347-0a01-0010-5897-dc8f1... [original link is broken]

with respect,

amit

Andre_Fischer
Product and Topic Expert
Product and Topic Expert
0 Kudos

If there is a new question you should post it as a new question rather than addting it to an existing (already answered) quesiton.

Best regards,

Andre