This content has been marked as final.
Show 2 replies
-
1. Re: Return a String[] from a WebService using NetBeans Ide
thomas.diesler Dec 2, 2005 3:37 AM (in response to luigi.tascapani)The way to think about this goes like this:
1) Take a service endpoint interface (SEI)public interface MyEndpoint { String[] echoStringArray(String[] v) }
2) Run a tool that generates wsdl + schema + mapping<complexType name="StringArray"> <sequence> <element name="value" type="string" nillable="true" minOccurs="0" maxOccurs="unbounded"/> </sequence> </complexType> <message name=echoStringArray"> <part name="arrayOfString_1" type="ns3:StringArray"/> </message> <message name="MarshallRpcServiceInterface_echoStringArrayResponse"> <part name="result" type="ns3:StringArray"/> </message>
3) Look for the java mapping for that array type<java-xml-type-mapping> <java-type>somepackage.StringArray</java-type> <root-type-qname xmlns:typeNS="{urn:NewWebService/types/arrays/java/lang}StringArray ">typeNS:StringArray</root-type-qname> <qname-scope>complexType</qname-scope> <variable-mapping> <java-variable-name>stringArr</java-variable-name> <xml-element-name>stringArr</xml-element-name> </variable-mapping> </java-xml-type-mapping>
4) Make sure the wrapper type is in your deployment
If you run wscompile with -keep, it keeps the generated java types
You could also have a look attdiesler@satellite /cygdrive/d/projects/jboss-branch/jboss-4.0.x/testsuite $ ant -Dtest=webservice/marshalltest test test: [junit] Running org.jboss.test.webservice.marshalltest.MarshallDocLiteralTestCase [junit] Tests run: 31, Failures: 0, Errors: 0, Time elapsed: 46.777 sec [junit] Running org.jboss.test.webservice.marshalltest.MarshallRpcEncodedTestCase [junit] Tests run: 31, Failures: 0, Errors: 0, Time elapsed: 22.352 sec [junit] Running org.jboss.test.webservice.marshalltest.MarshallRpcLiteralTestCase [junit] Tests run: 31, Failures: 0, Errors: 0, Time elapsed: 21.481 sec
These tests marshall String[] as well -
2. Re: Return a String[] from a WebService using NetBeans Ide
luigi.tascapani Dec 5, 2005 2:11 PM (in response to luigi.tascapani)Thank's, i'll try the -kepp option, it's interesting.. to solve rapidely my problem I've made a MyStringArray class that contains a field value of type String[] and a get/set method. MyStringArray extends Serializable, and it works.
The problem is that WebService and all xml files to configure are so complexxx and I haven't so much time in these days.. But finaly i did it,
thanx
good bye