cancel
Showing results for 
Search instead for 
Did you mean: 

WebService parameters

Former Member
0 Kudos

Hi anyone out there,

I am writing a web service and have a proxy inside it. I am trying to pass in SAPTables from outside the webservice. I realised two things:

1. If I am connecting the asmx file with another client with sap.net connector i can pass the actual SAPTable object in. when i do this, and declare the item in the parameters, the xml tag generated by the webservice has two instances of the table structure. for example:

<PtblPoItems>

<BAPIEKPOC>

<PO_5fNUMBER>string</PO_5fNUMBER>

...

...

</BAPIEKPOC>

<BAPIEKPOC>

<PO_5fNUMBER>string</PO_5fNUMBER>

...

...

</BAPIEKPOC>

</PtblPoItems>

Logically since this is a table, each of this instance (am not sure, not a VB.Net guru) will represent a line item (correct me if i am wrong), does this mean that the current table during run time has two empty lines in it?

What is the best way to pass in parameters into a web service?

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

also wondering is there a simpler way to expose all the methods as web service instead of creating an asmx wrapper? I am looking at created a web service which does not require connector runtime on the calling machine...

Former Member
0 Kudos

you guys must be wondering why i am doing this. the only reason is that i can't seem to see the SAPWSDL file when i am adding a Web Reference to my project.

also, if i use:

Public Function <app>(ByVal dummy, etc etc...

how do i reference a table from the proxy into the function?

i tried byRef tblItem As XXXXTable, however it does not bring in the whole table. I read something abt bytestream serialization...do i really have to go through so much trouble to pass a table in and out of a function?

Cheers

reiner_hille-doering
Active Contributor
0 Kudos

If you want to access SAP functions as WebService and your SAP System is 6.20 or higher, you don't need SAP .NET Connector at all. Just use the generice Soap entrance or the more advanced WebService features of NetWeaver.

For the generic Soap Entrance-Processor your find information on service.sap.com/connectors.

So, what you do only makes sense for older systems. The easiest solution to built a Soap-RFC-Gateway with NCo is just marking all generated proxy method with the "WebMethod" attribute.

The problem with the strange XML-tags you mentioned in the first post ("PO_--5fNUMBER") is cauesed by a bug in NCo proxy generator. You find a fix in OSS note 506603.

Former Member
0 Kudos

Hi Reiner,

thanks, so if i understand correctly, NCo is not required for SAP6.20 or webAS6.2? currently most installs here at 4.6 and some 4.7. I understand taht 4.7 is also a webas, do i need connector to access sap functions for 4.7?

Is it also safe to say that the NCo is totally not requied in 6.20? if i understand correctly, we will be using NCo for only RFC calls ?

As per my original problem. I tried reference the SAPWSDL directly when i add as web reference seems to be some problems recognising it in intellisense, however the reference was somehow "added". How do i call from VB.Net to a sapwsdl web reference?

Thanks in advance

reiner_hille-doering
Active Contributor
0 Kudos

Right, if you only use 6.20 or R/4 4.7 and want to do all calls with Soap, you don't need NCo. You would also not have a SAPWSDL, but a normal WSDL. You get it directly from WAS server. Details are available, as I said, in the Media Library on the SOAP Processor of Service Marketplace.

The difference between SAPWSDL and WSDL is that SAPWSDL cotains extra information for RFC. NCo mimics the behavior of the normal WebService API and transparently adds the RFC support - so with NCo you can choose if you want to use Soap or RFC. NCo also has some additional features for Design time and data binding. But as you finally want to use MS WebService client, you definitely don't need NCo.

Former Member
0 Kudos

So in other words, for 4.6 installs, if i want to use a web service i still need to generate a proxy as i have done? Three questons are tied to this response:

1. I want to use a web service to access let's say BAPI_SALESORDER_GETSTATUS. Do i create a proxy in a aSP.net web service project, where i will be having both a .sapwsdl and .asmx file?

2. Do i just add web reference to .sapwsdl file? from the responses i am getting from you, it might not be possible right? if not then i will be calling the proxy locally in the asp.net web service and treat the web service as a wrapper.

3. In creating a wrapper I have some problems referencing the BAPIXXTable from the sapwsdl file into the calling application. For example, I have created a scenario as in number (2), and I need to pass a table into the RFC/BAPI. therefore i managed to :

public function xxx(byref table1 as <proj>.<webref>.BAPIXXXTable)

however, when i call from the other application (which i referenced this web service to), i need to populate the table entries, i can't seem to do this, as intellisense only shows the structures but not the table. What's wrong with my declarations?

reiner_hille-doering
Active Contributor
0 Kudos

First of all, NCo is design for "direct access":

- You have a client application (e.g. Windows Forms or Web Forms).

- In contains a proxy to call a SAP server directly, either by RFC or Soap.

What you plan to do sounds to me like "double remoting": You have a middleware that uses RFC on one side and exposes the same API as WebService on the other side. I don't see why you really want this. Can you explain a litte?

Former Member
0 Kudos

Explanation: RFC on one end and WebService on the other end...

Well as you said, the older versions of SAP R/3, i.e. 4.6 will not have SOAP entrance and if there is an application which does not want to incorporate the NCo into their design, then it only makes sense to create this wrapper to expose the RFC as a web service. There are software makers who would want to declare themselves as providing a web service interface, hence, the direction.

reiner_hille-doering
Active Contributor
0 Kudos

The question is <i>why</i> you wouldn't want to incorporate NCo in your APP design if you want to support 4.6x. The programming model between a pure Soap (MS WS-client) and NCo bases solution is the same - as long as you anyway just use the original BAPI APIs. Regard BAPI as WebService with another transport protocoll - and NCo the corresponding WS client.

Former Member
0 Kudos

The answer to your question, is .... *drum roll*

Customer wants it that way....I am merely exploring, don't mind me...

Thanks for your replies. The knowledge shared was good...

reiner_hille-doering
Active Contributor
0 Kudos

Please be so kind to mark answers you like with "stars".