Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 671951
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T00:25:49+00:00 2026-05-14T00:25:49+00:00

I am trying to pass multiple instances of an element to a web servile

  • 0

I am trying to pass multiple instances of an element to a web servile that has the following wsdl

 <complexType name="OAMCommand">
   <sequence>
     <element name="m-strName" type="xsd:string" minOccurs="1" maxOccurs="1"/>
     <element name="m-argVector" type="xsd:string" minOccurs="0" maxOccurs="unbounded"/>
   </sequence>
  </complexType>

This is my code in python for the client

  oamCmdStruct = SOAPpy.structType()
  oamCmdStruct._addItem('m-strName','set-log-level')
  oamCmdStruct._addItem('m-argVector', logLevel)
  oamCmdStruct._addItem('m-argVector', loggerName)
  self.serverConnection.executeCommand({'in-cmd':oamCmdStruct}

Here is the output I get from SOAPpy that gets rejected by the web service, it creates an array for the 2 m-argVector elements.

<xsd:in-cmd>
  <m-strName xsi:type="xsd:string">set-log-level</m-strName>
  <m-argVector SOAP-ENC:arrayType="xsd:string[2]" xsi:type="SOAP-ENC:Array">
    <item>WARN_LOG_LEVEL</item>
    <item>netborder</item>
  </m-argVector>
</xsd:in-cmd>

Here is the output that another client sends that works. No array, just two elements that have the same name.

   <SoapOAM:executeCommand>
      <in-cmd>
        <m-strName>set-log-level</m-strName>
        <m-argVector>ERROR_LOG_LEVEL</m-argVector>
        <m-argVector>netborder.media</m-argVector>
      </in-cmd>
    </SoapOAM:executeCommand>

How can I modify my SOAPpy code to generate the xml output like the one above ?

EDIT:
I tried the following code in python

 oamCmdStruct = SOAPpy.structType( data = {"m-strName":"set-log-level",
                                              "m-argVector": logLevel,
                                              "m-argVector": loggerName})

But this is what the XML output from SOAPpy looked like

<xsd:in-cmd>
  <m-strName xsi:type="xsd:string">set-log-level</m-strName>
  <m-argVector xsi:type="xsd:string">loggerName</m-argVector>
</xsd:in-cmd>

The value for logLevel gets overwritten by loggerName instead of creating 2 entries…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T00:25:49+00:00Added an answer on May 14, 2026 at 12:25 am

    After trying a few different librairies (suds, soaplib), I finally dug into the SOAPpy code.

    In order to remove the arrays from my SOAP requests, I modified the dump_list() function in the SOAPBuilder class of the SOAPpy library.

    # COMMENT: We dont want arrays in SOAP-XML so I commented out the following lines
    # if typed:
    #    self.out.append(
    #        '<%s %sarrayType="%s[%d]" %stype="%sArray"%s%s%s%s%s%s>\n' %
    #        (tag, ens, t, len(data), ins, ens, ndecl, edecl, idecl,
    #         self.genroot(ns_map), id, a))
    
    #if typed:
    #    try: elemsname = obj._elemsname
    #    except: elemsname = "item"
    #else:
    elemsname = tag
    
    for i in data:
        self.dump(i, elemsname, not same_type, ns_map)
    
    #if typed: self.out.append('</%s>\n' % tag)
    

    This change gives me the following output for my SOAP XML request.

    <SOAP-ENV:Body>
    <ns1:executeCommand xmlns:ns1="urn:SoapOAM">
    <xsd:in-cmd>
    <m-strName xsi:type="xsd:string">set-log-level</m-strName>
    <m-argVector>ERROR_LOG_LEVEL</m-argVector>
    <m-argVector>netborder</m-argVector>
    </xsd:in-cmd>
    </ns1:executeCommand>
    </SOAP-ENV:Body>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to write my own protocol so that multiple servers can pass data
I'm trying to pass multiple checkboxes with different values to a PHP script that
I am trying to pass DataTables to a stored procedure that accepts multiple table-valued
I'm trying to pass multiple instances of a sub-class of a model in my
I am trying to pass multiple values for a single field name to an
I am trying to pass multiple options for UIView 's transitionWithView:duration:options:animations:completion: method. More specifically,
I am trying to pass a parameter as text which contains multiple ' -
Trying to pass in a user supplied string which has a path to the
I'm trying to run multiple instances of a node server using a bash script.
I am trying to pass a managedObject from a mapView with multiple annotation to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.