Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Found the solution. It's multiple parts and requires a few changes to the C# side, more to the Delphi side. Note that this was tested with Delphi 2007 and Visual Studio 2008.</p> <p>C# side: Use BasicHttpBinding rather than WSHttpBinding.</p> <p><strong>Fix Step 1</strong></p> <pre><code>BasicHttpBinding myBinding = new BasicHttpBinding(); myBinding.Security.Mode = BasicHttpSecurityMode.None; </code></pre> <p>This change will resolve the application/soap+xml errors on the Delphi side.</p> <p>Delphi 2007 side: Running against the modified C# web service will now generate errors like this:</p> <blockquote> <p>Exception class ERemotableException with message 'The message with Action '' cannot be processed at the receiver, due to a ContractFilter mismatch at the EndpointDispatcher. This may be because of either a contract mismatch (mismatched Actions between sender and receiver) or a binding/security mismatch between the sender and the receiver. Check that sender and receiver have the same contract and the same binding (including security requirements, e.g. Message, Transport, None).'</p> </blockquote> <p>To resolve this problem, add SOAPActions to all your supported interfaces. Here's the example from my code; this must be done AFTER all of the InvRegistry changes made by the import-from-WSDL-PAS-file's initialization section:</p> <p><strong>Fix Step 2</strong></p> <pre><code>InvRegistry.RegisterDefaultSOAPAction(TypeInfo(IVMProvisionCore), 'http://Cisco.VMProvision.Core/CoreServices/%operationName%'); </code></pre> <p>The type name and URL should be obtainable from the Delphi generated import file from the WSDL and/or an inspection of the actual WSDL. The above example was for my own project. After these code changes, then you'll the error:</p> <blockquote> <p>Exception class ERemotableException with message 'The formatter threw an exception while trying to deserialize the message: Error in deserializing body of request message for operation....</p> </blockquote> <p>This error is resolved by adding the following code (credits to <a href="http://www.bobswart.nl/weblog/Blog.aspx?RootId=5:798" rel="nofollow noreferrer">http://www.bobswart.nl/weblog/Blog.aspx?RootId=5:798</a>). Again, this new code must be after all the InvRegistry stuff in the initialization of the WSDL-to-PAS file.</p> <p><strong>Fix Step 3</strong></p> <pre><code>InvRegistry.RegisterInvokeOptions(TypeInfo(IVMProvisionCore), ioDocument); </code></pre> <p>At this point, packets will go back and forth between Delphi and C# - but parameters won't work properly. The C# will receive all parameters as nulls and Delphi doesn't seem to be receiving response parameters properly. The final code step is to use a slightly customized THTTPRIO object that will allow for literal parameters. The trick to this part is to make sure that the option is applied AFTER the interface has been obtained; doing it before won't work. Here's the code from my example (just snippets).</p> <p><strong>Fix Step 4</strong></p> <pre><code>var R: THTTPRIO; C: IVMProvisionCore; begin R:= THTTPRIO.Create(NIL); C:= GetIVMProvisionCore(False, TheURL, R); R.Converter.Options:= R.Converter.Options + [soLiteralParams]; </code></pre> <p>And now - my Delphi 2007 app can talk to the C#, stand-alone, non-IIS, WCF web service!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload