SOAP WSDL Formatting (THTTPRIO)

486 Views Asked by At

I'm consuming a SOAP Web Service that requires the text ":com" in some of the tags. For example instead of

<soapenv:Envelope >
    <soapenv:Body>
        <RunSimpleTrip>
            <c>
                <CompanyCode>CompanyCode</CompanyCode>
                <Password>Password</Password>
                <Username>Username</Username>
            </c>
            <BasicTrip>
                <Comments />
                <Driver>Some Driver</Driver>
                <EndOdometer />
                ...
            </BasicTrip>
        </RunSimpleTrip>
    </soapenv:Body>
</soapenv:Envelope>

It needs to be

<soapenv:Envelope >
    <soapenv:Body>
        <RunSimpleTrip>
            <c>
                <com:CompanyCode>CompanyCode</com:CompanyCode>
                <com:Password>Password</com:Password>
                <com:Username>Username</com:Username>
            </c>
            <BasicTrip>
                <com:Comments />
                <com:Driver>Some Driver</com:Driver>
                <com:EndOdometer />
                ...
            </BasicTrip>
        </RunSimpleTrip>
    </soapenv:Body>
</soapenv:Envelope>

Notice how not all the tags need the prefix (like the c or BasicTrip tags). Just the inner ones, the fields of the objects.

Am I stuck with doing a StringReplace on each individual tag, or is there an option I'm missing? Is there some way to toggle the importer or WSDL .pas file to do this by itself?

This is the same question, which received no good answer at the time Delphi HttpRio SOAPHTTPClient does not add a prefix to namespaced variables . And just like the question, when I generate this via soapUI it places the ":com" on the needed tags.

Edit: Here's a snippet of the WSDL that describes a BasicTrip

<xs:complexType name="BaseTrip">
<xs:sequence>
<xs:element name="Comments" nillable="true" type="xs:string"/>
<xs:element name="Driver" nillable="true" type="xs:string"/>
<xs:element name="EndOdometer" type="xs:decimal"/>
<xs:element name="GetMapPoints" type="xs:boolean"/>
...
</xs:sequence>
</xs:complexType>
0

There are 0 best solutions below