Jump to content
ertank

SOAP, slightly change request XML

Recommended Posts

Hello,

 

I am using Delphi 10.3.3 and trying to consume a SOAP web service method.

 

Wsdl that I need to use is below:

https://dev.gittigidiyor.com:8443/listingapi/ws/IndividualSaleService?wsdl

 

Delphi 10.3.3 successfully imports that wsdl page. Imported unit generates an output XML for "getPagedSales" method as following (included only relevant parts of XML):

<?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>
		<getPagedSales xmlns="http://sale.individual.ws.listingapi.gg.com">

When same wsdl is imported using SOAP-UI application, generated sample request output starting as following:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sale="http://sale.individual.ws.listingapi.gg.com">
   <soapenv:Header/>
   <soapenv:Body>
      <sale:getPagedSales>
 

If you look closely and compare both, the SOAP-UI generated XML, envelope has "sale" in it as well as method name is put after "sale".

 

My problem is that web service is not accepting Delphi request and returning an error as following:

<env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'>
	<env:Header/>
	<env:Body>
		<env:Fault xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'>
			<faultcode>env:Client</faultcode>
			<faultstring>Endpoint {http://application.anonymous.ws.listingapi.gg.com}ApplicationServicePort does not contain operation meta data for: {http://sale.individual.ws.listingapi.gg.com}getPagedSales</faultstring>
		</env:Fault>
	</env:Body>
</env:Envelope>

 

My question is: Is it possible to modify wsdl imported unit in a way so that out of the box SOAP adds that "sale" in relevant places of requests not just for getPagedSale mothod, but for all sale service methods?

 

I know it is possible to use THTTPRIO.OnBeforeExecute() and send identical XML to that of SOAP-UI generated (which web service will be accepting). However, I am just trying to avoid that if it is possible.

 

Thanks & Regards,

Ertan

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×