node-soap icon indicating copy to clipboard operation
node-soap copied to clipboard

Add custom name spaces while defining args body

Open sharmam-caremonitor opened this issue 6 months ago • 7 comments

When I am passing args to create method namespaces are wrongly getting rendered . Is there any way to provide namespaces in json request body

sharmam-caremonitor avatar Jun 03 '25 02:06 sharmam-caremonitor

Also any possibility to add custom attributes in xml

sharmam-caremonitor avatar Jun 03 '25 02:06 sharmam-caremonitor

@sharmam-caremonitor maybe please provide some examples and use cases? There are potentially some relevant PRs for this, but I may be wrong:

  • #1208
  • #1189
  • #1151
  • #1095 Is this something you are talking about?

smokhov avatar Jun 03 '25 06:06 smokhov

@smokhov <ns3:Query id="14d4debf-8f97-4251-9a74-a90016b0af0d"> <ns3:Slot name="$XDSDocumentEntryPatientId">

How add id and name coming in body

sharmam-caremonitor avatar Jun 03 '25 06:06 sharmam-caremonitor

@smokhov Also to add custom name space which by default are not coming

<ns6:AdhocQueryRequest xmlns="http://abc.net/Elements/1.0"
   xmlns:ns2="http://www.w3.org/2000/09/xmldsig#"
   xmlns:ns3="urn:oasis:names:txxx-xxxx:xx:xxx:3.0"
   xmlns:ns4="urn:oasis:xxx:tc1:ebxml-regrep:xxxx:rs:3.0"
   xmlns:ns5="urn:oasis:xxxx:tc1:xxxx-xxxx:xsd:xxx:3.0"
   xmlns:ns6="urn:oasis:names:tc4:xxxx-xxxxx:xsd:xxxx:3.0">
<ns3:Query id="14d4debf-8f97-xxxx-9a74-xxx0016b0af0d"> <ns3:Slot name="$XDSDocumentEntryPatientId">

sharmam-caremonitor avatar Jun 03 '25 06:06 sharmam-caremonitor

@smokhov Thanks for the support but please help in get extra attributes and custom namespaces added to body xml as they are not getting rendered using attributes mentioned in Read me

Also samples provided for json params are looking for json object but how to define attributes with params supposed to come in body

Like params

{ "ABC" : {"EFG" : [ {"Test1" : "123"}, {"Test2" : "123"}]

xml expected

<ns2:ABC >
       <ns3: EFG id = "1234444" >
         <ns3: Test1 name ="$XDSDocumentEntryPatientId">
         <ns3: Test2 name ="$XDSDocumentEntryTest"></ns3: EFG  >
</ns3: ABC  >

Also n3 namepace value is not in xml

sharmam-caremonitor avatar Jun 03 '25 06:06 sharmam-caremonitor

So some of these PRs I listed address this. I hope @w666 can prioritize getting them in.

smokhov avatar Jun 03 '25 17:06 smokhov

I don't think I understand the problem, sorry. Could you provide WSDL, code snippets, what are you expecting and what result are you actually getting.

w666 avatar Jun 04 '25 08:06 w666

The recent PR #1313 actually seems also relevant here. Ideally, need to complete request/response messages and WSDL to test, so they could be put here:

  • https://github.com/vpulim/node-soap/tree/master/test/request-response-samples

similarly to the recently added:

  • https://github.com/vpulim/node-soap/tree/master/test/request-response-samples/IndienenBericht__should_work_with_deeply_nested_XML_messages

smokhov avatar Aug 09 '25 01:08 smokhov

@sharmam-caremonitor -- please check the recent release 1.3.0 if it solves your problem described here. The following PRs have been merged since, in particular the first one may address what you are asking for:

  • #1313
  • #1316
  • #1296
  • #1219

This example test is probably the closest to what you were needing: https://github.com/vpulim/node-soap/tree/master/test/request-response-samples/IndienenBericht__should_work_with_deeply_nested_XML_messages

If 1.3.0 does not work for you, please provide similar sample files to the above to reproduce. Make sure you set the proper wsdl_options.

@w666 -- I think can otherwise close this issue.

smokhov avatar Aug 13 '25 15:08 smokhov

yeah, I think this one should be closed and new one created if problem is still there.

w666 avatar Aug 17 '25 08:08 w666