Jump to content
TrevorS

WSDL Importer has done a great job, however, the request needs one more change ...

Recommended Posts

Posted (edited)

The Delphi WSDL Importer has done an impressive job of taking a (local) WSDL file and generating some very useful code (that almost works!)

 

To debug, I have looked at the outgoing request with Fiddler, and based on this, I've been able to alter the WSDL file to effect a required change in the request header.

However, the problem remains that Delphi is generating a tag with "NAV_CustomerItemPriceV1" but the server needs "ReadMultiple" - ( which seems sensible of Delphi as the resource that it uses is called NAV_CustomerItemPriceV1)

 

Despite further manual changes to the WSDL and to the code generated by Delphi, I can't force a change in this tag. I have seen posts where people have suggested intercepting the XML, but I'm not sure how to do this (or how to access the events on THTTPRIO)

 

TIA

 

Incorrect:

<NAV_CustomerItemPriceV1 xmlns="http://tempuri.org/">
      <customerNo>account_no</customerNo>
      <apiKey>api_key</apiKey>
      <itemList>
        <Item No="T14727IO" xmlns="urn:microsoft-dynamics-nav/xmlports/NAV_CustomerItemPriceV1" />
        <Item No="ZT62062-T1E0100Z" xmlns="urn:microsoft-dynamics-nav/xmlports/NAV_CustomerItemPriceV1" />
      </itemList>
</NAV_CustomerItemPriceV1>

 

Correct:

<ReadMultiple xmlns="http://tempuri.org/">
      <customerNo>account_no</customerNo>
      <apiKey>api_key</apiKey>
      <itemList>
        <Item No="T14727IO" xmlns="urn:microsoft-dynamics-nav/xmlports/NAV_CustomerItemPriceV1" />
        <Item No="ZT62062-T1E0100Z" xmlns="urn:microsoft-dynamics-nav/xmlports/NAV_CustomerItemPriceV1" />
      </itemList>
</ReadMultiple>

 

 

Edited by TrevorS
Identify Delphi Version

Share this post


Link to post
Posted (edited)

I found the answer in this post https://en.delphipraxis.net/topic/2258-need-help-adding-namespaces-to-soap/

 

InvRegistry.RegisterMethodInfo(TypeInfo(NAV_ExportCustomerItemPriceV1Soap), 'NAV_CustomerItemPriceV1', 'ReadMultiple',
                                 '[ReturnName="NAV_CustomerItemPriceV1Result"]', IS_OPTN);

Params are:

TypeInfo,
InternalName,
ExternalName,
ReturnName,
XMLOptions

 Setting ExternalName appears to have fixed it :classic_biggrin:

 

 

Edited by TrevorS
Spelling
  • Like 2
  • Thanks 1

Share this post


Link to post

Another way is to create a dll in VS Community edition, expose a few pertinent functions and stitch using CrossTalk or Hydra or your own code.

My experience of Delphi WDSL Importer is VERY old, but back when, after solving one problem, three more arose. Exponential problem graph, very very sad efficiency graph.

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

×