Unfortunately I have NDA issues preventing me from posting the wsdl. And I don’t have control over the c# web service I’m consuming. I have included as much detail of the what I’m observing and how I’ve corrected the situation. My questions are at the bottom.
ISSUE #1:
I have solved my XML difference issue and found a new issue in the action attribute of the post. With regards to the xml envelope, the web service simply wants to see the addition of the following attribute in the envelope and 2 nodes in the header:
attribute:
xmlns:a=“http://www.w3.org/2005/08/addressing”
nodes:
a:Action
http://Thermo.Connect/IHCSConnect/Ping
/a:Action
a:To
http://thermo-pc:2021/WSHCSConnect
/a:To
So I simply have added them manually into the envelope using the MessageEnvelopeComplete event.
ISSUE #2:
During my testing I have made a working call using HttpSendRequest and building the whole thing myself. Using this and a packet sniffer I have narrowed down my issue to a one thing. The soap action value being sent is not in acceptable format to the service. This unacceptable format is: urn:HCSConnect-WSHCSConnect#Ping
The fSoapAction value is set correctly from the wsdl values but then it is cleared
due to the fact that LibraryName, MessageName, and InterfaceName are blank strings. Then when the fSoapAction is blank, the above non-functional entry is added.
So now I have added the following code so the soap action is not cleared, and the value from the wsdl is used to call the C# service:
var
con: IWSHCSConnect;
begin
Channel.Connected := True;
with MyMessage do
begin
LibraryName := ‘HCSConnect’;
MessageName := ‘Ping’;
InterfaceName := ‘WSHCSConnect’;
end;
con := CoWSHCSConnect.Create(MyMessage, Channel);
con.Ping(nil);
…and I also had to change the generated _Intf file and add quotes to the action value in the ping function like this:
function TWSHCSConnect_Proxy.Ping(const Ping: Ping): UnicodeString;
begin
…
lMessage.SetAttributes(lTransportChannel, [‘Action’, … ] ,
[’“http://Thermo.Connect/IHCSConnect/Ping”’, …]);
…
end;
RESULT:
Attached text file has the post that works generated from rem obj. Of specific important is the soap action specified in the post parameters.
QUESTIONS:
Obviously the code to correct these issues is not extensive, but the investigation process was. Also, the reason to use these import libraries for web services is to avoid all the manual changes. Otherwise I can simply make the calls directly using HttpSendRequest, which I did during my R&D of this issue. Thinking I may have taken the long route due to not being very familiar RemObj here are my questions.
Issue #1 question:
Is there a way to have rem objects components add the necessary lines automatically instead of me having to manually do this in an event?
Issue #2 question:
a) Should not these values also be loaded into the message object by the information in the wsdl? And if not is there a property or method that would do this for me?
b) Is there a way to tell rem objects to add quotes to the action attribute so the result looks as the following
“http://Thermo.Connect/IHCSConnect/Ping”
instead of
http://Thermo.Connect/IHCSConnect/Ping
since the one without the quotes does not work…