Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: Delphi Soap Request Namespace and Array Type Error


This question is not answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 0
Timuçin ÇAKIRGİL

Posts: 1
Registered: 9/29/03
Delphi Soap Request Namespace and Array Type Error  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Mar 26, 2017 10:42 AM
Case 1: When I first RegisterInvokeOptions before RegisterInterface then NameSpaces is generated and it is fine but in this case xoInlineArrays is not working. Both alanEtiket and gonderenEtiket are ArrayType

...
InvRegistry.RegisterInvokeOptions(TypeInfo(ConnectorService), [ ioDocument, ioHasNamespace ] );
InvRegistry.RegisterInterface(TypeInfo(ConnectorService), 'http://service.connector.uut.cs.com.tr/', 'UTF-8');
...
RemClassRegistry.RegisterSerializeOptions(TypeInfo(ArrayType), [xoInlineArrays]);
...


Generated SOAP Request:
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <SOAP-ENV:Header xmlns:NS1="urn:EFaturaCyberSoft" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="NS1:WSSecHeaderMdlIsl">
      <wsse:Security>
         <wsse:UsernameToken wsu:Id="SecurityToken-{D95A2B0C-4AC5-4D95-A5E9-0BFE0300EF4C}">
            <wsse:Username>[Username]</wsse:Username>
            <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">[Password]</wsse:Password>
         </wsse:UsernameToken>
      </wsse:Security>
   </SOAP-ENV:Header>
   <SOAP-ENV:Body xmlns:NS2="http://service.connector.uut.cs.com.tr/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
      <NS2:gelenBelgeleriAlExt xsi:type="NS2:gelenBelgeleriAlExt">
         <parametreler>
            <item>urn:mail:pk@anaddress.com</item> //-> ERROR: Normaly Here the tag should be <alanEtiket>urn:mail:pk@anaddress.com</alanEtiket>
            <belgeFormati xsi:type="xsd:string">XML</belgeFormati>
            <belgeTuru xsi:type="xsd:string">FATURA</belgeTuru>
            <belgeVersiyon xsi:type="xsd:string">2.0</belgeVersiyon>
            <donusTipiVersiyon xsi:type="xsd:string">2.0</donusTipiVersiyon>
            <erpKodu xsi:type="xsd:string">ELK30002</erpKodu>
            <gelisTarihiBaslangic xsi:type="xsd:string">20170323000000000</gelisTarihiBaslangic>
            <gelisTarihiBitis xsi:type="xsd:string">20170324102431408</gelisTarihiBitis>
            <item>urn:mail:pk@anaddress.com</item> //-> ERROR: Normaly Here the tag should be <gonderenEtiket>urn:mail:pk@anaddress.com</gonderenEtiket>
            <onayDurum xsi:type="xsd:string">HEPSI</onayDurum>
            <vergiTcKimlikNo xsi:type="xsd:string">1234567890</vergiTcKimlikNo>
         </parametreler>
      </NS2:gelenBelgeleriAlExt>
   </SOAP-ENV:Body>
</SOAP-ENV:Envelope>


The Array Typed property name disapears and a <item> tag is placed.

Case 2: When I first RegisterInterface before RegisterInvokeOptions then NameSpaces is lost and xoInlineArrays is working fine. Both alanEtiket and gonderenEtiket are ArrayType

...
InvRegistry.RegisterInterface(TypeInfo(ConnectorService), 'http://service.connector.uut.cs.com.tr/', 'UTF-8');
InvRegistry.RegisterInvokeOptions(TypeInfo(ConnectorService), [ ioDocument, ioHasNamespace ] );
...
RemClassRegistry.RegisterSerializeOptions(TypeInfo(ArrayType), [xoInlineArrays]);
...


Generated SOAP Request:
<?xml version="1.0" encoding="UTF-8"?>
<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: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:Header xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
      <wsse:Security>
         <wsse:UsernameToken wsu:Id="SecurityToken-{7A73B802-862E-4E54-AD0D-2208D996F91C}">
            <wsse:Username>[Username]</wsse:Username>
            <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">[Password]</wsse:Password>
         </wsse:UsernameToken>
      </wsse:Security>
   </SOAP-ENV:Header>
   <SOAP-ENV:Body>
      <gelenBelgeleriAlExt xmlns="http://service.connector.uut.cs.com.tr/">
         <parametreler>
            <alanEtiket>urn:mail:pk@anaddress.com</alanEtiket>
            <belgeFormati>XML</belgeFormati>
            <belgeTuru>FATURA</belgeTuru>
            <belgeVersiyon>2.0</belgeVersiyon>
            <donusTipiVersiyon>2.0</donusTipiVersiyon>
            <erpKodu>ELK30002</erpKodu>
            <gelisTarihiBaslangic>20170323000000000</gelisTarihiBaslangic>
            <gelisTarihiBitis>20170324103344609</gelisTarihiBitis>
            <gonderenEtiket>urn:mail:pk@anaddress.com</gonderenEtiket>
            <onayDurum>HEPSI</onayDurum>
            <vergiTcKimlikNo>1234567890</vergiTcKimlikNo>
         </parametreler>
      </gelenBelgeleriAlExt>
   </SOAP-ENV:Body>
</SOAP-ENV:Envelope>


I need both work fine. There is an answer by @Scott on [Delphi 2005 Web Services problem |http://stackoverflow.com/questions/1195265/delphi-2005-web-services-problem] but I could not figure out how to apply the solution. eg. What should be the types of the added vars or he said to edit arround line 4181 but my source is diffrent I find the TSOAPDomConv.InitObjectFromSOAP, in the OPToSOAPDomConv unit, but not sure where to put the added lines of

<div class="jive-quote">RemTypeRegistry.InfoToURI(PropList[i].PropType^, NS, PropName, IsScalar);
...
if AttrNode.HasAttribute(ExternalPropName, NS) then
...
SetObjectPropFromText(Instance, PropList[I], AttrNode.GetAttributeNS(ExternalPropName, NS))</div>
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02