Return-Path: Delivered-To: apmail-ws-axis-user-archive@www.apache.org Received: (qmail 94336 invoked from network); 29 Oct 2009 10:01:26 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 29 Oct 2009 10:01:26 -0000 Received: (qmail 78113 invoked by uid 500); 29 Oct 2009 10:01:23 -0000 Delivered-To: apmail-ws-axis-user-archive@ws.apache.org Received: (qmail 78024 invoked by uid 500); 29 Oct 2009 10:01:23 -0000 Mailing-List: contact axis-user-help@ws.apache.org; run by ezmlm Precedence: bulk Reply-To: axis-user@ws.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list axis-user@ws.apache.org Received: (qmail 78015 invoked by uid 99); 29 Oct 2009 10:01:23 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 29 Oct 2009 10:01:23 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of amilasuriarachchi@gmail.com designates 209.85.216.173 as permitted sender) Received: from [209.85.216.173] (HELO mail-px0-f173.google.com) (209.85.216.173) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 29 Oct 2009 10:01:11 +0000 Received: by pxi3 with SMTP id 3so1191495pxi.29 for ; Thu, 29 Oct 2009 03:00:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=ltBc5/HaNL9svDMPjlsHyvztBvLPLeA0aqrLrEFdEMg=; b=D6aE0X07RapGYY4dCfwQnXy5AXWDY5jU/+tKfV0ACLtsD/qqZq4wGwrmyNKlM8JjQ3 XpJba4RRs/yMWJo4XhZEWhvNmwDC5nb0993ZWDCP+ksx70u9ZoDeHRRNwCHNGnj9uvMC VmGvRssi8y07hULwUhGJKbIz8gmOTVQceeeKY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=lPqn6wQmCZfyEHouwEokWLV8YOfcdRk5vH1c5KRF8MRIarwX4hYAyh/V+m/CsX/wp0 x39o9NIKftgqo7/eyt2YmxaR5/M9sYfH+3C5nulITb941iHMYkhe/ury91WVxhuEuUDJ SEqnSyc05koJ4VKDhkFh4Cc6OWSoMiK/nxpZc= MIME-Version: 1.0 Received: by 10.142.61.41 with SMTP id j41mr1591890wfa.298.1256810448008; Thu, 29 Oct 2009 03:00:48 -0700 (PDT) In-Reply-To: <4AE9547A.6030300@glasch.nl> References: <4AE80908.5060306@glasch.nl> <4AE9547A.6030300@glasch.nl> Date: Thu, 29 Oct 2009 15:30:47 +0530 Message-ID: <60708f4b0910290300y305942b1v8db7b6e2a03fc59@mail.gmail.com> Subject: Re: use supplied WSDL instead of generated WSDL: ...ADBException: Unexpected subelement From: Amila Suriarachchi To: axis-user@ws.apache.org Content-Type: multipart/alternative; boundary=001636e0b6014db82604770ffc3a X-Virus-Checked: Checked by ClamAV on apache.org --001636e0b6014db82604770ffc3a Content-Type: text/plain; charset=ISO-8859-1 On Thu, Oct 29, 2009 at 2:08 PM, H wrote: > Some additional info, since I'm really stuck on this point: > > - I have 2 different classes (annotated with @Webservice) which expose a > few public methods (annotated with @Webmethod). > > - I have added separate .wsdl files (same name as the @Webservice classes) > in META-INF > > - The param "useOriginalwsdl" has no influence at all. If the the .wsdl's > are in META-INF, they're used. Setting to false (or removing it) doesn't do > anything. > > - The WSDL's I put in META-INF are identical to what ?wsdl generates. No > modifications. > > - When the .aar is deployed with the supplied WSDL's and I call the ?wsdl, > the output WSDL XML is about the same as the original generated WSDL (some > order differences, nothing major it seems). > > What am i doing wrong? Why am I getting the ADBException? > check whether there is a difference between new and old wsdl files. thanks, Amila. > > > *Exception in thread "main" org.apache.axis2.AxisFault: > org.apache.axis2.databinding.ADBException: Unexpected subelement > debugMessage > at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430) > at > nl.organization.webservices.Ws_UsersStub.fromOM(Ws_UsersStub.java:19397) > at > nl.organization.webservices.Ws_UsersStub.removeUser(Ws_UsersStub.java:1384) > at test.Client.reqRemoveUser(Client.java:65) > at test.Client.main(Client.java:14) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:597) > at com.intellij.rt.execution.application.AppMain.main(AppMain.java:90) > * > > > Henjo van Rees wrote: > > Hi, > > I've been developing an Axis based Webservice for some time now. Right now > I'm at the point where the basics function alright and that I am starting on > improving stuff like security. > One aspect of that is stop using the generated WSDL and supply my own. > Because I'm far from a WS guru, I decided to use the generated WSDL and use > that as a basis for improvement. > > What I've done is the following: > - Save generated WSDL with the same name as the service name (name.wsdl) > and put that in the .aar (META-INF dir) > - Set the parameter "useOriginalwsdl" to true for that service > (services.xml) > - Keep the classes exactly the same, no other changes. > - Deploy the .aar, restart Tomcat. > - Verify webservice+operations using the listServices servlet (they are > listed exactly as they should) > > So Axis2 accepts the .aar. > > However, now my webservices test client does not function anymore with this > modification. This probably has to do with namespaces, but I wonder how I > should get it working. > What must I change in my services.xml to get it working with my own WSDL? > > **** *The java classes are in the root package nl.organization.webservices > .* > > *** services.xml snippet:* > > > WebServices - User Management > locked="true">nl.organization.webservices.Ws_Users > true > > class="org.apache.axis2.rpc.receivers.RPCMessageReceiver"/> > > > > > *** Generated WSDL snippet*: > > xmlns:ns1= > "http://org.apache.axis2/xsd" xmlns:ns= > "http://webservices.organization.nl" xmlns:wsaw= > "http://www.w3.org/2006/05/addressing/wsdl"xmlns:http= > "http://schemas.xmlsoap.org/wsdl/http/"xmlns:ax21= > "http://webservices.organization.nl/xsd"xmlns:xs= > "http://www.w3.org/2001/XMLSchema" xmlns:mime= > "http://schemas.xmlsoap.org/wsdl/mime/"xmlns:soap= > "http://schemas.xmlsoap.org/wsdl/soap/"xmlns:soap12= > "http://schemas.xmlsoap.org/wsdl/soap12/"targetNamespace= > "http://webservices.organization.nl" > > Ws_Users > > attributeFormDefault="qualified" elementFormDefault="qualified" > targetNamespace="http://webservices.organization.nl" > > > > /> > > > > nillable="true" type="xs:string"/> > nillable="true" type="xs:string"/> > > > > > > > nillable="true" type="ax22:WsResponse"/> > > > > .... > > elementFormDefault="qualified" targetNamespace= > "http://webservices.organization.nl/xsd" > > > > > nillable="true" type="xs:string"/> > type="xs:int"/> > nillable="true" type="xs:string"/> > > > > > > > > > > > .... > > *** EXCEPTION WHEN RUNNING WS CLIENT:* > (I've generated the stub classes with wsdl2java) > Exception in thread "main" org.apache.axis2.AxisFault: > org.apache.axis2.databinding.ADBException: Unexpected subelement > debugMessage > at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430) > at > nl.organization.webservices.Ws_UsersStub.fromOM(Ws_UsersStub.java:19397) > at > nl.organization.webservices.Ws_UsersStub.removeUser(Ws_UsersStub.java:1384) > at test.Client.reqRemoveUser(Client.java:65) > at test.Client.main(Client.java:14) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:597) > at com.intellij.rt.execution.application.AppMain.main(AppMain.java:90) > > Any help will be welcome! > Thanks! > > > -- Amila Suriarachchi WSO2 Inc. blog: http://amilachinthaka.blogspot.com/ --001636e0b6014db82604770ffc3a Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable

On Thu, Oct 29, 2009 at 2:08 PM, H <henjo@glasch.nl>= wrote:
=20 =20
Some additional info, since I'm really stuck on this point:

- I have 2 different classes (annotated with @Webservice) which expose a few public methods (annotated with @Webmethod).

- I have added separate .wsdl files (same name as the @Webservice classes) in META-INF

- The param "useOriginalwsdl" has no influence at all. If the the .wsdl's are in META-INF, they're used. Setting to false (or removin= g it) doesn't do anything.

- The WSDL's I put in META-INF are identical to what ?wsdl generates. No modifications.

- When the .aar is deployed with the supplied WSDL's and I call the ?wsdl, the output WSDL XML is about the same as the original generated WSDL (some order differences, nothing major it seems).

What am i doing wrong? Why am I getting the ADBException?

check whether there is a difference between new and old wsdl file= s.

thanks,
Amila.
=A0


Exception in thread "main" org.apache.axis2.AxisFault: org.apache.axis2.databinding.ADBException: Unexpected subelement debugMessage
=A0=A0=A0 at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430)
=A0=A0=A0 at nl.organization.webservices.Ws_UsersStub.fromOM(Ws_UsersStub.java:19397) =A0=A0=A0 at nl.organization.webservices.Ws_UsersStub.removeUser(Ws_UsersStub.java:1384)=
=A0=A0=A0 at test.Client.reqRemoveUser(Client.java:65)
=A0=A0=A0 at test.Client.main(Client.java:14)
=A0=A0=A0 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) =A0=A0=A0 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:3= 9)
=A0=A0=A0 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImp= l.java:25)
=A0=A0=A0 at java.lang.reflect.Method.invoke(Method.java:597)
=A0=A0=A0 at com.intellij.rt.execution.application.AppMain.main(AppMain.java:90)



Henjo van Rees wrote:
Hi,

I've been developing an Axis based Webservice for some time now. Right now I'm at the point where the basics function alright and that I am starting on improving stuff like security.
One aspect of that is stop using the generated WSDL and supply my own. Because I'm far from a WS guru, I decided to use the generated WSDL and use that as a basis for improvement.

What I've done is the following:
- Save generated WSDL with the same name as the service name (name.wsdl) and put that in the .aar (META-INF dir)
- Set the parameter "useOriginalwsdl" to true for that service (services.xml)
- Keep the classes exactly the same, no other changes.
- Deploy the .aar, restart Tomcat.
- Verify webservice+operations using the listServices servlet (they are listed exactly as they should)

So Axis2 accepts the .aar.

However, now my webservices test client does not function anymore with this modification. This probably has to do with namespaces, but I wonder how I should get it working.
What must I change in my services.xml to get it working with my own WSDL?

** The java classes are in the root package nl.organization.= webservices.

** services.xml snippet:
<serviceGroup>
=A0=A0=A0 <service name=3D"Ws_Users">
=A0=A0=A0=A0=A0=A0=A0 <description>WebServices - User Management</description>
=A0=A0=A0=A0=A0=A0=A0 <parameter name=3D"ServiceClass" locked=3D"true">nl.organization.webservices.Ws_Users</param= eter>
=A0=A0=A0=A0=A0=A0=A0 <parameter name=3D"useOriginalwsdl">t= rue</parameter>
=A0=A0=A0=A0=A0=A0=A0 <operation name=3D"addUser">
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 <messageReceiver class=3D"org.apache.axis2.rpc.receivers.RPCMessageReceiver"/><= br> =A0=A0=A0=A0=A0=A0=A0 </operation>
=A0=A0=A0 </service>
<serviceGroup>

** Generated WSDL snippet:
<?xml version=3D"1.0" encoding=3D"UTF-8"?>
<wsdl:definitions xmlns:wsdl=3D"http://schemas.xmlsoap.org/wsdl/" xmlns:ns1=3D"= ;http://org.apache.axis2/xsd" xmlns:ns=3D"http://webservices.organization.nl" xmlns:wsaw=3D"http://www.w3.org/2006/05/addressing/wsdl" xmlns:http=3D"http://schemas.xmlsoap.org/wsdl/http/" xmlns:ax21=3D"http://webservices.organization.nl/xsd" xmlns:xs=3D&= quot;http://www.w3.org/2001/XMLSchema" xmlns:mime=3D"http://schemas.xmlsoap.org/wsdl/mime/" xmlns:soap=3D"http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soap12=3D"http://schemas.xmlsoap.org/wsdl/soap12/" targetNamespace=3D"http://webservices.organization.nl">
=A0=A0=A0 <wsdl:documentation>Ws_Users</wsdl:documentation>
=A0=A0=A0 <wsdl:types>
=A0=A0=A0=A0=A0=A0=A0 <xs:schema xmlns:ax22=3D"http://webservices.organization.nl/xsd" attributeFormDefault=3D"qualified" elementFormDefault=3D"qua= lified" targetNamespace=3D"http://webservices.organization.nl">
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 <xs:import namespace=3D"http://webservices.organization.nl/xsd"/>
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 <xs:element name=3D"addUser"= >
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 <xs:complexType>
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 <xs:sequence&g= t;
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 <x= s:element minOccurs=3D"0" name=3D"username" nillable=3D"true" type=3D"xs:string"/>
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 <x= s:element minOccurs=3D"0" name=3D"groupname" nillable=3D"true" type=3D"xs:string"/>
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 </xs:sequence&= gt;
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 </xs:complexType>
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 </xs:element>
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 <xs:element name=3D"addUserRespon= se">
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 <xs:complexType>
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 <xs:sequence&g= t;
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 <x= s:element minOccurs=3D"0" name=3D"return" nillable=3D"true" type=3D"ax22:WsResponse"/>
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 </xs:sequence&= gt;
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 </xs:complexType>
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 </xs:element>
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 ....
=A0=A0=A0=A0=A0=A0=A0 </xs:schema>
=A0=A0=A0=A0=A0=A0=A0 <xs:schema attributeFormDefault=3D"qualified&= quot; elementFormDefault=3D"qualified" targetNamespace=3D"http://webservices.organization.nl/xsd">
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 <xs:complexType name=3D"WsRespons= e">
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 <xs:sequence>
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 <xs:element mi= nOccurs=3D"0" name=3D"debugMessage" nillable=3D"true" type=3D"xs:string"/>
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 <xs:element mi= nOccurs=3D"0" name=3D"exitCode" type=3D"xs:int"/>
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 <xs:element mi= nOccurs=3D"0" name=3D"message" nillable=3D"true" type=3D"xs:string"/>
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 </xs:sequence>
=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 </xs:complexType>
=A0=A0=A0=A0=A0=A0=A0 </xs:schema>
=A0=A0=A0 </wsdl:types>
=A0=A0=A0 <wsdl:message name=3D"addUserRequest">
=A0=A0=A0=A0=A0=A0=A0 <wsdl:part name=3D"parameters" element= =3D"ns:addUser"/>
=A0=A0=A0 </wsdl:message>
=A0=A0=A0 <wsdl:message name=3D"addUserResponse">
=A0=A0=A0=A0=A0=A0=A0 <wsdl:part name=3D"parameters" element=3D"ns:addUserResponse"/>
=A0=A0=A0 </wsdl:message>
....

** EXCEPTION WHEN RUNNING WS CLIENT:
(I've generated the stub classes with wsdl2java)
Exception in thread "main" org.apache.axis2.AxisFault: org.apache.axis2.databinding.ADBException: Unexpected subelement debugMessage
=A0=A0=A0 at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430)
=A0=A0=A0 at nl.organization.webservices.Ws_UsersStub.fromOM(Ws_UsersStub.java:19397) =A0=A0=A0 at nl.organization.webservices.Ws_UsersStub.removeUser(Ws_UsersStub.java:1384)=
=A0=A0=A0 at test.Client.reqRemoveUser(Client.java:65)
=A0=A0=A0 at test.Client.main(Client.java:14)
=A0=A0=A0 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) =A0=A0=A0 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:3= 9)
=A0=A0=A0 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImp= l.java:25)
=A0=A0=A0 at java.lang.reflect.Method.invoke(Method.java:597)
=A0=A0=A0 at com.intellij.rt.execution.application.AppMain.main(AppMain.java:90)

Any help will be welcome!
Thanks!





--
Amila Suriarachchi
W= SO2 Inc.
blog: http://am= ilachinthaka.blogspot.com/
--001636e0b6014db82604770ffc3a--