Creating a SOAP-Call using classig ASP

Discussion in 'C#' started by UrsB, May 26, 2008.

  1. #1
    Hi y'all - you're my last hope! :)

    I'm using classic ASP to connect to a SAP-Webservice (no, I can't use .net). The connection seems to work so far, but I keep getting an error from the webservice, that an expected element was not found.

    The Code I'm using to generate the SOAP-Call:

    
    
    SoapURL = "http://IP-Adress/path/" 
        SoapRequest.Open "POST",SoapURL, False 
        
        SoapRequest.setRequestHeader "Content-Type", "text/xml; charset=UTF-8" 
        SoapRequest.setRequestHeader "Authorization", "BASIC " & Base64Encode("username:password") 
        SoapRequest.setRequestHeader "SOAPAction", "" 
    	 
    	sRequest = "" 
    	sRequest = sRequest & "<?xml version=""1.0"" encoding=""UTF-8"" ?>" 
    	sRequest = sRequest & "<soapenv:Envelope xmlns:soapenv=""http://schemas.xmlsoap.org/soap/envelope/"" xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xs=""http://www.w3.org/2001/XMLSchema"">" 
    	sRequest = sRequest & "<soapenv:Header>" 
    	sRequest = sRequest & "<sapsess:Session xmlns:sapsess=""http://www.sap.com/webas/630/soap/features/session/"">" 
    	sRequest = sRequest & "    <enableSession>true</enableSession>" 
    	sRequest = sRequest & "  </sapsess:Session>" 
    	sRequest = sRequest & "</soapenv:Header>" 
    	sRequest = sRequest & "  <soapenv:Body>" 
    	sRequest = sRequest & "   <q0:CustomerCreatefromdata1 xmlns:q0=""urn:sap-com:document:sap:soap:functions:mc-style""/>" 
    	sRequest = sRequest & "      <PiCopyreference>"
    	sRequest = sRequest & "        <Salesorg>1000</Salesorg>"
    	sRequest = sRequest & "        <DistrChan>01</DistrChan>"
    	sRequest = sRequest & "        <Division>01</Division>"
    	sRequest = sRequest & "        <RefCustmr>0000050309</RefCustmr>"
    	sRequest = sRequest & "      </PiCopyreference>"
    	 sRequest = sRequest & "    </q0:CustomerCreatefromdata1>" 
    	sRequest = sRequest & "  </soapenv:Body>" 
    	sRequest = sRequest & "</soapenv:Envelope>" 
         
    	SoapRequest.Send sRequest 
    
    
    PHP:
    The Webservice keeps complaining that the element «PiCopyreference» is missing...

    What am I _missing_???

    Thanks in advance for your help...
     
    UrsB, May 26, 2008 IP
  2. iconico

    iconico Peon

    Messages:
    21
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Ok the easy answer is you're missing .NET! Why on earth do you have to do it in ASP Classic?
     
    iconico, Jun 10, 2008 IP