I have tried creating an object programatically and sending it... I get the same error.
I am using an "out-of-the-box" installation of Apache Axis 1.2.1... separate webapp from the Flex client. I don't need to register any custom serializers/deserialzers for Flex, do I? Here is my WSDL. Thanks again for taking a look at this... -Tim. [wsdl] <?xml version="1.0" encoding="UTF-8"?> <wsdl:definitions targetNamespace="http://localhost:7001/sampling-ws/services/FooService" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://localhost:7001/sampling-ws/services/FooService" xmlns:intf="http://localhost:7001/sampling-ws/services/FooService" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns1="urn:Dominion" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <!--WSDL created by Apache Axis version: 1.2 Built on May 03, 2005 (02:20:24 EDT)--> <wsdl:types> <schema targetNamespace="http://localhost:7001/sampling-ws/services/FooService" xmlns="http://www.w3.org/2001/XMLSchema"> <import namespace="urn:Dominion"/> <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/> <complexType name="ArrayOf_xsd_anyType"> <complexContent> <restriction base="soapenc:Array"> <attribute ref="soapenc:arrayType" wsdl:arrayType="xsd:anyType[]"/> </restriction> </complexContent> </complexType> </schema> <schema targetNamespace="urn:Dominion" xmlns="http://www.w3.org/2001/XMLSchema"> <import namespace="http://localhost:7001/sampling-ws/services/FooService"/> <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/> <complexType name="Foo"> <sequence> <element name="bars" nillable="true" type="impl:ArrayOf_xsd_anyType"/> <element name="id" nillable="true" type="soapenc:long"/> <element name="name" nillable="true" type="soapenc:string"/> </sequence> </complexType> </schema> </wsdl:types> <wsdl:message name="saveFooResponse"> <wsdl:part name="saveFooReturn" type="soapenc:long"/> </wsdl:message> <wsdl:message name="getFooResponse"> <wsdl:part name="getFooReturn" type="tns1:Foo"/> </wsdl:message> <wsdl:message name="saveFooRequest"> <wsdl:part name="foo" type="tns1:Foo"/> </wsdl:message> <wsdl:message name="getFooRequest"> </wsdl:message> <wsdl:portType name="FooService"> <wsdl:operation name="getFoo"> <wsdl:input message="impl:getFooRequest" name="getFooRequest"/> <wsdl:output message="impl:getFooResponse" name="getFooResponse"/> </wsdl:operation> <wsdl:operation name="saveFoo" parameterOrder="foo"> <wsdl:input message="impl:saveFooRequest" name="saveFooRequest"/> <wsdl:output message="impl:saveFooResponse" name="saveFooResponse"/> </wsdl:operation> </wsdl:portType> <wsdl:binding name="FooServiceSoapBinding" type="impl:FooService"> <wsdlsoap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/> <wsdl:operation name="getFoo"> <wsdlsoap:operation soapAction=""/> <wsdl:input name="getFooRequest"> <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://test.sampling.dom.com" use="encoded"/> </wsdl:input> <wsdl:output name="getFooResponse"> <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://localhost:7001/sampling-ws/services/FooService" use="encoded"/> </wsdl:output> </wsdl:operation> <wsdl:operation name="saveFoo"> <wsdlsoap:operation soapAction=""/> <wsdl:input name="saveFooRequest"> <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://test.sampling.dom.com" use="encoded"/> </wsdl:input> <wsdl:output name="saveFooResponse"> <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://localhost:7001/sampling-ws/services/FooService" use="encoded"/> </wsdl:output> </wsdl:operation> </wsdl:binding> <wsdl:service name="FooServiceService"> <wsdl:port binding="impl:FooServiceSoapBinding" name="FooService"> <wsdlsoap:address location="http://localhost:7001/sampling-ws/services/FooService"/> </wsdl:port> </wsdl:service> </wsdl:definitions> >From: "Matt Chotin" <[EMAIL PROTECTED]> >Reply-To: [email protected] >To: <[email protected]> >Subject: RE: [flexcoders] array blows up when passing to webservice >Date: Sun, 26 Jun 2005 21:10:48 -0700 > >I'm not sure if the error was in the deserialization or the >serialization back out. What happens if you try to create the object >for sending from scratch on the AS side? Also can you post the WSDL >that gets generated for this class? I did see another bug the other day >when we didn't seem to serialize an array correctly, but in this case it >seems like the whole thing is messed up, not just the array. > > > >Matt > > > >________________________________ > >From: [email protected] [mailto:[EMAIL PROTECTED] On >Behalf Of Tim Dwelle >Sent: Friday, June 24, 2005 7:24 AM >To: [email protected] >Subject: [flexcoders] array blows up when passing to webservice > > > >I am trying to communicate with a Java webservice implemented using >Apache >Axis. It has been working fine, until I tried sending an object with an > >array property. When I call the webservice passing the array, I get the >following error: > >org.xml.sax.SAXParseException: Element "xmlns:soapenc"cannot have >"xmlns" as >its prefix. > >I checked to make sure it wasn't an array.length = 1 issue... now I'm >just >stumped. On the surface, it looks like Flex is not generating a valid >SOAP >call to the webservice. > >Below I have provided the Flex & Java code for a simplified example of >the >problem. The code has 2 buttons: 'Get Foo' which calls the webservice >to >get a Foo object, and a 'Save Foo', which simply passes that Foo >instance >back to the webservice. It blows up when you click 'Save Foo'. > >I also have captured the SOAP traffic between client & server. > >Any help would be appreciated. > >Thanks in advance, > >-Tim. > > > >[Foo.java] > >package com.dom.sampling.test; > >import java.io.*; >import java.util.*; > >public class Foo implements Serializable >{ > private Long id; > private String name; > private Set bars; > > public Long getId() { return id; } > > public void setId(Long id) { this.id = id; } > > public String getName() { return name; } > > public void setName(String name) { this.name = name; } > > public Set getBars() { return bars; } > > public void setBars(Set bars) { this.bars = bars; } >} > > >[Bar.java] > >package com.dom.sampling.test; > >import java.io.*; > >public class Bar implements Serializable >{ > private Long id; > private String name; > > public Long getId() { return id; } > > public void setId(Long id) { this.id = id; } > > public String getName() { return name; } > > public void setName(String name) { this.name = name; } >} > > >[FooService.java] > >package com.dom.sampling.test; > >import java.util.*; >import java.util.*; > >public class FooService >{ > public Foo getFoo() > { > Bar bar1 = new Bar(); > bar1.setId(new Long(1)); > bar1.setName("bar1"); > > Bar bar2 = new Bar(); > bar2.setId(new Long(2)); > bar2.setName("bar2"); > > Set barSet = new HashSet(); > barSet.add(bar1); > barSet.add(bar2); > > Foo foo = new Foo(); > foo.setId(new Long(1)); > foo.setName("foo"); > foo.setBars(barSet); > > return foo; > } > > > public Long saveFoo(Foo foo) > { > Set bars = foo.getBars(); > System.out.println("size = " + bars.size()); > return new Long(1); > } >} > > >[Foo.as] > >class com.dom.sampling.test.Foo >{ > public function Foo() > { > _remoteClass = "com.dom.sampling.test.Foo"; > } > > // properties > public var id : Number; > public var name : String; > public var bars : Array = new Array(); > > // remoting > public var _remoteClass : String; > private static var doRegister : Boolean = >Object.registerClass("com.dom.sampling.test.Foo", Foo); >} > > >[Bar.as] > >class com.dom.sampling.test.Bar >{ > public function Bar() > { > _remoteClass = "com.dom.sampling.test.Bar"; > } > > // properties > public var id : Number; > public var name : String; > > // remoting > public var _remoteClass : String; > private static var doRegister : Boolean = >Object.registerClass("com.dom.sampling.test.Bar", Bar); >} > > >[Test.mxml] > ><mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml" > xmlns:dom="*"> > > <mx:WebService id="service" > wsdl="/sampling-ws/services/FooService?wsdl" > showBusyCursor="true"> > > <mx:operation name="getFoo" > result="model = event.result"/> > > <mx:operation name="saveFoo" > >result="mx.controls.Alert.show('result='+event.result)"/> > </mx:WebService> > > <mx:Script> > <![CDATA[ > var model: com.dom.sampling.test.Foo; > ]]> > </mx:Script> > > <mx:Button label="Get Foo" click="service.getFoo()"/> > > <mx:Button label="Save Foo" click="service.saveFoo(model)"/> > ></mx:Application> > > > >[getFoo() request] > > >POST /sampling-ws/services/FooService HTTP/1.1 > >Accept: */* > >x-flash-version: 7,0,19,0 > >User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR >1.1.4322) > >Connection: Keep-Alive > >Cache-Control: no-cache > >Content-Type: text/xml; charset=utf-8 > >SOAPAction: "" > >Host: 127.0.0.1 > >Cookie: $Version=0; >JSESSIONID=C8RMvp219rrF8SQPrLFs5bLM0Cv54SxcTXC29PqRZdng1MLwPfBQ!-1472445 >939 > >Content-Length: 388 > > > ><?xml version="1.0" encoding="utf-8"?><SOAP-ENV:Envelope >xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >xmlns:xsd="http://www.w3.org/2001/XMLSchema" >xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Bod >y >xmlns:ns1="http://test.sampling.dom.com"><ns1:getFoo >SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" >/></SOAP-ENV:Body></SOAP-ENV:Envelope> > > >[getFoo() response] > > ><?xml version="1.0" encoding="utf-8"?><soapenv:Envelope >xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" >xmlns:xsd="http://www.w3.org/2001/XMLSchema" >xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> ><soapenv:Body> > <ns1:getFooResponse >soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" >xmlns:ns1="http://test.sampling.dom.com"> > <getFooReturn href="#id0"/> > </ns1:getFooResponse> > <multiRef id="id0" soapenc:root="0" >soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" >xsi:type="ns2:Foo" >xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" >xmlns:ns2="urn:Dominion"> > <bars href="#id1"/> > <id href="#id2"/> > <name xsi:type="soapenc:string">foo</name> > </multiRef> > <multiRef id="id1" soapenc:root="0" >soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" >soapenc:arrayType="xsd:anyType[2]" xsi:type="soapenc:Array" >xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"> > <multiRef href="#id3"/> > <multiRef href="#id4"/> > </multiRef> > <multiRef id="id2" soapenc:root="0" >soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" >xsi:type="soapenc:long" >xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">1</multiRef> > <multiRef id="id3" soapenc:root="0" >soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" >xsi:type="ns3:Bar" xmlns:ns3="urn:Dominion" >xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"> > <id href="#id5"/> > <name xsi:type="soapenc:string">bar2</name> > </multiRef> > <multiRef id="id4" soapenc:root="0" >soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" >xsi:type="ns4:Bar" xmlns:ns4="urn:Dominion" >xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"> > <id href="#id6"/> > <name xsi:type="soapenc:string">bar1</name> > </multiRef> > <multiRef id="id6" soapenc:root="0" >soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" >xsi:type="soapenc:long" >xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">1</multiRef> > <multiRef id="id5" soapenc:root="0" >soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" >xsi:type="soapenc:long" >xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">2</multiRef> ></soapenv:Body> ></soapenv:Envelope> > > >[saveFoo() request] > >POST /sampling-ws/services/FooService HTTP/1.1 > >Accept: */* > >x-flash-version: 7,0,19,0 > >User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR >1.1.4322) > >Connection: Keep-Alive > >Cache-Control: no-cache > >Content-Type: text/xml; charset=utf-8 > >SOAPAction: "" > >Host: 127.0.0.1 > >Cookie: $Version=0; >JSESSIONID=C8RMvp219rrF8SQPrLFs5bLM0Cv54SxcTXC29PqRZdng1MLwPfBQ!-1472445 >939 > >Content-Length: 1707 > > > ><?xml version="1.0" encoding="utf-8"?><SOAP-ENV:Envelope >xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >xmlns:xsd="http://www.w3.org/2001/XMLSchema" >xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Bod >y >xmlns:ns1="http://test.sampling.dom.com"><ns1:saveFoo >SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><foo >xsi:type="ns2:Foo" xmlns:ns2="urn:Dominion"><bars >soapenc:arrayType="xsd:anyType[2]" >xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" >xsi:type="soapenc:Array"><item xsi:type="xsd:anyType"><xmlns:soapenc >xsi:type="xsd:string">http://schemas.xmlsoap.org/soap/encoding/</xmlns:s >oapenc><xmlns:ns3 >xsi:type="xsd:string">urn:Dominion</xmlns:ns3><xsi:type >xsi:type="xsd:string">ns3:Bar</xsi:type><soapenv:encodingStyle >xsi:type="xsd:string">http://schemas.xmlsoap.org/soap/encoding/</soapenv >:encodingStyle><soapenc:root >xsi:type="xsd:string">0</soapenc:root><name >xsi:type="xsd:string">bar2</name><id >xsi:type="xsd:string">id3</id></item><item >xsi:type="xsd:anyType"><xmlns:soapenc >xsi:type="xsd:string">http://schemas.xmlsoap.org/soap/encoding/</xmlns:s >oapenc><xmlns:ns4 >xsi:type="xsd:string">urn:Dominion</xmlns:ns4><xsi:type >xsi:type="xsd:string">ns4:Bar</xsi:type><soapenv:encodingStyle >xsi:type="xsd:string">http://schemas.xmlsoap.org/soap/encoding/</soapenv >:encodingStyle><soapenc:root >xsi:type="xsd:string">0</soapenc:root><name >xsi:type="xsd:string">bar1</name><id >xsi:type="xsd:string">id4</id></item></bars><id xsi:type="ns3:long" >xmlns:ns3="http://schemas.xmlsoap.org/soap/encoding/">1</id><name >xsi:type="ns4:string" >xmlns:ns4="http://schemas.xmlsoap.org/soap/encoding/">foo</name></foo></ >ns1:saveFoo></SOAP-ENV:Body></SOAP-ENV:Envelope> > > >[saveFoo() response] > > ><?xml version="1.0" encoding="utf-8"?><soapenv:Envelope >xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" >xmlns:xsd="http://www.w3.org/2001/XMLSchema" >xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> ><soapenv:Body> > <soapenv:Fault> > <faultcode>soapenv:Server.userException</faultcode> > <faultstring>org.xml.sax.SAXParseException: Element >"xmlns:soapenc" cannot have "xmlns" as its >prefix.</faultstring> > <detail> > <ns1:hostname >xmlns:ns1="http://xml.apache.org/axis/">L110024794</ns1:hostname> > </detail> > </soapenv:Fault> ></soapenv:Body> ></soapenv:Envelope> > > > > >-- >Flexcoders Mailing List >FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt >Search Archives: >http://www.mail-archive.com/flexcoders%40yahoogroups.com > > > > >________________________________ > >Yahoo! Groups Links > >* To visit your group on the web, go to: > http://groups.yahoo.com/group/flexcoders/ > >* To unsubscribe from this group, send an email to: > [EMAIL PROTECTED] ><mailto:[EMAIL PROTECTED]> > >* Your use of Yahoo! Groups is subject to the Yahoo! Terms of >Service <http://docs.yahoo.com/info/terms/> . > -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/

