cancel
Showing results for 
Search instead for 
Did you mean: 

.Net Connector and Web Services

Former Member
0 Kudos

We have successfully built a proxy that connects a to a RFC. The RFC has two tables defined, one for input data a other for output data. The proxy was created inside a VB.NET Web Service project so the main idea (GOAL) is another deparment in the company can call it from Java JSP.

so we have the web method:

Imports System.Web.Services

Imports NetConnectorService.inivalores

<System.Web.Services.WebService(Namespace:="http://tempuri.org/NetConnectorService/Service1")> _

Public Class NCActualizaSeI

Public cs As String = "ASHOST=server SYSNR=0 CLIENT=900 USER=someone PASSWD=something"

Public proxy As New ZAF(cs)

Public renglon As New ZAFESANLA

Public tblEntrada As New ZAFESANLATable, tblSalida As New ZAFRESANLATable

<WebMethod()> Public Function Ejecuta_RFC_tabla() As ZAFESANLATable

proxy.Zaf_Actualiza_As02_dummy(tblEntrada)

Return tblEntrada

End Function

<WebMethod()> Public Function Ejecuta_RFC(tbl as ZAFESANLATable) As ZAFRESANLATable

proxy.Zaf_Actualiza_As02("N", tbl, tblSalida)

Return tblSalida

End Function

End class

And the client code looks like this:

Dim obj As New wsActualizaAF.NCActualizaSeI

Dim Data As Object

Dim Entrada as Object

Entrada = obj.Ejecuta_RDF_tabla()

Entrada(0).Activo="000005500036"

Entrada(0).Sociedad="000005500036"

Entrada(0).Serie = "55222555555"

Entrada(0).Inventario = "55222555555"

Data = obj.Ejecuta_RFC(Entrada)

As you can see we fisrt have to call the method Ejecuta_RFC_tabla to return an object type of ZAFESANLATable (input table) then fill in the data

and then send it back to the web service when executing the call to the proxy Data = obj.Ejecuta_RFC(Entrada)

this seems to work ok but my questions are:

Is there any other way to send a table object to the client without having to make a call to a dummy RFC that only creates the table?

Is there something like a DimAs method that allows one to create a table object directly from the original RFC?

In a production enviroment would this whole idea work fine? I mean is there any complications?

Any advice is welcome.

Accepted Solutions (0)

Answers (1)

Answers (1)

reiner_hille-doering
Active Contributor
0 Kudos

Sorry, I somehow confused by your code:

- If your client is .NET, you just reference your "server" project and say

Dim Entrada As New wsActualizaAF.ZAFRESANLATable

Dim row As New wsActualizaAF.ZAFRESANLA

row.Activo="000005500036"

...

Entrada.Add(row)

...

In fact you are not using WebService, but a normal call in this case.

If your client is something else, like Java, you would import the .WSDL created by your WebService, e.g. NCActualizaSeI.wsdl. In Java you would have a tool that created Java proxy classes from it. These classes will also include a proxy class for ZAFRESANLA. So you just can create instances of it and pass it to the WS call.