Error in SOAP communication. Lack of tag termination character in XML

7

It took some time to implement communication with SOAP WebServices in legacy applications written in Delphi 6 . The WebServices that I needed to communicate with these systems were written in Delphi (newer versions with unicode) and C # (asax) .

Unfortunately, I was unable to use the components of the Delphi 6 WebServices palette, but I was able to copy all the units from the Delphi 7 WebServices palette and added them to Delphi 6 applications . I needed to make several adjustments.

Communication has worked well. There are still no problems with communicating systems with WebServices available in C # .

The same process performed on several clients works without problems, but this same process has had problems with two or three clients. This is a WebService written with Delphi (in newer versions) .

The error I believe to be specific. In a given request the following exception is thrown:

Itsaysthatitwasnotpossibletofindthecharacterthatcloses/determinestheclosingofatag.Themessagesaysthattheerrorisinline2oftherequest.

Then,ItriedtoparsetheXMLthatisbeinggenerated:

<?xmlversion="1.0"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP ENV="http://schemas.xmlsoap.org/soap/envelope/">
    <SOAP-ENV:Header xmlns:NS1="urn:UntSecurityHeader" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
        <NS1:TSecurityHeader xsi:type="NS1:TSecurityHeader">
            <Identification xsi:type="xsd:string">2C0463C3BFC0DC44385BA3</Identification>
        </NS1:TSecurityHeader>
    </SOAP-ENV:Header>
<SOAP-ENV:Body SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<NS2:Obter xmlns:NS2="urn:UntContracts-IContainerContract">
    <ContainerID xsi:type="xsd:int">0</ContainerID>
    <ContratoID xsi:type="xsd:int">0</ContratoID>
</NS2:Obter>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

This XML, opened by Notepad, copied and pasted here looks exactly like this:

<?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:Header SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:NS1="urn:UntSecurityHeader"><NS1:TSecurityHeader xsi:type="NS1:TSecurityHeader"><Identification xsi:type="xsd:string">2C0463C3BFC0DC44385BA3</Identification></NS1:TSecurityHeader></SOAP-ENV:Header><SOAP-ENV:Body SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><NS2:Obter xmlns:NS2="urn:UntContracts-IContainerContract"><ContainerID xsi:type="xsd:int">0</ContainerID><ContratoID xsi:type="xsd:int">0</ContratoID></NS2:Obter></SOAP-ENV:Body></SOAP-ENV:Envelope>

That is, all in one line.
Opened by IE, it looks like this:

  

I know the image was very small, but I wanted to put it here to appear exactly as it is in IE.

     

Making a ZOOM in the browser allows you to clearly see the content.

I decided to put this image to demonstrate that it is exactly in the second line that IE breaks the text in two lines. I do not know if there is any or if the break is just referring to the formatting of the browser to not exceed the size of the document.

Another detail I would like to add is that when working with the WebService done in Delphi I usually have problems with accentuation, in short, special characters. Already with WebServices in C # this does not happen.

Both WebService suites have been written and published by me.

I tried to manipulate XML by removing line break characters, replacing #13#10 , thinking that it could be a problem of interpretation between character sets. But it did not work either.

I emphasize that in just a few clients, with Windows XP to Seven systems, the problem occurs.

Can it be a character type problem? The strange thing is not to have had this type of problem with the WebServices written in C #.

    
asked by anonymous 25.04.2015 / 01:59

1 answer

1

I may be wrong, but something tells me that the error has to do with how to interpret XML through SOAP since in most machines it works and only some do not. Try updating the protocol on the machines where it does not work. I believe this is the last version: link

    
27.04.2015 / 23:31