[jboss-user] [JBossWS] - "ArrayOf" parameter types generating BindingExceptions

acxjbertr do-not-reply at jboss.com
Tue Jun 19 14:04:44 EDT 2007


I am using a "Top Down" (aka wsdl-to-java) approach to create a JSR109 endpoint with JBossWS 1.2.1.GA.

The WSDL that was provided to me contains things like:

  |       <s:complexType name="FieldSelection">
  |         <s:sequence>
  |           <s:element minOccurs="0" maxOccurs="1" name="FieldName" type="s:string" />
  |           <s:element minOccurs="0" maxOccurs="1" name="Values" type="tns:ArrayOfString" />
  |         </s:sequence>
  |       </s:complexType>
  |       <s:complexType name="ArrayOfString">
  |         <s:sequence>
  |           <s:element minOccurs="0" maxOccurs="unbounded" name="string" nillable="true" type="s:string" />
  |         </s:sequence>
  |       </s:complexType>
  | 

My wstools-config.xml is:


  | <?xml version="1.0" encoding="UTF-8"?>
  | <configuration xmlns="http://www.jboss.org/jbossws-tools">
  | 	<wsdl-java location="services.wsdl" parameter-style="bare">
  | 		<mapping file="mapping.xml" />
  | 	</wsdl-java>
  | </configuration>
  | 

Running the wstools Ant task finishes without a problem.  Both the code and mapping document are generated without error.

However, when I deploy the service and try to invoke it I get a BindingException saying that the ArrayOfString class cannot be found.  Upon inspection of the generated classes there isn't a ArrayOfString.java file nor any references to a ArrayOfString object in FieldSelection.java.  FieldSelection uses the actual array type "String[]".  

When I look at the mapping.xml I see this:


  | <java-xml-type-mapping>
  |   <java-type>ArrayOfString</java-type>
  |   <root-type-qname xmlns:typeNS='http://www.domain.com/projname/services'>typeNS:ArrayOfString</root-type-qname>
  |   <qname-scope>complexType</qname-scope>
  |   <variable-mapping>
  |    <java-variable-name>string</java-variable-name>
  |    <xml-element-name>string</xml-element-name>
  |   </variable-mapping>
  |  </java-xml-type-mapping>
  | 

When I remove this snippet from the mapping.xml everything works fine.

Is this appropriate behavior?

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4055761#4055761

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4055761



More information about the jboss-user mailing list