structure of a web service published in Business Central

kanikakanika Member Posts: 247
Hi Experts!!

I have published a web service (via a published CU) to import data from an xml in Business Central.

When I see the schema from SOAPUI these two labels appear in the structure that I have highlighted in the attachment

e4ar9l6r0w8i.png

These labels correspond to the published CU function and its parameter

du54pc07i5s9.png

But as you can see, the parameter is "Request" and in the structure it says "request", it is essential for it to work that in the structure put "Request" with the R in uppercase otherwise the web service does not work.

It is something that makes up Business Central and I don't see the option to change it. Has anyone something similar happened to them and know how to solve it?

Thanks!!

(I hope I get lucky with this query because lately I don't see many being resolved ....)

Answers

  • ftorneroftornero Member Posts: 522
    Hello @kanika,

    Yes, that is how NAV/BC works, the parameters in a WS must start with a lowercase.

    Why do you say that is essential the "Request" with uppercase ?

    Regards
  • kanikakanika Member Posts: 247
    because it is the structure that the provider has, it is an external service
  • ftorneroftornero Member Posts: 522
    Hello @kanika,

    Sorry, I'm lost, if it's an external service why do you need to publish a web service ?

    Regards.
  • kanikakanika Member Posts: 247

    It is a payment gateway, they send us the payments in a certain structure to our web service where we import the data
  • ftorneroftornero Member Posts: 522
    Hello @kanika,

    But they send you an XML file or they call your published web service to send the data.

    In the last case they must follow the WSDL that you publish.

    Regards.
  • kanikakanika Member Posts: 247
    No
  • ftorneroftornero Member Posts: 522
    Well I assume that it's not possible they follow your WSDL, so a workaround would be to create an Azure Function for the front end web service and this function would call your BC web service the way is expected.

    Regards.
  • kanikakanika Member Posts: 247
    Ok Thanks tornero.


    I imagine that with the return value it happens exactly the same, right? It is necessary that if it is OK, it is entered in the Status field, however by default BC returns it as "return_value", this cannot be changed either?
    co7erptm9e16.png
  • ftorneroftornero Member Posts: 522
    Hello @kanika,

    If your function return a var then the value is in this tag , but you can do something like this
    procedure Process(var Request: XMLport "PMGW - IN")
    

    In the XMLport define a field call Satus

    xaxhutv5hbkk.png

    In the others XMLport fields add this:

    3cthl15uhj3e.png

    And this would be the response:

    zjwel02obcvp.png



    Regards.
  • kanikakanika Member Posts: 247
    edited 2021-04-06
    My function returns a text var called result


    eul8meqgy14i.png
  • ftorneroftornero Member Posts: 522
    Hello @kanika,

    Yes, I know, but I was saying to remove the result return and add the var to the XMLport so you can return the Status.

    Regards.
  • kanikakanika Member Posts: 247
    OK Thanks for all!!
Sign In or Register to comment.