Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

delphi call sap web service

Hi everybody.

Does anyone ever call sap web service with d7 ? I got a error message:

Exception class ESOAPDomConvertError with message 'DocumentElement http://schemas.xmlsoap.org/soap/envelope/:Envelope expected, 
http://schemas.xmlsoap.org/wsdl/:definitions found'. 

I am confused because the program could talk to older sap system. Soap UI also works for newer sap system. What do I need to adjust?

Thanks for any help.

soap request

  <?xml version="1.0" ?> 
- <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" 
xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/">
- <SOAP-ENV:Body SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:NS2="urn:sap-com:document:sap:soap:functions:mc-style">
- <NS1:CompanycodeGetdetail xmlns:NS1="urn:sap-com:document:sap:soap:functions:mc-style">
  <parameters href="#1" /> 
  </NS1:CompanycodeGetdetail>
- <NS2:CompanycodeGetdetail id="1" xsi:type="NS2:CompanycodeGetdetail">
  <Companycodeid xsi:type="xsd:string">1000</Companycodeid> 
  </NS2:CompanycodeGetdetail>
  </SOAP-ENV:Body>
  </SOAP-ENV:Envelope>

soap response


  <?xml version="1.0" encoding="utf-8" ?> 
- <wsdl:definitions targetNamespace="urn:sap-com:document:sap:soap:functions:mc-style" 
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org
/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="urn:sap-
com:document:sap:soap:functions:mc-style" xmlns:wsp="http://schemas.xmlsoap.org
/ws/2004/09/policy" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-
wss-wssecurity-utility-1.0.xsd" xmlns:n1="urn:sap-com:document:sap:rfc:functions">

- <wsdl:documentation>
  <sidl:sidl xmlns:sidl="http://www.sap.com/2007/03/sidl" /> 
  </wsdl:documentation>
  <wsp:UsingPolicy wsdl:required="true" /> 
- <wsp:Policy wsu:Id="IF_ZBAPI_COMPANYCODE_GETDETAIL1">
- <sapsession:Session xmlns:sapsession="http://www.sap.com/webas/630/soap/features/session/">
  <sapsession:enableSession>false</sapsession:enableSession> 
  </sapsession:Session>
  <wsp:ExactlyOne xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" 
xmlns:sapsp="http://www.sap.com/webas/630/soap/features/security/policy"
 xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702" xmlns:wsa="http://www.w3.org/2005/08/addressing" 
xmlns:wsu="http://schemas.xmlsoap.org
/ws/2002/07/utility" /> 
  </wsp:Policy>
- <wsp:Policy wsu:Id="OP_CompanycodeGetdetail">
  <sapcomhnd:enableCommit xmlns:sapcomhnd="http://www.sap.com/NW05/soap/features
/commit/">false</sapcomhnd:enableCommit> 
  <sapblock:enableBlocking xmlns:sapblock="http://www.sap.com/NW05/soap/features/blocking/">true</sapblock:enableBlocking> 
  <saptrhnw05:required xmlns:saptrhnw05="http://www.sap.com/NW05/soap/features/transaction/">no</saptrhnw05:required> 
  <saprmnw05:enableWSRM xmlns:saprmnw05="http://www.sap.com/NW05/soap/features/wsrm/">false</saprmnw05:enableWSRM> 
  </wsp:Policy>
- <wsdl:types>
- <xsd:schema attributeFormDefault="qualified" targetNamespace="urn:sap-com:document:sap:rfc:functions">
- <xsd:simpleType name="char1">
- <xsd:restriction base="xsd:string">
  <xsd:maxLength value="1" /> 
  </xsd:restriction>
  </xsd:simpleType>
- <xsd:simpleType name="char10">
- <xsd:restriction base="xsd:string">
  <xsd:maxLength value="10" /> 
  </xsd:restriction>
  </xsd:simpleType>
- <xsd:simpleType name="char12">
- <xsd:restriction base="xsd:string">
  <xsd:maxLength value="12" /> 
  </xsd:restriction>
  </xsd:simpleType>
- <xsd:simpleType name="char15">
- <xsd:restriction base="xsd:string">
  <xsd:maxLength value="15" /> 
  </xsd:restriction>
  </xsd:simpleType>
- <xsd:simpleType name="char2">
- <xsd:restriction base="xsd:string">
  <xsd:maxLength value="2" /> 
  </xsd:restriction>
  </xsd:simpleType>
- <xsd:simpleType name="char20">
- <xsd:restriction base="xsd:string">
  <xsd:maxLength value="20" /> 
  </xsd:restriction>
  </xsd:simpleType>
- <xsd:simpleType name="char220">
- <xsd:restriction base="xsd:string">
  <xsd:maxLength value="220" /> 
  </xsd:restriction>
  </xsd:simpleType>
- <xsd:simpleType name="char25">
- <xsd:restriction base="xsd:string">
  <xsd:maxLength value="25" /> 
  </xsd:restriction>
  </xsd:simpleType>
- <xsd:simpleType name="char3">
- <xsd:restriction base="xsd:string">
  <xsd:maxLength value="3" /> 
  </xsd:restriction>
  </xsd:simpleType>
- <xsd:simpleType name="char30">
- <xsd:restriction base="xsd:string">
  <xsd:maxLength value="30" /> 
  </xsd:restriction>
  </xsd:simpleType>
- <xsd:simpleType name="char4">
- <xsd:restriction base="xsd:string">
  <xsd:maxLength value="4" /> 
  </xsd:restriction>
  </xsd:simpleType>
- <xsd:simpleType name="char40">
- <xsd:restriction base="xsd:string">
  <xsd:maxLength value="40" /> 
  </xsd:restriction>
  </xsd:simpleType>
- <xsd:simpleType name="char5">
- <xsd:restriction base="xsd:string">
  <xsd:maxLength value="5" /> 
  </xsd:restriction>
  </xsd:simpleType>
- <xsd:simpleType name="char50">
- <xsd:restriction base="xsd:string">
  <xsd:maxLength value="50" /> 
  </xsd:restriction>
  </xsd:simpleType>
- <xsd:simpleType name="char6">
- <xsd:restriction base="xsd:string">
  <xsd:maxLength value="6" /> 
  </xsd:restriction>
  </xsd:simpleType>
- <xsd:simpleType name="cuky5">
- <xsd:restriction base="xsd:string">
  <xsd:maxLength value="5" /> 
  </xsd:restriction>
  </xsd:simpleType>
- <xsd:simpleType name="lang">
- <xsd:restriction base="xsd:string">
  <xsd:maxLength value="1" /> 
  </xsd:restriction>
  </xsd:simpleType>
- <xsd:simpleType name="numeric6">
- <xsd:restriction base="xsd:string">
  <xsd:maxLength value="6" /> 
  <xsd:pattern value="\d*" /> 
  </xsd:restriction>
  </xsd:simpleType>
  </xsd:schema>
- <xsd:schema attributeFormDefault="qualified" targetNamespace="urn:sap-com:document:sap:soap:functions:mc-style" xmlns:n0="urn:sap-com:document:sap:rfc:functions">
  <xsd:import namespace="urn:sap-com:document:sap:rfc:functions" /> 
- <xsd:complexType name="Bapi00022">
- <xsd:sequence>
  <xsd:element name="CompCode" type="n0:char4" /> 
  <xsd:element name="CompName" type="n0:char25" /> 
  <xsd:element name="City" type="n0:char25" /> 
  <xsd:element name="Country" type="n0:char3" /> 
  <xsd:element name="Currency" type="n0:cuky5" /> 
  <xsd:element name="Langu" type="n0:lang" /> 
  <xsd:element name="ChrtAccts" type="n0:char4" /> 
  <xsd:element name="FyVariant" type="n0:char2" /> 
  <xsd:element name="VatRegNo" type="n0:char20" /> 
  <xsd:element name="Company" type="n0:char6" /> 
  <xsd:element name="AddrNo" type="n0:char10" /> 
  <xsd:element name="CountryIso" type="n0:char2" /> 
  <xsd:element name="CurrencyIso" type="n0:char3" /> 
  <xsd:element name="LanguIso" type="n0:char2" /> 
  </xsd:sequence>
  </xsd:complexType>
- <xsd:complexType name="Bapi00023">
- <xsd:sequence>
  <xsd:element name="AddrNo" type="n0:char10" /> 
  <xsd:element name="Formofaddr" type="n0:char20" /> 
  <xsd:element name="Name" type="n0:char40" /> 
  <xsd:element name="Name2" type="n0:char40" /> 
  <xsd:element name="Name3" type="n0:char40" /> 
  <xsd:element name="Name4" type="n0:char40" /> 
  <xsd:element name="COName" type="n0:char40" /> 
  <xsd:element name="City" type="n0:char40" /> 
  <xsd:element name="District" type="n0:char40" /> 
  <xsd:element name="CityNo" type="n0:char12" /> 
  <xsd:element name="PostlCod1" type="n0:char10" /> 
  <xsd:element name="PostlCod2" type="n0:char10" /> 
  <xsd:element name="PostlCod3" type="n0:char10" /> 
  <xsd:element name="PoBox" type="n0:char10" /> 
  <xsd:element name="PoBoxCit" type="n0:char40" /> 
  <xsd:element name="DelivDis" type="n0:char15" /> 
  <xsd:element name="Street" type="n0:char40" /> 
  <xsd:element name="StreetNo" type="n0:char12" /> 
  <xsd:element name="StrAbbr" type="n0:char2" /> 
  <xsd:element name="HouseNo" type="n0:char10" /> 
  <xsd:element name="StrSuppl1" type="n0:char40" /> 
  <xsd:element name="StrSuppl2" type="n0:char40" /> 
  <xsd:element name="Location" type="n0:char40" /> 
  <xsd:element name="Building" type="n0:char10" /> 
  <xsd:element name="Floor" type="n0:char10" /> 
  <xsd:element name="RoomNo" type="n0:char10" /> 
  <xsd:element name="Country" type="n0:char3" /> 
  <xsd:element name="Langu" type="n0:lang" /> 
  <xsd:element name="Region" type="n0:char3" /> 
  <xsd:element name="Sort1" type="n0:char20" /> 
  <xsd:element name="Sort2" type="n0:char20" /> 
  <xsd:element name="TimeZone" type="n0:char6" /> 
  <xsd:element name="Taxjurcode" type="n0:char15" /> 
  <xsd:element name="AdrNotes" type="n0:char50" /> 
  <xsd:element name="CommType" type="n0:char3" /> 
  <xsd:element name="Tel1Numbr" type="n0:char30" /> 
  <xsd:element name="Tel1Ext" type="n0:char10" /> 
  <xsd:element name="FaxNumber" type="n0:char30" /> 
  <xsd:element name="FaxExtens" type="n0:char10" /> 
  </xsd:sequence>
  </xsd:complexType>
- <xsd:complexType name="Bapireturn">
- <xsd:sequence>
  <xsd:element name="Type" type="n0:char1" /> 
  <xsd:element name="Code" type="n0:char5" /> 
  <xsd:element name="Message" type="n0:char220" /> 
  <xsd:element name="LogNo" type="n0:char20" /> 
  <xsd:element name="LogMsgNo" type="n0:numeric6" /> 
  <xsd:element name="MessageV1" type="n0:char50" /> 
  <xsd:element name="MessageV2" type="n0:char50" /> 
  <xsd:element name="MessageV3" type="n0:char50" /> 
  <xsd:element name="MessageV4" type="n0:char50" /> 
  </xsd:sequence>
  </xsd:complexType>
- <xsd:element name="CompanycodeGetdetail">
- <xsd:complexType>
- <xsd:sequence>
  <xsd:element name="Companycodeid" type="n0:char4" /> 
  </xsd:sequence>
  </xsd:complexType>
  </xsd:element>
- <xsd:element name="CompanycodeGetdetailResponse">
- <xsd:complexType>
- <xsd:sequence>
  <xsd:element name="CompanycodeAddress" type="tns:Bapi00023" /> 
  <xsd:element name="CompanycodeDetail" type="tns:Bapi00022" /> 
  <xsd:element name="Return" type="tns:Bapireturn" /> 
  </xsd:sequence>
  </xsd:complexType>
  </xsd:element>
  </xsd:schema>
  </wsdl:types>
- <wsdl:message name="CompanycodeGetdetail">
  <wsdl:part name="parameters" element="tns:CompanycodeGetdetail" /> 
  </wsdl:message>
- <wsdl:message name="CompanycodeGetdetailResponse">
  <wsdl:part name="parameter" element="tns:CompanycodeGetdetailResponse" /> 
  </wsdl:message>
- <wsdl:portType name="ZBAPI_COMPANYCODE_GETDETAIL1">
- <wsp:Policy>
  <wsp:PolicyReference URI="#IF_ZBAPI_COMPANYCODE_GETDETAIL1" /> 
  </wsp:Policy>
- <wsdl:operation name="CompanycodeGetdetail">
- <wsp:Policy>
  <wsp:PolicyReference URI="#OP_CompanycodeGetdetail" /> 
  </wsp:Policy>
  <wsdl:input message="tns:CompanycodeGetdetail" /> 
  <wsdl:output message="tns:CompanycodeGetdetailResponse" /> 
  </wsdl:operation>
  </wsdl:portType>
  </wsdl:definitions>

Edited by: Norman Su on Sep 18, 2008 6:11 PM

Edited by: Norman Su on Sep 18, 2008 6:14 PM

Edited by: Norman Su on Sep 18, 2008 6:15 PM

Edited by: Norman Su on Sep 18, 2008 6:16 PM

Not what you were looking for? View more on this topic or Ask a question