Delphi XE2 HTTPRIO Unable to get URL endpoint for service / port

I am converting a Delphi 2007 program to Delphi XE2 and have a problem with the following error message:

Unable to get URL endpoint for service / port "/" from WSDL 'http: // .....'

The service I'm connecting to is written in Delphi 2007.

In 2007, it compiles and runs without problems. On XE2 with the same code, it crashes with an error.

I tried to rename the interface using the new WSDL importer with the default values ​​set, but without joy.

I also tried setting the port and service names and the error persists. Not sure what information is being used, but as far as I can tell, it is connecting.

This is the operation of the method that I use

<operation name="CheckRegistration"> <soap:operation soapAction="urn:ScubaUpdateWSIntf-IScubaUpdateWS#CheckRegistration" style="rpc"/> <input> <soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:ScubaUpdateWSIntf-IScubaUpdateWS"/> </input> <output> <soap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:ScubaUpdateWSIntf-IScubaUpdateWS"/> </output> </operation> 

This post is:

 <message name="CheckRegistration10Request"> <part name="centreId" type="xs:int"/> <part name="centreName" type="xs:string"/> <part name="checkActiveOnly" type="xs:boolean"/> </message> <message name="CheckRegistration10Response"> <part name="return" type="xs:boolean"/> </message> 

Besides importing WSDL, throwing HTTPRIO and calling a method with

 (HTTPRIO1 as IScubaUpdateWS).CheckRegistration(strtoint(tcentre),tcentreName,true); 

I do not think that I am doing anything else, and, as I said, the same code works on Delphi 2007.

+7
source share
1 answer

solved. Well, sort of! It appears that Delphi XE2 finds 2 services, where Delphi 2007 finds one. The program that I use reads the location of the WSDL from the registry and installs it. On Delphi 2007, this is normal because it accepts the only service and does this selected port / service. On Delphi XE2, the WSDL location is reset, which clears the port and service. Thanks @JohnEasley for pointing me in the right direction. To solve, I need to use the following code after changing the location of the WSDL. Not sure if it will work for each of them, as I assume that the first record is the one that is required

 servicenames:=Tdomstrings.Create; portnames:=Tdomstrings.Create; HTTPRIO1.WSDLItems.GetServices(servicenames); if servicenames.count>0 then begin HTTPRIO1.Service:=servicenames[0]; HTTPRIO1.WSDLItems.GetPortsForService(servicenames[0],portnames); if portnames.count>0 then HTTPRIO1.Port:=portnames[0]; end; servicenames.clear; servicenames.Free; portnames.clear; portnames.Free; 

Thanks guys,

+2
source

All Articles