[ https://issues.apache.org/jira/browse/AXIS2-5379?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13655530#comment-13655530 ]
Sven Strohschein edited comment on AXIS2-5379 at 5/12/13 4:23 PM: ------------------------------------------------------------------ Thank you for the modified wsdl. I actually thought that it is only possible to build REST services with WSDL since version 2.0. Unfortunatelly, it results in the same error: 1.) Three parameters -> not working Request: http://localhost:8080/services/helloWebServiceREST/getHello?input=test&second=test2&third=test3 Response: <soapenv:Text xml:lang="en-US">org.apache.axis2.databinding.ADBException: Unexpected subelement second</soapenv:Text> 2.) Two parameters including the third parameter -> not working Request: http://localhost:8080/services/helloWebServiceREST/getHello?input=test&third=test3 Response: <soapenv:Text xml:lang="en-US">org.apache.axis2.databinding.ADBException: Unexpected subelement input</soapenv:Text> 3.) Two parameters without the third parameter -> working Request: http://localhost:8080/services/helloWebServiceREST/getHello?input=test&second=test2 Response: <ns5:helloresponse xmlns:ns5="hello-ws-rest" output="First parameter: test, second parameter: test2, third parameter: null" /> To test your solution, I just took the uploaded files "hello-rest-modified.wsdl", "HelloWebServiceREST.java" and "services.xml" and built the service via axis2-wsdl2code-maven-plugin with the following configuration: <execution> <id>1</id> <goals> <goal>wsdl2code</goal> </goals> <configuration> <packageName>de.hello.webservice.rest</packageName> <wsdlFile>${project.build.directory}/include/META-INF/wsdl/hello-rest.wsdl</wsdlFile> <!-- with the modified content --> <wsdlVersion>1.1</wsdlVersion> <overWrite>true</overWrite> <generateServerSide>true</generateServerSide> <generateServerSideInterface>true</generateServerSideInterface> <generateAllClasses>true</generateAllClasses> </configuration> </execution> I'm running the webservice in an OSGi environment, but I think this doesn't matter because everything else is working. I have (tried to) built an AAR file to test it with the standalone version of Axis2, but there are other problems... When I call "ant jar.server" like in the documentation of Axis2, the "services.xml" isn't packed, so I packed it manually to the archive. After that the service can be started and found by Axis2, but it seems to not call the service. Every call of "http://localhost:8080/axis2/services/helloWebServiceREST/getHello" results in "<soapenv:Text xml:lang="en-US">de.hello.webservice.rest.HelloWebServiceREST</soapenv:Text>" (independent from the request parameters). When I browse through the AAR archive, the service class seem to not exist. I'm wondering why the restrictive Axis2 server doesn't claim that... I have attached the (not correctly working) AAR archive, anyway. Thanks again for your support! :-) was (Author: novanic): Thank you for the modified wsdl. I actually thought that it is only possible to build REST services with WSDL since version 2.0. Unfortunatelly, it results in the same error: 1.) Three parameters -> not working Request: http://localhost:8080/services/helloWebServiceREST/getHello?input=test&second=test2&third=test3 Response: <soapenv:Text xml:lang="en-US">org.apache.axis2.databinding.ADBException: Unexpected subelement second</soapenv:Text> 2.) Two parameters including the third parameter -> not working Request: http://localhost:8080/services/helloWebServiceREST/getHello?input=test&third=test3 Response: <soapenv:Text xml:lang="en-US">org.apache.axis2.databinding.ADBException: Unexpected subelement input</soapenv:Text> 3.) Two parameters without the third parameter -> working Request: http://localhost:8080/services/helloWebServiceREST/getHello?input=test&second=test2 Response: <ns5:helloresponse xmlns:ns5="hello-ws-rest" output="First parameter: test, second parameter: test2, third parameter: null" /> To test your solution, I just took the uploaded files "hello-rest-modified.wsdl", "HelloWebServiceREST.java" and "services.xml" and built the service via axis2-wsdl2code-maven-plugin with the following configuration: <execution> <id>1</id> <goals> <goal>wsdl2code</goal> </goals> <configuration> <packageName>de.hello.webservice.rest</packageName> <wsdlFile>${project.build.directory}/include/META-INF/wsdl/hello-rest.wsdl</wsdlFile> <!-- with the modified content --> <wsdlVersion>1.1</wsdlVersion> <overWrite>true</overWrite> <generateServerSide>true</generateServerSide> <generateServerSideInterface>true</generateServerSideInterface> <generateAllClasses>true</generateAllClasses> </configuration> </execution> I'm running the webservice in an OSGi environment, but I think this doesn't matter because everything else is working. I'm using version 1.6.2. Which version do you use? Thanks again for your support! :-) > The third URL parameter can not be processed (REST web service with WSDL 2.0) > ----------------------------------------------------------------------------- > > Key: AXIS2-5379 > URL: https://issues.apache.org/jira/browse/AXIS2-5379 > Project: Axis2 > Issue Type: Bug > Components: wsdl > Affects Versions: 1.6.2 > Reporter: Sven Strohschein > Priority: Blocker > Attachments: hello-rest-modified.wsdl, hello-rest.wsdl, > HelloWebServiceREST.java, RESTSample_1.0.0.aar, services.xml > > > I have developed a simple "hello world" REST web service with WSDL 2.0 and > Axis2. > There are three URL parameters defined, but the third URL parameter can not > be processed (ADBException regarding unexpected element). The first two > parameters are processed correctly. > I could not get an answer via the axis2 mailing list regarding this problem ( > http://mail-archives.apache.org/mod_mbox/axis-java-user/201207.mbox/%3C500F0ADF.1050108%40gmx.de%3E > ), could not find any examples, tutorials or documentation for a REST web > service with WSDL 2.0 and more than two parameters. > The full example code, wsdl, etc. is attached to this issue. > URL calls > http://localhost:8080/services/helloWebServiceREST/getHello?input=test -> > working > http://localhost:8080/services/helloWebServiceREST/getHello?input=test&second=test2 > -> working > http://localhost:8080/services/helloWebServiceREST/getHello?input=test&second=test2&third=test3 > -> not working ("org.apache.axis2.databinding.ADBException: Unexpected > subelement second") > http://localhost:8080/services/helloWebServiceREST/getHello?input=test&third=test3 > -> not working ("org.apache.axis2.databinding.ADBException: Unexpected > subelement input") > Request element > <xsd:element name="hellorequest"> > <xsd:complexType> > <xsd:sequence> > <xsd:element minOccurs="0" name="input" nillable="true" > type="xsd:string"/> > <xsd:element minOccurs="0" name="second" nillable="true" > type="xsd:string"/> > <xsd:element minOccurs="0" name="third" nillable="true" > type="xsd:string"/> > </xsd:sequence> > </xsd:complexType> > </xsd:element> -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: java-dev-unsubscr...@axis.apache.org For additional commands, e-mail: java-dev-h...@axis.apache.org