cancel
Showing results for 
Search instead for 
Did you mean: 

RFC, Visual Studio.NET 2003, Web Services

Former Member
0 Kudos

Hi,

I am writing a web service for sap functions using rfc. My code is;

public string RFC_DI_URUNTIPLERI(out DataSet SEKTORLER_, out DataSet SIPTURU_URUNTIPI_, out DataSet TABLAR_, out DataSet URUNTIPLERI_){

sapProxy = new SAPProxy();

SAP.Connector.Destination destination = new SAP.Connector.Destination();
destination.AppServerHost = ...
destination.Client = ...
destination.Language = ...
destination.Username = ...
destination.Password = ...
destination.SystemNumber = ...

SAP.Connector.SAPConnection sapConnection = new SAP.Connector.SAPConnection(destination);

sapProxy.Connection = sapConnection;

ZBMBSEKTORTable sapSEKTOR = new ZBMBSEKTORTable();
ZURUNTIPUYTable sapSIPTURU_URUNTIPI = new ZURUNTIPUYTable();
ZTABTANIMTable sapTABLAR = new ZTABTANIMTable();
ZDI_URUNTPTable sapURUNTIPLERI = new ZDI_URUNTPTable();

sapProxy.Z_RFC_DI_URUNTIPLERI(ref sapSEKTOR, ref sapSIPTURU_URUNTIPI,ref sapTABLAR, ref sapURUNTIPLERI);
}

and the proxy file is;

[RfcMethod(AbapName = "Z_RFC_DI_URUNTIPLERI")]
    [SoapDocumentMethodAttribute("http://tempuri.org/Z_RFC_DI_URUNTIPLERI",
     RequestNamespace = "urn:sap-com:document:sap:rfc:functions",
     RequestElementName = "Z_RFC_DI_URUNTIPLERI",
     ResponseNamespace = "urn:sap-com:document:sap:rfc:functions",
     ResponseElementName = "Z_RFC_DI_URUNTIPLERI.Response")]
    public void Z_RFC_DI_URUNTIPLERI (

     [RfcParameter(AbapName = "SEKTORLER",RfcType=RFCTYPE.RFCTYPE_ITAB, Optional = true, Direction = RFCINOUT.INOUT)]
     [XmlArray("SEKTORLER", IsNullable=false)]
     [XmlArrayItem("item", IsNullable=false)]
     ref ZBMBSEKTORTable SEKTORLER,
     [RfcParameter(AbapName = "SIPTURU_URUNTIPI",RfcType=RFCTYPE.RFCTYPE_ITAB, Optional = true, Direction = RFCINOUT.INOUT)]
     [XmlArray("SIPTURU_URUNTIPI", IsNullable=false)]
     [XmlArrayItem("item", IsNullable=false)]
     ref ZURUNTIPUYTable SIPTURU_URUNTIPI,
     [RfcParameter(AbapName = "TABLAR",RfcType=RFCTYPE.RFCTYPE_ITAB, Optional = true, Direction = RFCINOUT.INOUT)]
     [XmlArray("TABLAR", IsNullable=false)]
     [XmlArrayItem("item", IsNullable=false)]
     ref ZTABTANIMTable TABLAR,
     [RfcParameter(AbapName = "URUNTIPLERI",RfcType=RFCTYPE.RFCTYPE_ITAB, Optional = false, Direction = RFCINOUT.INOUT)]
     [XmlArray("URUNTIPLERI", IsNullable=false)]
     [XmlArrayItem("item", IsNullable=false)]
     ref ZDI_URUNTPTable URUNTIPLERI)
    {
        object[]results = null;
        results = this.SAPInvoke("Z_RFC_DI_URUNTIPLERI",new object[] {
                            SEKTORLER,SIPTURU_URUNTIPI,TABLAR,URUNTIPLERI});
        SEKTORLER = (ZBMBSEKTORTable) results[0];
        SIPTURU_URUNTIPI = (ZURUNTIPUYTable) results[1];
        TABLAR = (ZTABTANIMTable) results[2];
        URUNTIPLERI = (ZDI_URUNTPTable) results[3];

        return;
    }

When I called my function ("public string RFC_DI_URUNTIPLERI") there is an error;

The 'ZDIF:ZBMBSEKTORTable' element is not declared. An error occurred at , (1, 750). 


public string RFC_DI_URUNTIPLERI(out System.Data.DataSet SEKTORLER_, out System.Data.DataSet SIPTURU_URUNTIPI_, out System.Data.DataSet TABLAR_, out System.Data.DataSet URUNTIPLERI_) {
   object[] results = this.Invoke("RFC_DI_URUNTIPLERI", new object[0]);
SEKTORLER_ = ((System.Data.DataSet)(results[1]));

I see that error is deal with the parameter passing, but I am not passing DataSet, I am passing the true type, What should I do?

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

I have solved my problem; problem is deal with toAdoTablee()' namespace.

thanks anyway.