Article:
  A PHP Web Services Client
Subject:   Apache Axis
Date:   2003-09-12 11:37:46
From:   anonymous2
Adam, Using the guidelines in this article I am able to connect to web services running on Axis as long as they have simple parameters. My problems are in trying to consume services that take Arrays of Java Structures as parameters. For instance:
in java,
Magazine[] mags = new Magazine[2];
mags[0] = new Magazine("Harpers");
mags[1] = new Magazine("New Yorker");
buySubscriptions(2, mags);
in php,
$magOne = array(
'title' => 'Harpers',
);
$magTwo = array(
'title' => 'New Yorker',
);
$mags[0] = $magOne;
$mags[1] = $magTwo;
$params = array(
'count' => 2,
'mags' => $mags,
);
$response = $client->buySubscriptions($params);


This returns an org.xml.sax.SAXException: No deserializer defined for array type Struct


Any suggestions on how to get this working? Do I need to somehow map the magazine arrays' namespaces?


Thanks,
Ethan

Full Threads Oldest First

Showing messages 1 through 5 of 5.

  • Adam Trachtenberg photo Apache Axis
    2003-09-22 07:58:15  Adam Trachtenberg | O'Reilly Author [View]

    Ethan --

    Off the top of my head, I'm not sure. It would help if you gave me a pointer to the WS so I could try it myself.
    • Apache Axis
      2003-11-04 05:58:45  anonymous2 [View]

      A student of ours is getting that same SAXException when trying to call the following WebService:

      http://www.xmethods.com/ve2/ViewListing.po?key=uuid:49A26366-FD50-DA0B-902A-5C4FD69EC951

      He's used WSDL2Java to try to call the "getLastNews" operation. The next line in the stack trace is "... at org.apache.axis.encoding.ser.ArrayDeserializer.onStartElement(ArrayDeserializer.java:304)", in case that's a useful hint :-)

      Cheers
      /Daniel
    • Apache Axis
      2003-11-04 05:57:31  anonymous2 [View]

      A student of ours is getting that same SAXException when trying to call the following WebService:

      http://www.xmethods.com/ve2/ViewListing.po?key=uuid:49A26366-FD50-DA0B-902A-5C4FD69EC951

      He's used WSDL2Java to try to call the "getLastNews" operation. The next line in the stack trace is "... at org.apache.axis.encoding.ser.ArrayDeserializer.onStartElement(ArrayDeserializer.java:304)", in case that's a useful hint :-)

      Cheers
      /Daniel
    • Apache Axis
      2003-11-04 05:57:00  anonymous2 [View]

      A student of ours is getting that same SAXException when trying to call the following WebService:

      http://www.xmethods.com/ve2/ViewListing.po?key=uuid:49A26366-FD50-DA0B-902A-5C4FD69EC951

      He's used WSDL2Java to try to call the "getLastNews" operation. The next line in the stack trace is "... at org.apache.axis.encoding.ser.ArrayDeserializer.onStartElement(ArrayDeserializer.java:304)", in case that's a useful hint :-)

      Cheers
      /Daniel
    • Apache Axis
      2003-11-04 05:47:24  anonymous2 [View]

      A student of ours is getting that same SAXException when trying to call the following WebService:

      http://www.xmethods.com/ve2/ViewListing.po?key=uuid:49A26366-FD50-DA0B-902A-5C4FD69EC951

      He's used WSDL2Java to try to call the "getLastNews" operation. The next line in the stack trace is "... at org.apache.axis.encoding.ser.ArrayDeserializer.onStartElement(ArrayDeserializer.java:304)", in case that's a useful hint :-)

      Cheers
      /Daniel