Groups > Borland > Delphi web services WSDL > Re: Namespace-problem?




Namespace-problem?

Namespace-problem?
Tue, 15 Jan 2008 17:19:55 +010
Hello,
I try to consume a (SAP-)Webservice mit Delphi7.1 and patch 24535 and have a 
(namespace?)-problem.
WSDL at the end.

SOAP-Request with Delphi:
<?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">
  <SOAP-ENV:Body>
    <ZAuftragLesen
xmlns="urn:sap-com:document:sap:soap:functions:mc-style">
      <AufnrIv 
xmlns="urn:sap-com:document:sap:rfc:functions">1000038</AufnrIv&
gt;
      <ItKlassifizierung/>
      <LanguIv
xmlns="urn:sap-com:document:sap:rfc:functions">D</LanguIv>
      <Zlongtext/>
    </ZAuftragLesen>
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

SOAP-Request with soapUI:
<soapenv:Envelope
   xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
   xmlns:urn="urn:sap-com:document:sap:soap:functions:mc-style">
   <soapenv:Header/>
   <soapenv:Body>
      <urn:ZAuftragLesen>
         <AufnrIv>1000038</AufnrIv>
         <ItKlassifizierung/>
         <LanguIv>D</LanguIv>
         <Zlongtext/>
      </urn:ZAuftragLesen>
   </soapenv:Body>
</soapenv:Envelope>

The Delphi-request do not work, the soapUI-request do.

1. Are there any settings to get that fixed?
2. I get an warning/errortext in the imported pas-file. Is this a problem?
  // 
************************************************************************ //
  // Namespace : urn:sap-com:document:sap:soap:functions:mc-style
  // transport : http://schemas.xmlsoap.org/soap/http
  // style     : document
  // binding   : Z_AUFTRAG_LESEN_WITH_LONGTEXT3SoapBinding
  // service   : Z_AUFTRAG_LESEN_WITH_LONGTEXT3Service
  // port      : Z_AUFTRAG_LESEN_WITH_LONGTEXT3SoapBinding
  // URL       : 
http://ServerStripped:8000/sap/bc/srt/rfc/sap/Z_AUFTRAG_LESEN_WITH_LONGTEXT3?sap
-client4
  // 
************************************************************************ //
  Z_AUFTRAG_LESEN_WITH_LONGTEXT3 = interface(IInvokable)
  ['']

    // Cannot unwrap:
    //     - More than one strictly out element was found
    function  ZAuftragLesen(const parameters: ZAuftragLesen): 
ZAuftragLesenResponse; stdcall;
  end;

TIA Rainer

The WSDL:
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions 
targetNamespace="urn:sap-com:document:sap:soap:functions:mc-style" 
xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" 
xmlns:n0="urn:sap-com:document:sap:rfc:functions" 
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" 
xmlns:tns="urn:sap-com:document:sap:soap:functions:mc-style" 
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" 
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <wsdl:types>
    <xsd:schema
targetNamespace="urn:sap-com:document:sap:rfc:functions" 
elementFormDefault="unqualified"
attributeFormDefault="qualified" 
xmlns:tns="urn:sap-com:document:sap:rfc:functions">
      <xsd:simpleType name="char12">
        <xsd:restriction base="xsd:string">
          <xsd:maxLength value="12"/>
        </xsd:restriction>
      </xsd:simpleType>
      <xsd:simpleType name="char132">
        <xsd:restriction base="xsd:string">
          <xsd:maxLength value="132"/>
        </xsd:restriction>
      </xsd:simpleType>
      <xsd:simpleType name="char18">
        <xsd:restriction base="xsd:string">
          <xsd:maxLength value="18"/>
        </xsd:restriction>
      </xsd:simpleType>
      <xsd:simpleType name="char2">
        <xsd:restriction base="xsd:string">
          <xsd:maxLength value="2"/>
        </xsd:restriction>
      </xsd:simpleType>
      <xsd:simpleType name="char30">
        <xsd:restriction base="xsd:string">
          <xsd:maxLength value="30"/>
        </xsd:restriction>
      </xsd:simpleType>
      <xsd:simpleType name="char40">
        <xsd:restriction base="xsd:string">
          <xsd:maxLength value="40"/>
        </xsd:restriction>
      </xsd:simpleType>
      <xsd:simpleType name="date">
        <xsd:restriction base="xsd:string">
          <xsd:maxLength value="10"/>
          <xsd:pattern value="\d\d\d\d-\d\d-\d\d"/>
        </xsd:restriction>
      </xsd:simpleType>
      <xsd:simpleType name="lang">
        <xsd:restriction base="xsd:string">
          <xsd:maxLength value="1"/>
        </xsd:restriction>
      </xsd:simpleType>
      <xsd:simpleType name="quantum13.3">
        <xsd:restriction base="xsd:decimal">
          <xsd:totalDigits value="13"/>
          <xsd:fractionDigits value="3"/>
        </xsd:restriction>
      </xsd:simpleType>
      <xsd:simpleType name="unit3">
        <xsd:restriction base="xsd:string">
          <xsd:maxLength value="3"/>
        </xsd:restriction>
      </xsd:simpleType>
    </xsd:schema>
    <xsd:schema 
targetNamespace="urn:sap-com:document:sap:soap:functions:mc-style" 
elementFormDefault="unqualified"
attributeFormDefault="qualified">
      <xsd:import
namespace="urn:sap-com:document:sap:rfc:functions"/>
      <xsd:complexType name="Tline">
        <xsd:sequence>
          <xsd:element name="Tdformat"
type="n0:char2"/>
          <xsd:element name="Tdline"
type="n0:char132"/>
        </xsd:sequence>
      </xsd:complexType>
      <xsd:complexType name="Zklassifizierung">
        <xsd:sequence>
          <xsd:element name="Atnam"
type="n0:char30"/>
          <xsd:element name="Smbez"
type="n0:char30"/>
          <xsd:element name="Ausp1"
type="n0:char30"/>
        </xsd:sequence>
      </xsd:complexType>
      <xsd:complexType name="TableOfTline">
        <xsd:sequence>
          <xsd:element name="item" minOccurs="0"
maxOccurs="unbounded" 
type="tns:Tline"/>
        </xsd:sequence>
      </xsd:complexType>
      <xsd:complexType name="TableOfZklassifizierung">
        <xsd:sequence>
          <xsd:element name="item" minOccurs="0"
maxOccurs="unbounded" 
type="tns:Zklassifizierung"/>
        </xsd:sequence>
      </xsd:complexType>
      <xsd:element name="ZAuftragLesen">
        <xsd:complexType>
          <xsd:sequence>
            <xsd:element name="AufnrIv"
type="n0:char12"/>
            <xsd:element name="ItKlassifizierung" 
type="tns:TableOfZklassifizierung"/>
            <xsd:element name="LanguIv" minOccurs="0"
type="n0:lang"/>
            <xsd:element name="Zlongtext"
type="tns:TableOfTline"/>
          </xsd:sequence>
        </xsd:complexType>
      </xsd:element>
      <xsd:element name="ZAuftragLesenResponse">
        <xsd:complexType>
          <xsd:sequence>
            <xsd:element name="GamngEs"
type="n0:quantum13.3"/>
            <xsd:element name="GasmgEs"
type="n0:quantum13.3"/>
            <xsd:element name="GltrsEs"
type="n0:date"/>
            <xsd:element name="GmeinEs"
type="n0:unit3"/>
            <xsd:element name="GwemgEs"
type="n0:quantum13.3"/>
            <xsd:element name="ItKlassifizierung" 
type="tns:TableOfZklassifizierung"/>
            <xsd:element name="MaktxEs"
type="n0:char40"/>
            <xsd:element name="MatnrEs"
type="n0:char18"/>
            <xsd:element name="Zlongtext"
type="tns:TableOfTline"/>
          </xsd:sequence>
        </xsd:complexType>
      </xsd:element>
    </xsd:schema>
  </wsdl:types>
  <wsdl:message name="ZAuftragLesen">
    <wsdl:part name="parameters"
element="tns:ZAuftragLesen"/>
  </wsdl:message>
  <wsdl:message name="ZAuftragLesenResponse">
    <wsdl:part name="parameters"
element="tns:ZAuftragLesenResponse"/>
  </wsdl:message>
  <wsdl:portType name="Z_AUFTRAG_LESEN_WITH_LONGTEXT3">
    <wsdl:operation name="ZAuftragLesen">
      <wsdl:input message="tns:ZAuftragLesen"/>
      <wsdl:output message="tns:ZAuftragLesenResponse"/>
    </wsdl:operation>
  </wsdl:portType>
  <wsdl:binding name="Z_AUFTRAG_LESEN_WITH_LONGTEXT3SoapBinding" 
type="tns:Z_AUFTRAG_LESEN_WITH_LONGTEXT3">
    <soap:binding style="document" 
transport="http://schemas.xmlsoap.org/soap/http"/>
    <wsdl:operation name="ZAuftragLesen">
      <soap:operation soapAction=""/>
      <wsdl:input>
        <soap:body use="literal"/>
      </wsdl:input>
      <wsdl:output>
        <soap:body use="literal"/>
      </wsdl:output>
    </wsdl:operation>
  </wsdl:binding>
  <wsdl:service name="Z_AUFTRAG_LESEN_WITH_LONGTEXT3Service">
    <wsdl:port name="Z_AUFTRAG_LESEN_WITH_LONGTEXT3SoapBinding" 
binding="tns:Z_AUFTRAG_LESEN_WITH_LONGTEXT3SoapBinding">
      <soap:address 
location="http://ServerStripped:8000/sap/bc/srt/rfc/sap/Z_AUFTRAG_LESEN_WIT
H_LONGTEXT3?sap-client4"/>
    </wsdl:port>
  </wsdl:service>
</wsdl:definitions> 

Post Reply
Re: Namespace-problem?
Wed, 16 Jan 2008 15:08:19 -080
Hello,

Is this related to the issue whereby the IDE importer instead of the command
line importer was being used or is this a new issue after switching to the
command line importer. I'll assume the former. Please let me know if it's
something that I should attend to.

Cheers,

Bruneau.

Post Reply
Re: Namespace-problem?
Thu, 17 Jan 2008 09:32:16 -080
Thanks for the reply. I'll look at the original post and reply as soon as
time allows today.

Cheers,

Bruneau.

Post Reply
Re: Namespace-problem?
Thu, 17 Jan 2008 11:33:01 +010
Hello Bruneau,
this is a new issue after switching to the command line importer.
That's why I started a new thread.

Thank you for your help.
Rainer

"Jean-Marie Babet" <bbabet@borland.com> schrieb im Newsbeitrag 
news:478e8df5$1@newsgroups.borland.com...
> Hello,
>
> Is this related to the issue whereby the IDE importer instead of the 
> command
> line importer was being used or is this a new issue after switching to the
> command line importer. I'll assume the former. Please let me know if it's
> something that I should attend to.
>
> Cheers,
>
> Bruneau.
>
> 

Post Reply
Re: Namespace-problem?
Thu, 17 Jan 2008 17:42:37 -080
Hello,

Are you linking with the updated runtime? I'm not sure whether the problem
lies but this is the XML I'm getting:

<?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">
  <SOAP-ENV:Body>
    <ZAuftragLesen
xmlns="urn:sap-com:document:sap:soap:functions:mc-style">
      <AufnrIv xmlns="">1000038</AufnrIv>
      <ItKlassifizierung xmlns=""/>
      <LanguIv xmlns="">D</LanguIv>
      <Zlongtext xmlns=""/>
    </ZAuftragLesen>
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>


It's similar to the other issue you were having: IOW the elements are
unqualified which means that they must be in the null namespace.

This is the test code that generates the above:


procedure TForm6.Button1Click(Sender: TObject);
var
  Service: Z_AUFTRAG_LESEN_WITH_LONGTEXT3;
  Request: ZAuftragLesen;
  Response: ZAuftragLesenResponse;
begin
  Service := getZ_AUFTRAG_LESEN_WITH_LONGTEXT3(False, '', HTTPRIO1);
  Request := ZAuftragLesen.Create;
  try
    Request.AufnrIv := '1000038';
    Request.LanguIv := 'D';
    Response := Service.ZAuftragLesen(Request);
    try

    finally
      Response.Free;
    end;
  finally
    Request.Free;
  end;
end;


As I've mentioned earlier, support for unqualified elements is new. Earlier
versions of the runtime always assumed qualified elements. If you link with
the earlier runtime, the IS_UNQL flag will simply be ignored.

Can you make sure that you're linking with the updated runtime?

Cheers,

Bruneau.

Post Reply
about | contact