Dear Amila,
 
Thanks for the time. I added the complete wsdl and log, response and request as 
attachment. Mind you, the fault of this service differs from before, but i 
still have trouble creating a working service of this ws-i compliant wsdl. Hope 
you can help. Thanks in advance.
 
Kind regards,
Erwin  
 
 

-----Oorspronkelijk bericht-----
Van: Amila Suriarachchi [mailto:[EMAIL PROTECTED]
Verzonden: maandag 17 september 2007 13:02
Aan: [email protected]
Onderwerp: Re: ADBException: Unexpected subelement Code




On 9/17/07, Erwin Reinhoud < [EMAIL PROTECTED]> wrote: 

Dear users,
 
I am using axis2 1.3 and an ant script to generate a service. However i keep 
getting the "Unexpected subelement" exception as soon as i add for example the 
"Metadata" element being a complex type (see additions below). I renamed some 
stuff for this post so please disregard any possible errors (the wsdl+schema is 
validated). I also added the"-uw" argument to the wsdl2java but does not seem 
to help. The question is what is wrong with the ant target or wsdl, assuming 
that the soapui generated request is correct?


Can you try to access the axis2 service with the Axis2 client and see? 

Can you send a valid complete wsdl file which shows the problem? 

Amila.



Thanks in advance.
Kind regards,
Erwin
 
Server response:
 
<soapenv:Envelope xmlns:soapenv=" http://schemas.xmlsoap.org/soap/envelope/  
<http://schemas.xmlsoap.org/soap/envelope/> ">
   <soapenv:Body>
      <soapenv:Fault>
         <faultcode>soapenv:Server</faultcode>
         <faultstring>org.apache.axis2.databinding.ADBException: Unexpected 
subelement Code2</faultstring>
         <detail/>
      </soapenv:Fault>
   </soapenv:Body>
</soapenv:Envelope>
 
 
 
SOAPUI request based on wsdl:
 
<soapenv:Envelope xmlns:soapenv="  <http://schemas.xmlsoap.org/soap/envelope/> 
http://schemas.xmlsoap.org/soap/envelope/"; 
xmlns:v0="  <http://localhost/schemas/v0.2> http://localhost/schemas/v0.2";>
   <soapenv:Header/>
   <soapenv:Body>
      <v0:Send>
         <v0:Metadata>
            <v0:Code2 >?</v0:Code2  >
         </v0:Metadata>
         <!--Optional:-->
         <v0:Data>?</v0:Data>
      </v0:Send>
   </soapenv:Body>
</soape 
 
 
ANT WSDL2JAVA target:
 
 <target name="generate.service" depends="prepare.repo">
                 <java classname="org.apache.axis2.wsdl.WSDL2Java">
                        <arg value="-uri" />
                        <arg value="wsdl\DataService_v0.2.wsdl" />
                        <arg value="-ss" />
                        <arg value="-uw" />
                        <arg value="-sd" />
                          <arg value="-g"/>
                        <arg value="-p" />
                        <arg value="-o" />
                        <arg value="${gen.service.dir}" />
                        <classpath refid="axis2.class.path" />
                </java>
                
              
          </target>
 
 
 
 
The schema:
 
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd=" http://www.w3.org/2001/XMLSchema"; 
xmlns:xmime=" http://www.w3.org/2005/05/xmlmime"; 
xmlns:tns=" http://localhost/schemas/v0.2"; 
targetNamespace=" http://localhost/schemas/v0.2"; elementFormDefault="qualified">
<xsd:import namespace=" http://www.w3.org/2005/05/xmlmime  
<http://www.w3.org/2005/05/xmlmime> " schemaLocation="xmlmime.xml"/> 
 
<xsd:element name="Send">
  <xsd:complexType>
   <xsd:sequence>
    <xsd:element name="Metadata" type="tns:Metadata"/>
    <xsd:element name="Data" type="xsd:string" minOccurs="0"/>
   </xsd:sequence>
  </xsd:complexType>
 </xsd:element>
 <xsd:element name="SendResponse">
  <xsd:complexType>
   <xsd:sequence>
    <xsd:element name="berichtUit" type="tns:Status" nillable="true" 
minOccurs="0"/>
   </xsd:sequence>
  </xsd:complexType>
 </xsd:element>
 <xsd:complexType name="Status">
  <xsd:sequence>
   <xsd:element name="Code" type="xsd:string"/>
   <xsd:element name="Melding" type="xsd:string" minOccurs="0"/>
  </xsd:sequence>
 </xsd:complexType>
  <xsd:complexType name="Metadata">
  <xsd:sequence>
   <xsd:element name="Code2" type="xsd:string"/>
 </xsd:sequence>
 </xsd:complexType>
 
 
 
 
</xsd:schema>





-- 
Amila Suriarachchi,
WSO2 Inc. 

Attachment: testService_v0.2.wsdl
Description: testService_v0.2.wsdl

Attachment: test-abstract_v0.2.wsdl
Description: test-abstract_v0.2.wsdl

Attachment: test_v0.2.xsd
Description: test_v0.2.xsd

<!--
 
   W3C XML Schema defined in the Describing Media Content of Binary Data in XML
   specification
     http://www.w3.org/TR/xml-media-types

   Copyright © 2005 World Wide Web Consortium,
  
   (Massachusetts Institute of Technology, European Research Consortium for
   Informatics and Mathematics, Keio University). All Rights Reserved. This
   work is distributed under the W3C® Software License [1] in the hope that
   it will be useful, but WITHOUT ANY WARRANTY; without even the implied
   warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  
   [1] http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231

   $Id: xmlmime.xsd,v 1.1 2005/04/25 17:08:35 hugo Exp $
-->
<xs:schema 	targetNamespace="http://www.w3.org/2005/05/xmlmime"; 
					xmlns:xs="http://www.w3.org/2001/XMLSchema"; 
					xmlns:xmime="http://www.w3.org/2005/05/xmlmime"; >
	<xs:attribute name="contentType">
		<xs:simpleType>
			<xs:restriction base="xs:string">
				<xs:minLength value="3"/>
			</xs:restriction>
		</xs:simpleType>
	</xs:attribute>
	<xs:attribute name="expectedContentTypes" type="xs:string"/>
	<xs:complexType name="base64Binary">
		<xs:simpleContent>
			<xs:extension base="xs:base64Binary">
				<xs:attribute ref="xmime:contentType"/>
			</xs:extension>
		</xs:simpleContent>
	</xs:complexType>
	<xs:complexType name="hexBinary">
		<xs:simpleContent>
			<xs:extension base="xs:hexBinary">
				<xs:attribute ref="xmime:contentType"/>
			</xs:extension>
		</xs:simpleContent>
	</xs:complexType>
</xs:schema>

Attachment: log
Description: log

Attachment: repsonse
Description: repsonse

Attachment: req
Description: req

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to