Passing array for maxOccurs="unbounded"

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • psokulski@gmail.com

    #1

    Passing array for maxOccurs="unbounded"

    I have problem with passing parameters for web service.
    Address for WSDL 'http://www.odfl.com/RateWeb/wsdl/com/odfl/ws/
    rateestimate/RateEstimate.ws dl'.
    Im trying to call calculateRate in wsdl there are three elements with
    maxOccurs="unbu nded" when i'm trying to pass them as array i receive
    error "org.xml.sax.SA XException: WSWS3084E: Error: SimpleDeseriali zer
    encountered a child element, which is NOT expected, in something it
    was trying to deserialize. Message being parsed: "
    If i pass it as single value a receive normal response with error
    codes because for each element 5 values are required.
    I've tried PEAR::SOAP and nuSOAP changing style or transport is not
    working either.

  • Toby A Inkster

    #2
    Re: Passing array for maxOccurs=&quot ;unbounded&quot ;

    psokulski wrote:
    I have problem with passing parameters for web service.
    Address for WSDL 'http://www.odfl.com/RateWeb/wsdl/com/odfl/ws/
    rateestimate/RateEstimate.ws dl'.
    I can't see anything wrong with the WSDL file. Post your code.

    --
    Toby A Inkster BSc (Hons) ARCS
    [Geek of HTML/SQL/Perl/PHP/Python/Apache/Linux]
    [OS: Linux 2.6.12-12mdksmp, up 115 days, 15:37.]

    dict, thes & ency

    Comment

    • psokulski@gmail.com

      #3
      Re: Passing array for maxOccurs=&quot ;unbounded&quot ;

      I can't see anything wrong with the WSDL file. Post your code.

      Problem was that when weights was passed as array:

      Array( "param1" ="XYZ" ,
      "param2" ="123" ,
      "weights" =Array("555" , "0" , "0" , "0" , "0"))

      in xml file send to server it was:

      <weights>
      <item>555</item>
      <item>0</item>
      <item>0</item>
      <item>0</item>
      <item>0</item>
      </weights>

      instead of

      <weights>555</weights>
      <weights>0</weights>
      <weights>0</weights>
      <weights>0</weights>
      <weights>0</weights>

      i worked it around instead of using SOAP_Client i use SOAP_Transport
      and pass XML file as parameter.
      But maybe there is some other way to do it

      >
      --
      Toby A Inkster BSc (Hons) ARCS
      [Geek of HTML/SQL/Perl/PHP/Python/Apache/Linux]
      [OS: Linux 2.6.12-12mdksmp, up 115 days, 15:37.]
      >
      dict, thes & ency
      http://tobyinkster.co.uk/blog/2007/0...ict-thes-ency/

      Comment

      Working...