Skip to Content
avatar image
Former Member

calling a sap webas 6.20 web service from .net

I was able to call the rfc bapi in the form of web service from a soap client

where the post data is something like this:

<b><?xml version="1.0" encoding="UTF-8"?>

http://schemas.xmlsoap.org/soap/envelope/">

<SOAP-ENV:Body>

<rfc:BAPI_BUPA_ADDRESS_GETDETAIL xmlns:rfc="urn:sap-com:document:sap:rfc:functions">

<BUSINESSPARTNER>0000000232</BUSINESSPARTNER>

<ADDRESSGUID></ADDRESSGUID>

</rfc:BAPI_BUPA_ADDRESS_GETDETAIL>

</SOAP-ENV:Body>

</SOAP-ENV:Envelope></b>

and the url was:

<b>http://<server-name>:8000/sap/bc/soap/rfc</b>and I am getting the response from the bapi.

I am not sure how will I call this web service from .net, I mean how will i pass the login information and the post data.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    avatar image
    Former Member
    Apr 27, 2006 at 06:08 PM

    I tried the way u told, and went thru the document

    I added the .wsdl file as a web reference. IF I compile ,it is giving me an error

    <b>Reference to a non-shared member requires an object reference.</b>

    It is pointing to references.vb which is generated by .net when we add a web reference.

    The wierd part is errors only pertain to section where bapiret2 class is implemented. I tried out with a couple of bapis, it is the same error in the code generated by .net when web reference is added.

    I am able to view the wsdl in browser using the url.

    I tried in both vs2003 as well as vs 205 , thinking that it may be a 2005 issue.

    Any ideas.....

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Recieved "Reference to a non-shared member requires an object reference" error. I have renamed the SYSTEM property to System1 and made the changes in the XML element in the proxy class as suggested in this forum but still not able to run the code. However, my proxy class doesn't have Get and Set methods as default.Any ideas....

      Default code:

      <System.Xml.Serialization.XmlElementAttribute(Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)> _

      Public SYSTEM As String

      Modified code as suggested:

      <System.Xml.Serialization.XmlElementAttribute("SYSTEM", Form:=System.Xml.Schema.XmlSchemaForm.Unqualified)> _

      Public Property SYSTEM1() As String

      Get

      Return Me.SYSTEM1

      End Get

      Set(ByVal Value As String)

      Me.SYSTEM1 = Value

      End Set

      End Property

      Recieved the below Error:

      "System.Xml.XmlException: The XML declaration is unexpected. Line 1, position 5.

      at System.Xml.XmlTextReader.ParseTag()

      at System.Xml.XmlTextReader.ParseRoot()

      at System.Xml.XmlTextReader.Read()

      at System.Xml.XmlReader.MoveToContent()

      at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)

      at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)

      at AAEWS.sa.com.aramco.onyx.ZAAE_TRIGGER_WORKFLOWService.ZAAE_TRIGGER_WORKFLOW(String I_APRCRITERIA, String I_BUKRS, String I_INITIATOR, String I_OBJECTID, String I_PROCID, String I_REQUESTOR, String I_SYSID, String I_URL, String I_WI_TEXT) in C:\VB\AAEWS\Web References\sa.com.aramco.onyx\Reference.vb:line 42

      at AAEWS.Module1.Main() in C:\VB\AAEWS\Module1.vb:line 19"

  • Apr 27, 2006 at 07:21 AM

    This is really easy:

    Ge the WSDL from

    http://<server-name>:8000/sap/bc/soap/wsdl11?services=BAPI_BUPA_ADDRESS_GETDETAIL&sap-client=<client>

    Use the WSDL to create a Web Reference (also called WS proxy).

    Use is like

    ICredentials cred = new NetworkCredential("<user>","<password>"); 
    service.RfcService s = new service.RfcService(); s.Credentials = cred; 
    result = s.BAPI_BUPA_ADDRESS_GETDETAIL(...);
    

    Detailed information is available at http://service.sap.com/connectors -> Soap Processor -> Media Library

    Add comment
    10|10000 characters needed characters exceeded