You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by M S <mo...@gmail.com> on 2006/07/06 14:36:40 UTC

Axis2 / Axis RPC

Hi,

I am a newbie trying to create a RPC-based Web Service. I created this using
Axis2 (latest nightly build dated 5th July). The problem is that I cannot
use WSDL2Java to generate the Client stubs. So what I did is to use the old
Axis (1.4 from 22nd April) to do this.

For some reason I don't get it to work. My Client code looks like this:

package org.apache.ws.axis;

import javax.xml.namespace.*;
import javax.xml.rpc.*;
import java.rmi.*;
import java.net.*;

public class Client2 {

    public Client2() {}

    interface MyPrimeHandler extends Remote {
        public String echo(String echostring) throws RemoteException;
    }

    public void invokeService() {
        String msg = "Det funkar";
        try {
            String wsdlLoc = "
http://localhost:8080/axis2/services/MyService2?wsdl";
            QName serviceName = new QName("
http://localhost:8080/axis2/services/MyService2", "MyService2");
            ServiceFactory sFactory = ServiceFactory.newInstance();
            Service service = sFactory.createService(new URL(wsdlLoc),
serviceName);
            MyPrimeHandler mp = (MyPrimeHandler)service.getPort(
MyPrimeHandler.class);
            String resp = mp.echo(msg);
            System.out.println(resp);
        }

        catch (Exception e) { e.printStackTrace();}
    }

    public static void main(String[] args) {
        Client2 cl2 = new Client2();
        cl2.invokeService();
    }

}

The exception that I get is:

- Unable to find required classes (javax.activation.DataHandler and
javax.mail.internet.MimeMultipart). Attachment support is disabled.
javax.xml.rpc.ServiceException: Error processing WSDL document:
javax.xml.rpc.ServiceException: Error processing WSDL document:
javax.xml.rpc.ServiceException: Cannot find service:  {
http://localhost:8080/axis2/services/MyService2}MyService2
    at org.apache.axis.client.Service.initService(Service.java:250)
    at org.apache.axis.client.Service.<init>(Service.java:165)
    at org.apache.axis.client.ServiceFactory.createService(
ServiceFactory.java:198)
    at org.apache.ws.axis.Client2.invokeService(Client2.java:22)
    at org.apache.ws.axis.Client2.main(Client2.java:33)


I have checked and the EPR exists at the specified URL above.

Does anyone have an idea on how I should solve this problem? Or am I barking
up the wrong tree? Perhaps there is some other way generating client stubs
with Axis2? Any help would be appreciated.

Regards

Re: Axis2 / Axis RPC

Posted by Kinichiro Inoguchi <in...@yahoo.com>.
Hi M S,

Latest nightly build axis2.war, this issue was solved.

Many thanks to Deepal, always !

Regards,
kinichiro

--- Kinichiro Inoguchi <in...@yahoo.com> wrote:

> I'm glad to hear that.
> I also hope this issue will be solved until next release.
> http://issues.apache.org/jira/browse/AXIS2-865
> 
> Regards,
> kinichiro
> 
> --- M S <mo...@gmail.com> wrote:
> 
> > Hi,
> > 
> > Thank you very much for your help. That solved my problem! I hope
> > that this
> > is added to the next Axis2 RC.
> > 
> > Regards
> > 
> > On 7/9/06, Kinichiro Inoguchi <in...@yahoo.com> wrote:
> > >
> > > Hi,
> > >
> > > I sent you 1 jar file by another mail.
> > >
> > > I think you have 2 problems.
> > > One is "WSDL2Java code generation" issue,
> > > and another is "response message not qualified well" issue.
> > >
> > > WSDL2Java code generation issue seems still remain
> > > in nightly build 09-Jul-2006 01:35.
> > > I got these stack trace,
> > >
> >
>
-----------------------------------------------------------------------
> > > C:\work>set AXIS2_HOME=C:\work\axis2-std-SNAPSHOT-bin
> > > C:\work>%AXIS2_HOME%\bin\wsdl2java -uri
> > > http://localhost:8080/axis2/services/MyService2?wsdl -p test -o
> > stub
> > > Exception in thread "main"
> > > org.apache.axis2.wsdl.codegen.CodeGenerationException
> > > : java.lang.RuntimeException: java.lang.ClassNotFoundException:
> > > org.apache.axis2.schema.ExtensionUtility
> > >         at
> > > org.apache.axis2.wsdl.codegen.CodeGenerationEngine.generate(
> > > CodeGenerationEngine.java:235)
> > >         at
> org.apache.axis2.wsdl.WSDL2Code.main(WSDL2Code.java:32)
> > >         at
> org.apache.axis2.wsdl.WSDL2Java.main(WSDL2Java.java:21)
> > > Caused by: java.lang.RuntimeException:
> > > java.lang.ClassNotFoundException:
> > > org.apache.axis2.schema.ExtensionUtility
> > >         at
> > > org.apache.axis2.wsdl.codegen.extension.SimpleDBExtension.engage(
> > > SimpleDBExtension.java:52)
> > >         at
> > > org.apache.axis2.wsdl.codegen.CodeGenerationEngine.generate(
> > > CodeGenerationEngine.java:188)
> > >         ... 2 more
> > > Caused by: java.lang.ClassNotFoundException:
> > > org.apache.axis2.schema.ExtensionUtility
> > >         at java.net.URLClassLoader$1.run(URLClassLoader.java:199)
> > >         at java.security.AccessController.doPrivileged(Native
> > Method)
> > >         at
> > java.net.URLClassLoader.findClass(URLClassLoader.java:187)
> > >         at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
> > >         at
> > > sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
> > >         at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
> > >         at
> > > java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
> > >         at java.lang.Class.forName0(Native Method)
> > >         at java.lang.Class.forName(Class.java:141)
> > >         at
> > > org.apache.axis2.wsdl.codegen.extension.SimpleDBExtension.engage(
> > > SimpleDBExtension.java:44)
> > >         ... 3 more
> > > C:\work>
> > >
> >
>
-----------------------------------------------------------------------
> > >
> > > The jar file I sent (maybe) solves only response message issue.
> > > That does NOT solve WSDL2Java issue.
> > >
> > > If you want run through with your MyService2,
> > > how about using this coupling ?
> > > server side : nightly build war + jar I sent.
> > > code generation : std-1.0 release.
> > >
> > > This means,
> > > 1. deploy nightly build war to your tomcat.
> > > 2. replace jar with jar I sent in
> > (tomcat)/webapps/axis2/WEB-INF/lib/ .
> > > 3. drop your MyService2.aar to service folder.
> > > 4. set AXIS2_HOME to your std-1.0 release folder.
> > > 5. generate client stub with WSDL2Java
> > > 6. run the client.
> > >
> > > Regards,
> > > kinichiro
> > > --- M S <mo...@gmail.com> wrote:
> > >
> > > > Hi,
> > > >
> > > > I saw that you have added a solution to your JIRA... is it
> > possible
> > > > for you
> > > > to give me a nightly build with the modifications you have?
> > > >
> > > > Regards
> > > >
> > > > On 7/6/06, Kinichiro Inoguchi <in...@yahoo.com> wrote:
> > > > >
> > > > > Hi,
> > > > >
> > > > > If you use Axis2 1.0 release version, it will work.
> > > > >
> > > > > RPCMessageReceiver of Nightly Builds have problem that
> returns
> > > > > "broken" qualified response.
> > > > > I created JIRA for this issue today.
> > > > >
> > > > > generated stub client send message like this,
> > > > >       <soapenv:Body>
> > > > >          <ns1:echo xmlns:ns1="http:///xsd">
> > > > >             <ns1:echostring>from client app</ns1:echostring>
> > > > >          </ns1:echo>
> > > > >       </soapenv:Body>
> > > > >
> > > > > RPCMessageReceiver returns message like this,
> > > > >       <soapenv:Body>
> > > > >          <ns:echoResponse xmlns:ns="http:///xsd">
> > > > >             <return>from client app</return>
> > > > >          </ns:echoResponse>
> > > > >       </soapenv:Body>
> > > > >
> > > > > <retrun> is NOT qualified with prefix "ns".
> > > > > your error message "Unexpected subelement return" of "return"
> > means
> > > > > this.
> > > > >
> > > > > > claims
> > > > > > that this error message appears because axis2 does not
> > support
> > > > RPC
> > > > > > Bindings.
> > > > >
> > > > > No, this means Axis2 does not support RPC/Encoded,
> > > > > As Anne mentioned before, RPC/literal is supported.
> > > > >
> > > > > Regards,
> > > > > kinichiro
> > > > >
> > > > > --- M S <mo...@gmail.com> wrote:
> > > > >
> > > > > > Hi,
> > > > > >
> > > > > > Basically what I'm trying to do is to create a simple Web
> > Service
> > > > > > that will
> > > > > > receive a String and retun the same string, i.e. basically
> an
> > > > "echo"
> > > > > > web
> > > > > > service. I tried using the sample on the Axis2
> documentation
> > page
> > > > > > with
> > > > > > OMElement - it works fine.
> > > > > >
> > > > > > My problem is that I want to use String instead of
> OMElement
> > on
> > > > both
> > > > > > sides
> > > > > > (server as well as client). Apparently, I cant do this
> unless
> > I
> > > > use
> > > > > > the RPC
> > > > > >
> > > > > > So what I have is a services.xml that looks like this:
> > > > > >  - <#> <service>
> > > > > >  - <#> <operation name="*echo*">
> > > > > >    <messageReceiver class="*
> > > > > > org.apache.axis2.rpc.receivers.RPCMessageReceiver*" />
> > > > > >   </operation>
> > > > > >    <parameter name="*ServiceClass*"
> > > > > > locked="*false*">MyService2</parameter>
> > > > > >   </service>
> > > > > >
> > > > > > A MyService2.java that looks like this:
> > > > > >
> > > > > > public class MyService2 {
> > > > > >     public String echo(String echostring) {
> > > > > >         return echostring;
> > > > > >     }
> > > > > >
> > > > > > }
> > > > > >
> > > > > > I can deploy this using axis2.war on JBoss. It deploys
> fine,
> > and
> > > > I
> > > > > > get the
> > > > > > following WSDL:
> > > > > >
> > > > > > <wsdl:definitions
> > xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
> > > > > > xmlns:axis2="http://ws.apache.org/axis2" xmlns:mime="
> > > > > > http://schemas.xmlsoap.org/wsdl/mime/" xmlns:http="
> > > > > > http://schemas.xmlsoap.org/wsdl/http/"
> > xmlns:ns0="http:///xsd"
> > > > > > xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
> > > > xmlns:ns1="
> > > > > > http://org.apache.axis2/xsd"
> > > > > > xmlns:xs="http://www.w3.org/2001/XMLSchema"
> > > > > > xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
> > > > targetNamespace="
> > > > > > http://ws.apache.org/axis2"><wsdl:types><xs:schema
> > > > > > xmlns:stn_3="http:///xsd"
> > > > > > targetNamespace="http:///xsd"
> elementFormDefault="qualified"
> > > > > > attributeFormDefault="qualified">
> > > > > > <xs:element name="echo">
> > > > > > <xs:complexType>
> > > > > > <xs:sequence>
> > > > > > <xs:element type="xs:string" name="param0" />
> > > > > > </xs:sequence>
> > > > > > </xs:complexType>
> > > > > > </xs:element>
> > > > > > <xs:element name="echoResponse">
> > > > > > <xs:complexType>
> > > > > > <xs:sequence>
> > > > > > <xs:element type="xs:string" name="return" />
> > > > > > </xs:sequence>
> > > > > > </xs:complexType>
> > > > > > </xs:element>
> > > > > > </xs:schema></wsdl:types>
> > > > > >
> > > > > > <wsdl:message name="echoMessage"><wsdl:part
> > element="ns0:echo"
> > > > > > name="part1"
> > > > > > /></wsdl:message><wsdl:message
> name="echoResponse"><wsdl:part
> > > > > > element="ns0:echoResponse" name="part1"
> > > > > > /></wsdl:message><wsdl:portType
> > > > > > name="MyService2PortType"><wsdl:operation
> > name="echo"><wsdl:input
> > > > > > message="axis2:echoMessage" /><wsdl:output
> > > > > > message="axis2:echoResponse"
> > > > > > /></wsdl:operation></wsdl:portType><wsdl:binding
> > > > > > type="axis2:MyService2PortType"
> > > > > > name="MyService2SOAP11Binding"><soap:binding
> > > > > > style="document"
> > transport="http://schemas.xmlsoap.org/soap/http"
> > > > > > /><wsdl:operation name="echo"><soap:operation
> > style="document"
> > > > > > soapAction="urn:echo" /><wsdl:input><soap:body
> use="literal"
> > > > > > /></wsdl:input><wsdl:output><soap:body use="literal"
> > > > > >
> /></wsdl:output></wsdl:operation></wsdl:binding><wsdl:binding
> > > > > > type="axis2:MyService2PortType"
> > > > > > name="MyService2SOAP12Binding"><soap12:binding
> > style="document"
> > > > > > transport="
> > > > > > http://schemas.xmlsoap.org/soap/http" /><wsdl:operation
> > > > > > name="echo"><soap12:operation style="document"
> > > > soapAction="urn:echo"
> > > > > > /><wsdl:input><soap12:body use="literal"
> > > > > > /></wsdl:input><wsdl:output><soap12:body use="literal"
> > > > > >
> /></wsdl:output></wsdl:operation></wsdl:binding><wsdl:binding
> > > > > > type="axis2:MyService2PortType"
> > > > > > name="MyService2HttpBinding"><http:binding
> > > > > > verb="POST" /><wsdl:operation name="echo"><http:operation
> > > > > > location="echo"
> > > > > > /><wsdl:input><mime:content type="text/xml"
> > > > > > /></wsdl:input><wsdl:output><mime:content type="text/xml"
> > > > > >
> /></wsdl:output></wsdl:operation></wsdl:binding><wsdl:service
> > > > > > name="MyService2"><wsdl:port
> > > > binding="axis2:MyService2SOAP11Binding"
> > > > > > name="MyService2SOAP11port_http"><soap:address location="
> > > > > > http://localhost:8080/axis2/services/MyService2"
> > > > > > /></wsdl:port><wsdl:port
> > > > > > binding="axis2:MyService2SOAP12Binding"
> > > > > > name="MyService2SOAP12port_http"><soap12:address location="
> > > > > > http://localhost:8080/axis2/services/MyService2"
> > > > > > /></wsdl:port><wsdl:port
> > > > > > binding="axis2:MyService2HttpBinding"
> > > > > > name="MyService2Httpport0"><http:address location="
> > > > > > http://localhost:8080/axis2/rest/MyService2"
> > > > > > /></wsdl:port></wsdl:service></wsdl:definitions>
> > > > > > I then try to use WSDL2Java to create client stubs based on
> > this
> > > > > > WSDL. It
> > > > > > does generate them, but when I try to run the client I get
> > the
> > > > > > following
> > > > > > error:
> > > > > >
> > > > > >
> > > > > > Exception in thread "main" java.lang.RuntimeException:
> > > > > > java.lang.RuntimeException: Unexpected subelement return
> > > > > >         at
> > > > > >
> > org.apache.axis2.MyService2Stub.fromOM(MyService2Stub.java:665)
> > > > > >         at
> > > > > >
> org.apache.axis2.MyService2Stub.echo(MyService2Stub.java:144)
> > > > > >         at org.apache.axis2.Client.main(Client.java:16)
> > > > > > Caused by: java.lang.RuntimeException: Unexpected
> subelement
> > > > return
> > > > > >         at
> > > > > >
> > > > > org.apache.axis2.MyService2Stub$EchoResponse$Factory.parse(
> > > > > MyService2Stub.java:419)
> > > > > >         at
> > > > > >
> > org.apache.axis2.MyService2Stub.fromOM(MyService2Stub.java:657)
> > > > > > ... 2 more
> > > > > > I googled this and this page (
> > > > > >
> > > > >
> > > > >
> > > >
> > >
> > >
> >
>
http://mail-archives.apache.org/mod_mbox/ws-axis-dev/200605.mbox/%3C23216141.1148303070637.JavaMail.jira@brutus%3E
> > > > > )
> > > > > > claims
> > > > > > that this error message appears because axis2 does not
> > support
> > > > RPC
> > > > > > Bindings.
> > > > > >
> > > > > > I'm confused - how do I generate a client for this WSDL?
> > > > > >
> > > > >
> > > > >
> > > > > __________________________________________________
> > > > > Do You Yahoo!?
> > > > > Tired of spam?  Yahoo! Mail has the best spam protection
> around
> > > > > http://mail.yahoo.com
> > > > >
> > > > >
> > > >
> >
> ---------------------------------------------------------------------
> > > > > To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> > > > > For additional commands, e-mail: axis-user-help@ws.apache.org
> > > > >
> > > > >
> > > >
> > >
> > >
> > > __________________________________________________
> > > Do You Yahoo!?
> > > Tired of spam?  Yahoo! Mail has the best spam protection around
> > > http://mail.yahoo.com
> > >
> > >
> >
> ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> > > For additional commands, e-mail: axis-user-help@ws.apache.org
> > >
> > >
> > 
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around 
> http://mail.yahoo.com 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
> 
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: Axis2 / Axis RPC

Posted by Kinichiro Inoguchi <in...@yahoo.com>.
I'm glad to hear that.
I also hope this issue will be solved until next release.
http://issues.apache.org/jira/browse/AXIS2-865

Regards,
kinichiro

--- M S <mo...@gmail.com> wrote:

> Hi,
> 
> Thank you very much for your help. That solved my problem! I hope
> that this
> is added to the next Axis2 RC.
> 
> Regards
> 
> On 7/9/06, Kinichiro Inoguchi <in...@yahoo.com> wrote:
> >
> > Hi,
> >
> > I sent you 1 jar file by another mail.
> >
> > I think you have 2 problems.
> > One is "WSDL2Java code generation" issue,
> > and another is "response message not qualified well" issue.
> >
> > WSDL2Java code generation issue seems still remain
> > in nightly build 09-Jul-2006 01:35.
> > I got these stack trace,
> >
>
-----------------------------------------------------------------------
> > C:\work>set AXIS2_HOME=C:\work\axis2-std-SNAPSHOT-bin
> > C:\work>%AXIS2_HOME%\bin\wsdl2java -uri
> > http://localhost:8080/axis2/services/MyService2?wsdl -p test -o
> stub
> > Exception in thread "main"
> > org.apache.axis2.wsdl.codegen.CodeGenerationException
> > : java.lang.RuntimeException: java.lang.ClassNotFoundException:
> > org.apache.axis2.schema.ExtensionUtility
> >         at
> > org.apache.axis2.wsdl.codegen.CodeGenerationEngine.generate(
> > CodeGenerationEngine.java:235)
> >         at org.apache.axis2.wsdl.WSDL2Code.main(WSDL2Code.java:32)
> >         at org.apache.axis2.wsdl.WSDL2Java.main(WSDL2Java.java:21)
> > Caused by: java.lang.RuntimeException:
> > java.lang.ClassNotFoundException:
> > org.apache.axis2.schema.ExtensionUtility
> >         at
> > org.apache.axis2.wsdl.codegen.extension.SimpleDBExtension.engage(
> > SimpleDBExtension.java:52)
> >         at
> > org.apache.axis2.wsdl.codegen.CodeGenerationEngine.generate(
> > CodeGenerationEngine.java:188)
> >         ... 2 more
> > Caused by: java.lang.ClassNotFoundException:
> > org.apache.axis2.schema.ExtensionUtility
> >         at java.net.URLClassLoader$1.run(URLClassLoader.java:199)
> >         at java.security.AccessController.doPrivileged(Native
> Method)
> >         at
> java.net.URLClassLoader.findClass(URLClassLoader.java:187)
> >         at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
> >         at
> > sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
> >         at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
> >         at
> > java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
> >         at java.lang.Class.forName0(Native Method)
> >         at java.lang.Class.forName(Class.java:141)
> >         at
> > org.apache.axis2.wsdl.codegen.extension.SimpleDBExtension.engage(
> > SimpleDBExtension.java:44)
> >         ... 3 more
> > C:\work>
> >
>
-----------------------------------------------------------------------
> >
> > The jar file I sent (maybe) solves only response message issue.
> > That does NOT solve WSDL2Java issue.
> >
> > If you want run through with your MyService2,
> > how about using this coupling ?
> > server side : nightly build war + jar I sent.
> > code generation : std-1.0 release.
> >
> > This means,
> > 1. deploy nightly build war to your tomcat.
> > 2. replace jar with jar I sent in
> (tomcat)/webapps/axis2/WEB-INF/lib/ .
> > 3. drop your MyService2.aar to service folder.
> > 4. set AXIS2_HOME to your std-1.0 release folder.
> > 5. generate client stub with WSDL2Java
> > 6. run the client.
> >
> > Regards,
> > kinichiro
> > --- M S <mo...@gmail.com> wrote:
> >
> > > Hi,
> > >
> > > I saw that you have added a solution to your JIRA... is it
> possible
> > > for you
> > > to give me a nightly build with the modifications you have?
> > >
> > > Regards
> > >
> > > On 7/6/06, Kinichiro Inoguchi <in...@yahoo.com> wrote:
> > > >
> > > > Hi,
> > > >
> > > > If you use Axis2 1.0 release version, it will work.
> > > >
> > > > RPCMessageReceiver of Nightly Builds have problem that returns
> > > > "broken" qualified response.
> > > > I created JIRA for this issue today.
> > > >
> > > > generated stub client send message like this,
> > > >       <soapenv:Body>
> > > >          <ns1:echo xmlns:ns1="http:///xsd">
> > > >             <ns1:echostring>from client app</ns1:echostring>
> > > >          </ns1:echo>
> > > >       </soapenv:Body>
> > > >
> > > > RPCMessageReceiver returns message like this,
> > > >       <soapenv:Body>
> > > >          <ns:echoResponse xmlns:ns="http:///xsd">
> > > >             <return>from client app</return>
> > > >          </ns:echoResponse>
> > > >       </soapenv:Body>
> > > >
> > > > <retrun> is NOT qualified with prefix "ns".
> > > > your error message "Unexpected subelement return" of "return"
> means
> > > > this.
> > > >
> > > > > claims
> > > > > that this error message appears because axis2 does not
> support
> > > RPC
> > > > > Bindings.
> > > >
> > > > No, this means Axis2 does not support RPC/Encoded,
> > > > As Anne mentioned before, RPC/literal is supported.
> > > >
> > > > Regards,
> > > > kinichiro
> > > >
> > > > --- M S <mo...@gmail.com> wrote:
> > > >
> > > > > Hi,
> > > > >
> > > > > Basically what I'm trying to do is to create a simple Web
> Service
> > > > > that will
> > > > > receive a String and retun the same string, i.e. basically an
> > > "echo"
> > > > > web
> > > > > service. I tried using the sample on the Axis2 documentation
> page
> > > > > with
> > > > > OMElement - it works fine.
> > > > >
> > > > > My problem is that I want to use String instead of OMElement
> on
> > > both
> > > > > sides
> > > > > (server as well as client). Apparently, I cant do this unless
> I
> > > use
> > > > > the RPC
> > > > >
> > > > > So what I have is a services.xml that looks like this:
> > > > >  - <#> <service>
> > > > >  - <#> <operation name="*echo*">
> > > > >    <messageReceiver class="*
> > > > > org.apache.axis2.rpc.receivers.RPCMessageReceiver*" />
> > > > >   </operation>
> > > > >    <parameter name="*ServiceClass*"
> > > > > locked="*false*">MyService2</parameter>
> > > > >   </service>
> > > > >
> > > > > A MyService2.java that looks like this:
> > > > >
> > > > > public class MyService2 {
> > > > >     public String echo(String echostring) {
> > > > >         return echostring;
> > > > >     }
> > > > >
> > > > > }
> > > > >
> > > > > I can deploy this using axis2.war on JBoss. It deploys fine,
> and
> > > I
> > > > > get the
> > > > > following WSDL:
> > > > >
> > > > > <wsdl:definitions
> xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
> > > > > xmlns:axis2="http://ws.apache.org/axis2" xmlns:mime="
> > > > > http://schemas.xmlsoap.org/wsdl/mime/" xmlns:http="
> > > > > http://schemas.xmlsoap.org/wsdl/http/"
> xmlns:ns0="http:///xsd"
> > > > > xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
> > > xmlns:ns1="
> > > > > http://org.apache.axis2/xsd"
> > > > > xmlns:xs="http://www.w3.org/2001/XMLSchema"
> > > > > xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
> > > targetNamespace="
> > > > > http://ws.apache.org/axis2"><wsdl:types><xs:schema
> > > > > xmlns:stn_3="http:///xsd"
> > > > > targetNamespace="http:///xsd" elementFormDefault="qualified"
> > > > > attributeFormDefault="qualified">
> > > > > <xs:element name="echo">
> > > > > <xs:complexType>
> > > > > <xs:sequence>
> > > > > <xs:element type="xs:string" name="param0" />
> > > > > </xs:sequence>
> > > > > </xs:complexType>
> > > > > </xs:element>
> > > > > <xs:element name="echoResponse">
> > > > > <xs:complexType>
> > > > > <xs:sequence>
> > > > > <xs:element type="xs:string" name="return" />
> > > > > </xs:sequence>
> > > > > </xs:complexType>
> > > > > </xs:element>
> > > > > </xs:schema></wsdl:types>
> > > > >
> > > > > <wsdl:message name="echoMessage"><wsdl:part
> element="ns0:echo"
> > > > > name="part1"
> > > > > /></wsdl:message><wsdl:message name="echoResponse"><wsdl:part
> > > > > element="ns0:echoResponse" name="part1"
> > > > > /></wsdl:message><wsdl:portType
> > > > > name="MyService2PortType"><wsdl:operation
> name="echo"><wsdl:input
> > > > > message="axis2:echoMessage" /><wsdl:output
> > > > > message="axis2:echoResponse"
> > > > > /></wsdl:operation></wsdl:portType><wsdl:binding
> > > > > type="axis2:MyService2PortType"
> > > > > name="MyService2SOAP11Binding"><soap:binding
> > > > > style="document"
> transport="http://schemas.xmlsoap.org/soap/http"
> > > > > /><wsdl:operation name="echo"><soap:operation
> style="document"
> > > > > soapAction="urn:echo" /><wsdl:input><soap:body use="literal"
> > > > > /></wsdl:input><wsdl:output><soap:body use="literal"
> > > > > /></wsdl:output></wsdl:operation></wsdl:binding><wsdl:binding
> > > > > type="axis2:MyService2PortType"
> > > > > name="MyService2SOAP12Binding"><soap12:binding
> style="document"
> > > > > transport="
> > > > > http://schemas.xmlsoap.org/soap/http" /><wsdl:operation
> > > > > name="echo"><soap12:operation style="document"
> > > soapAction="urn:echo"
> > > > > /><wsdl:input><soap12:body use="literal"
> > > > > /></wsdl:input><wsdl:output><soap12:body use="literal"
> > > > > /></wsdl:output></wsdl:operation></wsdl:binding><wsdl:binding
> > > > > type="axis2:MyService2PortType"
> > > > > name="MyService2HttpBinding"><http:binding
> > > > > verb="POST" /><wsdl:operation name="echo"><http:operation
> > > > > location="echo"
> > > > > /><wsdl:input><mime:content type="text/xml"
> > > > > /></wsdl:input><wsdl:output><mime:content type="text/xml"
> > > > > /></wsdl:output></wsdl:operation></wsdl:binding><wsdl:service
> > > > > name="MyService2"><wsdl:port
> > > binding="axis2:MyService2SOAP11Binding"
> > > > > name="MyService2SOAP11port_http"><soap:address location="
> > > > > http://localhost:8080/axis2/services/MyService2"
> > > > > /></wsdl:port><wsdl:port
> > > > > binding="axis2:MyService2SOAP12Binding"
> > > > > name="MyService2SOAP12port_http"><soap12:address location="
> > > > > http://localhost:8080/axis2/services/MyService2"
> > > > > /></wsdl:port><wsdl:port
> > > > > binding="axis2:MyService2HttpBinding"
> > > > > name="MyService2Httpport0"><http:address location="
> > > > > http://localhost:8080/axis2/rest/MyService2"
> > > > > /></wsdl:port></wsdl:service></wsdl:definitions>
> > > > > I then try to use WSDL2Java to create client stubs based on
> this
> > > > > WSDL. It
> > > > > does generate them, but when I try to run the client I get
> the
> > > > > following
> > > > > error:
> > > > >
> > > > >
> > > > > Exception in thread "main" java.lang.RuntimeException:
> > > > > java.lang.RuntimeException: Unexpected subelement return
> > > > >         at
> > > > >
> org.apache.axis2.MyService2Stub.fromOM(MyService2Stub.java:665)
> > > > >         at
> > > > > org.apache.axis2.MyService2Stub.echo(MyService2Stub.java:144)
> > > > >         at org.apache.axis2.Client.main(Client.java:16)
> > > > > Caused by: java.lang.RuntimeException: Unexpected subelement
> > > return
> > > > >         at
> > > > >
> > > > org.apache.axis2.MyService2Stub$EchoResponse$Factory.parse(
> > > > MyService2Stub.java:419)
> > > > >         at
> > > > >
> org.apache.axis2.MyService2Stub.fromOM(MyService2Stub.java:657)
> > > > > ... 2 more
> > > > > I googled this and this page (
> > > > >
> > > >
> > > >
> > >
> >
> >
>
http://mail-archives.apache.org/mod_mbox/ws-axis-dev/200605.mbox/%3C23216141.1148303070637.JavaMail.jira@brutus%3E
> > > > )
> > > > > claims
> > > > > that this error message appears because axis2 does not
> support
> > > RPC
> > > > > Bindings.
> > > > >
> > > > > I'm confused - how do I generate a client for this WSDL?
> > > > >
> > > >
> > > >
> > > > __________________________________________________
> > > > Do You Yahoo!?
> > > > Tired of spam?  Yahoo! Mail has the best spam protection around
> > > > http://mail.yahoo.com
> > > >
> > > >
> > >
> ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> > > > For additional commands, e-mail: axis-user-help@ws.apache.org
> > > >
> > > >
> > >
> >
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Tired of spam?  Yahoo! Mail has the best spam protection around
> > http://mail.yahoo.com
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> > For additional commands, e-mail: axis-user-help@ws.apache.org
> >
> >
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: Axis2 / Axis RPC

Posted by M S <mo...@gmail.com>.
Hi,

Thank you very much for your help. That solved my problem! I hope that this
is added to the next Axis2 RC.

Regards

On 7/9/06, Kinichiro Inoguchi <in...@yahoo.com> wrote:
>
> Hi,
>
> I sent you 1 jar file by another mail.
>
> I think you have 2 problems.
> One is "WSDL2Java code generation" issue,
> and another is "response message not qualified well" issue.
>
> WSDL2Java code generation issue seems still remain
> in nightly build 09-Jul-2006 01:35.
> I got these stack trace,
> -----------------------------------------------------------------------
> C:\work>set AXIS2_HOME=C:\work\axis2-std-SNAPSHOT-bin
> C:\work>%AXIS2_HOME%\bin\wsdl2java -uri
> http://localhost:8080/axis2/services/MyService2?wsdl -p test -o stub
> Exception in thread "main"
> org.apache.axis2.wsdl.codegen.CodeGenerationException
> : java.lang.RuntimeException: java.lang.ClassNotFoundException:
> org.apache.axis2.schema.ExtensionUtility
>         at
> org.apache.axis2.wsdl.codegen.CodeGenerationEngine.generate(
> CodeGenerationEngine.java:235)
>         at org.apache.axis2.wsdl.WSDL2Code.main(WSDL2Code.java:32)
>         at org.apache.axis2.wsdl.WSDL2Java.main(WSDL2Java.java:21)
> Caused by: java.lang.RuntimeException:
> java.lang.ClassNotFoundException:
> org.apache.axis2.schema.ExtensionUtility
>         at
> org.apache.axis2.wsdl.codegen.extension.SimpleDBExtension.engage(
> SimpleDBExtension.java:52)
>         at
> org.apache.axis2.wsdl.codegen.CodeGenerationEngine.generate(
> CodeGenerationEngine.java:188)
>         ... 2 more
> Caused by: java.lang.ClassNotFoundException:
> org.apache.axis2.schema.ExtensionUtility
>         at java.net.URLClassLoader$1.run(URLClassLoader.java:199)
>         at java.security.AccessController.doPrivileged(Native Method)
>         at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
>         at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
>         at
> sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
>         at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
>         at
> java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
>         at java.lang.Class.forName0(Native Method)
>         at java.lang.Class.forName(Class.java:141)
>         at
> org.apache.axis2.wsdl.codegen.extension.SimpleDBExtension.engage(
> SimpleDBExtension.java:44)
>         ... 3 more
> C:\work>
> -----------------------------------------------------------------------
>
> The jar file I sent (maybe) solves only response message issue.
> That does NOT solve WSDL2Java issue.
>
> If you want run through with your MyService2,
> how about using this coupling ?
> server side : nightly build war + jar I sent.
> code generation : std-1.0 release.
>
> This means,
> 1. deploy nightly build war to your tomcat.
> 2. replace jar with jar I sent in (tomcat)/webapps/axis2/WEB-INF/lib/ .
> 3. drop your MyService2.aar to service folder.
> 4. set AXIS2_HOME to your std-1.0 release folder.
> 5. generate client stub with WSDL2Java
> 6. run the client.
>
> Regards,
> kinichiro
> --- M S <mo...@gmail.com> wrote:
>
> > Hi,
> >
> > I saw that you have added a solution to your JIRA... is it possible
> > for you
> > to give me a nightly build with the modifications you have?
> >
> > Regards
> >
> > On 7/6/06, Kinichiro Inoguchi <in...@yahoo.com> wrote:
> > >
> > > Hi,
> > >
> > > If you use Axis2 1.0 release version, it will work.
> > >
> > > RPCMessageReceiver of Nightly Builds have problem that returns
> > > "broken" qualified response.
> > > I created JIRA for this issue today.
> > >
> > > generated stub client send message like this,
> > >       <soapenv:Body>
> > >          <ns1:echo xmlns:ns1="http:///xsd">
> > >             <ns1:echostring>from client app</ns1:echostring>
> > >          </ns1:echo>
> > >       </soapenv:Body>
> > >
> > > RPCMessageReceiver returns message like this,
> > >       <soapenv:Body>
> > >          <ns:echoResponse xmlns:ns="http:///xsd">
> > >             <return>from client app</return>
> > >          </ns:echoResponse>
> > >       </soapenv:Body>
> > >
> > > <retrun> is NOT qualified with prefix "ns".
> > > your error message "Unexpected subelement return" of "return" means
> > > this.
> > >
> > > > claims
> > > > that this error message appears because axis2 does not support
> > RPC
> > > > Bindings.
> > >
> > > No, this means Axis2 does not support RPC/Encoded,
> > > As Anne mentioned before, RPC/literal is supported.
> > >
> > > Regards,
> > > kinichiro
> > >
> > > --- M S <mo...@gmail.com> wrote:
> > >
> > > > Hi,
> > > >
> > > > Basically what I'm trying to do is to create a simple Web Service
> > > > that will
> > > > receive a String and retun the same string, i.e. basically an
> > "echo"
> > > > web
> > > > service. I tried using the sample on the Axis2 documentation page
> > > > with
> > > > OMElement - it works fine.
> > > >
> > > > My problem is that I want to use String instead of OMElement on
> > both
> > > > sides
> > > > (server as well as client). Apparently, I cant do this unless I
> > use
> > > > the RPC
> > > >
> > > > So what I have is a services.xml that looks like this:
> > > >  - <#> <service>
> > > >  - <#> <operation name="*echo*">
> > > >    <messageReceiver class="*
> > > > org.apache.axis2.rpc.receivers.RPCMessageReceiver*" />
> > > >   </operation>
> > > >    <parameter name="*ServiceClass*"
> > > > locked="*false*">MyService2</parameter>
> > > >   </service>
> > > >
> > > > A MyService2.java that looks like this:
> > > >
> > > > public class MyService2 {
> > > >     public String echo(String echostring) {
> > > >         return echostring;
> > > >     }
> > > >
> > > > }
> > > >
> > > > I can deploy this using axis2.war on JBoss. It deploys fine, and
> > I
> > > > get the
> > > > following WSDL:
> > > >
> > > > <wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
> > > > xmlns:axis2="http://ws.apache.org/axis2" xmlns:mime="
> > > > http://schemas.xmlsoap.org/wsdl/mime/" xmlns:http="
> > > > http://schemas.xmlsoap.org/wsdl/http/" xmlns:ns0="http:///xsd"
> > > > xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
> > xmlns:ns1="
> > > > http://org.apache.axis2/xsd"
> > > > xmlns:xs="http://www.w3.org/2001/XMLSchema"
> > > > xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
> > targetNamespace="
> > > > http://ws.apache.org/axis2"><wsdl:types><xs:schema
> > > > xmlns:stn_3="http:///xsd"
> > > > targetNamespace="http:///xsd" elementFormDefault="qualified"
> > > > attributeFormDefault="qualified">
> > > > <xs:element name="echo">
> > > > <xs:complexType>
> > > > <xs:sequence>
> > > > <xs:element type="xs:string" name="param0" />
> > > > </xs:sequence>
> > > > </xs:complexType>
> > > > </xs:element>
> > > > <xs:element name="echoResponse">
> > > > <xs:complexType>
> > > > <xs:sequence>
> > > > <xs:element type="xs:string" name="return" />
> > > > </xs:sequence>
> > > > </xs:complexType>
> > > > </xs:element>
> > > > </xs:schema></wsdl:types>
> > > >
> > > > <wsdl:message name="echoMessage"><wsdl:part element="ns0:echo"
> > > > name="part1"
> > > > /></wsdl:message><wsdl:message name="echoResponse"><wsdl:part
> > > > element="ns0:echoResponse" name="part1"
> > > > /></wsdl:message><wsdl:portType
> > > > name="MyService2PortType"><wsdl:operation name="echo"><wsdl:input
> > > > message="axis2:echoMessage" /><wsdl:output
> > > > message="axis2:echoResponse"
> > > > /></wsdl:operation></wsdl:portType><wsdl:binding
> > > > type="axis2:MyService2PortType"
> > > > name="MyService2SOAP11Binding"><soap:binding
> > > > style="document" transport="http://schemas.xmlsoap.org/soap/http"
> > > > /><wsdl:operation name="echo"><soap:operation style="document"
> > > > soapAction="urn:echo" /><wsdl:input><soap:body use="literal"
> > > > /></wsdl:input><wsdl:output><soap:body use="literal"
> > > > /></wsdl:output></wsdl:operation></wsdl:binding><wsdl:binding
> > > > type="axis2:MyService2PortType"
> > > > name="MyService2SOAP12Binding"><soap12:binding style="document"
> > > > transport="
> > > > http://schemas.xmlsoap.org/soap/http" /><wsdl:operation
> > > > name="echo"><soap12:operation style="document"
> > soapAction="urn:echo"
> > > > /><wsdl:input><soap12:body use="literal"
> > > > /></wsdl:input><wsdl:output><soap12:body use="literal"
> > > > /></wsdl:output></wsdl:operation></wsdl:binding><wsdl:binding
> > > > type="axis2:MyService2PortType"
> > > > name="MyService2HttpBinding"><http:binding
> > > > verb="POST" /><wsdl:operation name="echo"><http:operation
> > > > location="echo"
> > > > /><wsdl:input><mime:content type="text/xml"
> > > > /></wsdl:input><wsdl:output><mime:content type="text/xml"
> > > > /></wsdl:output></wsdl:operation></wsdl:binding><wsdl:service
> > > > name="MyService2"><wsdl:port
> > binding="axis2:MyService2SOAP11Binding"
> > > > name="MyService2SOAP11port_http"><soap:address location="
> > > > http://localhost:8080/axis2/services/MyService2"
> > > > /></wsdl:port><wsdl:port
> > > > binding="axis2:MyService2SOAP12Binding"
> > > > name="MyService2SOAP12port_http"><soap12:address location="
> > > > http://localhost:8080/axis2/services/MyService2"
> > > > /></wsdl:port><wsdl:port
> > > > binding="axis2:MyService2HttpBinding"
> > > > name="MyService2Httpport0"><http:address location="
> > > > http://localhost:8080/axis2/rest/MyService2"
> > > > /></wsdl:port></wsdl:service></wsdl:definitions>
> > > > I then try to use WSDL2Java to create client stubs based on this
> > > > WSDL. It
> > > > does generate them, but when I try to run the client I get the
> > > > following
> > > > error:
> > > >
> > > >
> > > > Exception in thread "main" java.lang.RuntimeException:
> > > > java.lang.RuntimeException: Unexpected subelement return
> > > >         at
> > > > org.apache.axis2.MyService2Stub.fromOM(MyService2Stub.java:665)
> > > >         at
> > > > org.apache.axis2.MyService2Stub.echo(MyService2Stub.java:144)
> > > >         at org.apache.axis2.Client.main(Client.java:16)
> > > > Caused by: java.lang.RuntimeException: Unexpected subelement
> > return
> > > >         at
> > > >
> > > org.apache.axis2.MyService2Stub$EchoResponse$Factory.parse(
> > > MyService2Stub.java:419)
> > > >         at
> > > > org.apache.axis2.MyService2Stub.fromOM(MyService2Stub.java:657)
> > > > ... 2 more
> > > > I googled this and this page (
> > > >
> > >
> > >
> >
>
> http://mail-archives.apache.org/mod_mbox/ws-axis-dev/200605.mbox/%3C23216141.1148303070637.JavaMail.jira@brutus%3E
> > > )
> > > > claims
> > > > that this error message appears because axis2 does not support
> > RPC
> > > > Bindings.
> > > >
> > > > I'm confused - how do I generate a client for this WSDL?
> > > >
> > >
> > >
> > > __________________________________________________
> > > Do You Yahoo!?
> > > Tired of spam?  Yahoo! Mail has the best spam protection around
> > > http://mail.yahoo.com
> > >
> > >
> > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> > > For additional commands, e-mail: axis-user-help@ws.apache.org
> > >
> > >
> >
>
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>

Re: Axis2 / Axis RPC

Posted by Martin Gainty <mg...@hotmail.com>.
-set AXIS2_HOME to the root folder where you have extracted the AXIS2 files
-add %AXIS2_HOME%\lib\axis2-codegen-1.0.jar to your CLASSPATH

Martin--
*********************************************************************
This email message and any files transmitted with it contain confidential
information intended only for the person(s) to whom this email message is
addressed.  If you have received this email message in error, please notify
the sender immediately by telephone or email and destroy the original
message without making a copy.  Thank you.



----- Original Message ----- 
From: "Kinichiro Inoguchi" <in...@yahoo.com>
To: <ax...@ws.apache.org>
Sent: Sunday, July 09, 2006 6:23 AM
Subject: Re: Axis2 / Axis RPC


> Hi,
> 
> I sent you 1 jar file by another mail.
> 
> I think you have 2 problems.
> One is "WSDL2Java code generation" issue, 
> and another is "response message not qualified well" issue.
> 
> WSDL2Java code generation issue seems still remain
> in nightly build 09-Jul-2006 01:35.
> I got these stack trace,
> -----------------------------------------------------------------------
> C:\work>set AXIS2_HOME=C:\work\axis2-std-SNAPSHOT-bin
> C:\work>%AXIS2_HOME%\bin\wsdl2java -uri
> http://localhost:8080/axis2/services/MyService2?wsdl -p test -o stub
> Exception in thread "main"
> org.apache.axis2.wsdl.codegen.CodeGenerationException
> : java.lang.RuntimeException: java.lang.ClassNotFoundException:
> org.apache.axis2.schema.ExtensionUtility
>        at
> org.apache.axis2.wsdl.codegen.CodeGenerationEngine.generate(CodeGenerationEngine.java:235)
>        at org.apache.axis2.wsdl.WSDL2Code.main(WSDL2Code.java:32)
>        at org.apache.axis2.wsdl.WSDL2Java.main(WSDL2Java.java:21)
> Caused by: java.lang.RuntimeException:
> java.lang.ClassNotFoundException:
> org.apache.axis2.schema.ExtensionUtility
>        at
> org.apache.axis2.wsdl.codegen.extension.SimpleDBExtension.engage(SimpleDBExtension.java:52)
>        at
> org.apache.axis2.wsdl.codegen.CodeGenerationEngine.generate(CodeGenerationEngine.java:188)
>        ... 2 more
> Caused by: java.lang.ClassNotFoundException:
> org.apache.axis2.schema.ExtensionUtility
>        at java.net.URLClassLoader$1.run(URLClassLoader.java:199)
>        at java.security.AccessController.doPrivileged(Native Method)
>        at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
>        at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
>        at
> sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
>        at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
>        at
> java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
>        at java.lang.Class.forName0(Native Method)
>        at java.lang.Class.forName(Class.java:141)
>        at
> org.apache.axis2.wsdl.codegen.extension.SimpleDBExtension.engage(SimpleDBExtension.java:44)
>        ... 3 more
> C:\work>
> -----------------------------------------------------------------------
> 
> The jar file I sent (maybe) solves only response message issue.
> That does NOT solve WSDL2Java issue.
> 
> If you want run through with your MyService2,
> how about using this coupling ?
> server side : nightly build war + jar I sent.
> code generation : std-1.0 release.
> 
> This means,
> 1. deploy nightly build war to your tomcat.
> 2. replace jar with jar I sent in (tomcat)/webapps/axis2/WEB-INF/lib/ .
> 3. drop your MyService2.aar to service folder.
> 4. set AXIS2_HOME to your std-1.0 release folder.
> 5. generate client stub with WSDL2Java
> 6. run the client.
> 
> Regards,
> kinichiro
> --- M S <mo...@gmail.com> wrote:
> 
>> Hi,
>> 
>> I saw that you have added a solution to your JIRA... is it possible
>> for you
>> to give me a nightly build with the modifications you have?
>> 
>> Regards
>> 
>> On 7/6/06, Kinichiro Inoguchi <in...@yahoo.com> wrote:
>> >
>> > Hi,
>> >
>> > If you use Axis2 1.0 release version, it will work.
>> >
>> > RPCMessageReceiver of Nightly Builds have problem that returns
>> > "broken" qualified response.
>> > I created JIRA for this issue today.
>> >
>> > generated stub client send message like this,
>> >       <soapenv:Body>
>> >          <ns1:echo xmlns:ns1="http:///xsd">
>> >             <ns1:echostring>from client app</ns1:echostring>
>> >          </ns1:echo>
>> >       </soapenv:Body>
>> >
>> > RPCMessageReceiver returns message like this,
>> >       <soapenv:Body>
>> >          <ns:echoResponse xmlns:ns="http:///xsd">
>> >             <return>from client app</return>
>> >          </ns:echoResponse>
>> >       </soapenv:Body>
>> >
>> > <retrun> is NOT qualified with prefix "ns".
>> > your error message "Unexpected subelement return" of "return" means
>> > this.
>> >
>> > > claims
>> > > that this error message appears because axis2 does not support
>> RPC
>> > > Bindings.
>> >
>> > No, this means Axis2 does not support RPC/Encoded,
>> > As Anne mentioned before, RPC/literal is supported.
>> >
>> > Regards,
>> > kinichiro
>> >
>> > --- M S <mo...@gmail.com> wrote:
>> >
>> > > Hi,
>> > >
>> > > Basically what I'm trying to do is to create a simple Web Service
>> > > that will
>> > > receive a String and retun the same string, i.e. basically an
>> "echo"
>> > > web
>> > > service. I tried using the sample on the Axis2 documentation page
>> > > with
>> > > OMElement - it works fine.
>> > >
>> > > My problem is that I want to use String instead of OMElement on
>> both
>> > > sides
>> > > (server as well as client). Apparently, I cant do this unless I
>> use
>> > > the RPC
>> > >
>> > > So what I have is a services.xml that looks like this:
>> > >  - <#> <service>
>> > >  - <#> <operation name="*echo*">
>> > >    <messageReceiver class="*
>> > > org.apache.axis2.rpc.receivers.RPCMessageReceiver*" />
>> > >   </operation>
>> > >    <parameter name="*ServiceClass*"
>> > > locked="*false*">MyService2</parameter>
>> > >   </service>
>> > >
>> > > A MyService2.java that looks like this:
>> > >
>> > > public class MyService2 {
>> > >     public String echo(String echostring) {
>> > >         return echostring;
>> > >     }
>> > >
>> > > }
>> > >
>> > > I can deploy this using axis2.war on JBoss. It deploys fine, and
>> I
>> > > get the
>> > > following WSDL:
>> > >
>> > > <wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
>> > > xmlns:axis2="http://ws.apache.org/axis2" xmlns:mime="
>> > > http://schemas.xmlsoap.org/wsdl/mime/" xmlns:http="
>> > > http://schemas.xmlsoap.org/wsdl/http/" xmlns:ns0="http:///xsd"
>> > > xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
>> xmlns:ns1="
>> > > http://org.apache.axis2/xsd"
>> > > xmlns:xs="http://www.w3.org/2001/XMLSchema"
>> > > xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
>> targetNamespace="
>> > > http://ws.apache.org/axis2"><wsdl:types><xs:schema
>> > > xmlns:stn_3="http:///xsd"
>> > > targetNamespace="http:///xsd" elementFormDefault="qualified"
>> > > attributeFormDefault="qualified">
>> > > <xs:element name="echo">
>> > > <xs:complexType>
>> > > <xs:sequence>
>> > > <xs:element type="xs:string" name="param0" />
>> > > </xs:sequence>
>> > > </xs:complexType>
>> > > </xs:element>
>> > > <xs:element name="echoResponse">
>> > > <xs:complexType>
>> > > <xs:sequence>
>> > > <xs:element type="xs:string" name="return" />
>> > > </xs:sequence>
>> > > </xs:complexType>
>> > > </xs:element>
>> > > </xs:schema></wsdl:types>
>> > >
>> > > <wsdl:message name="echoMessage"><wsdl:part element="ns0:echo"
>> > > name="part1"
>> > > /></wsdl:message><wsdl:message name="echoResponse"><wsdl:part
>> > > element="ns0:echoResponse" name="part1"
>> > > /></wsdl:message><wsdl:portType
>> > > name="MyService2PortType"><wsdl:operation name="echo"><wsdl:input
>> > > message="axis2:echoMessage" /><wsdl:output
>> > > message="axis2:echoResponse"
>> > > /></wsdl:operation></wsdl:portType><wsdl:binding
>> > > type="axis2:MyService2PortType"
>> > > name="MyService2SOAP11Binding"><soap:binding
>> > > style="document" transport="http://schemas.xmlsoap.org/soap/http"
>> > > /><wsdl:operation name="echo"><soap:operation style="document"
>> > > soapAction="urn:echo" /><wsdl:input><soap:body use="literal"
>> > > /></wsdl:input><wsdl:output><soap:body use="literal"
>> > > /></wsdl:output></wsdl:operation></wsdl:binding><wsdl:binding
>> > > type="axis2:MyService2PortType"
>> > > name="MyService2SOAP12Binding"><soap12:binding style="document"
>> > > transport="
>> > > http://schemas.xmlsoap.org/soap/http" /><wsdl:operation
>> > > name="echo"><soap12:operation style="document"
>> soapAction="urn:echo"
>> > > /><wsdl:input><soap12:body use="literal"
>> > > /></wsdl:input><wsdl:output><soap12:body use="literal"
>> > > /></wsdl:output></wsdl:operation></wsdl:binding><wsdl:binding
>> > > type="axis2:MyService2PortType"
>> > > name="MyService2HttpBinding"><http:binding
>> > > verb="POST" /><wsdl:operation name="echo"><http:operation
>> > > location="echo"
>> > > /><wsdl:input><mime:content type="text/xml"
>> > > /></wsdl:input><wsdl:output><mime:content type="text/xml"
>> > > /></wsdl:output></wsdl:operation></wsdl:binding><wsdl:service
>> > > name="MyService2"><wsdl:port
>> binding="axis2:MyService2SOAP11Binding"
>> > > name="MyService2SOAP11port_http"><soap:address location="
>> > > http://localhost:8080/axis2/services/MyService2"
>> > > /></wsdl:port><wsdl:port
>> > > binding="axis2:MyService2SOAP12Binding"
>> > > name="MyService2SOAP12port_http"><soap12:address location="
>> > > http://localhost:8080/axis2/services/MyService2"
>> > > /></wsdl:port><wsdl:port
>> > > binding="axis2:MyService2HttpBinding"
>> > > name="MyService2Httpport0"><http:address location="
>> > > http://localhost:8080/axis2/rest/MyService2"
>> > > /></wsdl:port></wsdl:service></wsdl:definitions>
>> > > I then try to use WSDL2Java to create client stubs based on this
>> > > WSDL. It
>> > > does generate them, but when I try to run the client I get the
>> > > following
>> > > error:
>> > >
>> > >
>> > > Exception in thread "main" java.lang.RuntimeException:
>> > > java.lang.RuntimeException: Unexpected subelement return
>> > >         at
>> > > org.apache.axis2.MyService2Stub.fromOM(MyService2Stub.java:665)
>> > >         at
>> > > org.apache.axis2.MyService2Stub.echo(MyService2Stub.java:144)
>> > >         at org.apache.axis2.Client.main(Client.java:16)
>> > > Caused by: java.lang.RuntimeException: Unexpected subelement
>> return
>> > >         at
>> > >
>> > org.apache.axis2.MyService2Stub$EchoResponse$Factory.parse(
>> > MyService2Stub.java:419)
>> > >         at
>> > > org.apache.axis2.MyService2Stub.fromOM(MyService2Stub.java:657)
>> > > ... 2 more
>> > > I googled this and this page (
>> > >
>> >
>> >
>>
> http://mail-archives.apache.org/mod_mbox/ws-axis-dev/200605.mbox/%3C23216141.1148303070637.JavaMail.jira@brutus%3E
>> > )
>> > > claims
>> > > that this error message appears because axis2 does not support
>> RPC
>> > > Bindings.
>> > >
>> > > I'm confused - how do I generate a client for this WSDL?
>> > >
>> >
>> >
>> > __________________________________________________
>> > Do You Yahoo!?
>> > Tired of spam?  Yahoo! Mail has the best spam protection around
>> > http://mail.yahoo.com
>> >
>> >
>> ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
>> > For additional commands, e-mail: axis-user-help@ws.apache.org
>> >
>> >
>> 
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around 
> http://mail.yahoo.com 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
> 
>

Re: Axis2 / Axis RPC

Posted by Kinichiro Inoguchi <in...@yahoo.com>.
Hi,

I sent you 1 jar file by another mail.

I think you have 2 problems.
One is "WSDL2Java code generation" issue, 
and another is "response message not qualified well" issue.

WSDL2Java code generation issue seems still remain
in nightly build 09-Jul-2006 01:35.
I got these stack trace,
-----------------------------------------------------------------------
C:\work>set AXIS2_HOME=C:\work\axis2-std-SNAPSHOT-bin
C:\work>%AXIS2_HOME%\bin\wsdl2java -uri
http://localhost:8080/axis2/services/MyService2?wsdl -p test -o stub
Exception in thread "main"
org.apache.axis2.wsdl.codegen.CodeGenerationException
: java.lang.RuntimeException: java.lang.ClassNotFoundException:
org.apache.axis2.schema.ExtensionUtility
        at
org.apache.axis2.wsdl.codegen.CodeGenerationEngine.generate(CodeGenerationEngine.java:235)
        at org.apache.axis2.wsdl.WSDL2Code.main(WSDL2Code.java:32)
        at org.apache.axis2.wsdl.WSDL2Java.main(WSDL2Java.java:21)
Caused by: java.lang.RuntimeException:
java.lang.ClassNotFoundException:
org.apache.axis2.schema.ExtensionUtility
        at
org.apache.axis2.wsdl.codegen.extension.SimpleDBExtension.engage(SimpleDBExtension.java:52)
        at
org.apache.axis2.wsdl.codegen.CodeGenerationEngine.generate(CodeGenerationEngine.java:188)
        ... 2 more
Caused by: java.lang.ClassNotFoundException:
org.apache.axis2.schema.ExtensionUtility
        at java.net.URLClassLoader$1.run(URLClassLoader.java:199)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:187)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
        at
sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:274)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
        at
java.lang.ClassLoader.loadClassInternal(ClassLoader.java:302)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:141)
        at
org.apache.axis2.wsdl.codegen.extension.SimpleDBExtension.engage(SimpleDBExtension.java:44)
        ... 3 more
C:\work>
-----------------------------------------------------------------------

The jar file I sent (maybe) solves only response message issue.
That does NOT solve WSDL2Java issue.

If you want run through with your MyService2,
how about using this coupling ?
server side : nightly build war + jar I sent.
code generation : std-1.0 release.

This means,
1. deploy nightly build war to your tomcat.
2. replace jar with jar I sent in (tomcat)/webapps/axis2/WEB-INF/lib/ .
3. drop your MyService2.aar to service folder.
4. set AXIS2_HOME to your std-1.0 release folder.
5. generate client stub with WSDL2Java
6. run the client.

Regards,
kinichiro
--- M S <mo...@gmail.com> wrote:

> Hi,
> 
> I saw that you have added a solution to your JIRA... is it possible
> for you
> to give me a nightly build with the modifications you have?
> 
> Regards
> 
> On 7/6/06, Kinichiro Inoguchi <in...@yahoo.com> wrote:
> >
> > Hi,
> >
> > If you use Axis2 1.0 release version, it will work.
> >
> > RPCMessageReceiver of Nightly Builds have problem that returns
> > "broken" qualified response.
> > I created JIRA for this issue today.
> >
> > generated stub client send message like this,
> >       <soapenv:Body>
> >          <ns1:echo xmlns:ns1="http:///xsd">
> >             <ns1:echostring>from client app</ns1:echostring>
> >          </ns1:echo>
> >       </soapenv:Body>
> >
> > RPCMessageReceiver returns message like this,
> >       <soapenv:Body>
> >          <ns:echoResponse xmlns:ns="http:///xsd">
> >             <return>from client app</return>
> >          </ns:echoResponse>
> >       </soapenv:Body>
> >
> > <retrun> is NOT qualified with prefix "ns".
> > your error message "Unexpected subelement return" of "return" means
> > this.
> >
> > > claims
> > > that this error message appears because axis2 does not support
> RPC
> > > Bindings.
> >
> > No, this means Axis2 does not support RPC/Encoded,
> > As Anne mentioned before, RPC/literal is supported.
> >
> > Regards,
> > kinichiro
> >
> > --- M S <mo...@gmail.com> wrote:
> >
> > > Hi,
> > >
> > > Basically what I'm trying to do is to create a simple Web Service
> > > that will
> > > receive a String and retun the same string, i.e. basically an
> "echo"
> > > web
> > > service. I tried using the sample on the Axis2 documentation page
> > > with
> > > OMElement - it works fine.
> > >
> > > My problem is that I want to use String instead of OMElement on
> both
> > > sides
> > > (server as well as client). Apparently, I cant do this unless I
> use
> > > the RPC
> > >
> > > So what I have is a services.xml that looks like this:
> > >  - <#> <service>
> > >  - <#> <operation name="*echo*">
> > >    <messageReceiver class="*
> > > org.apache.axis2.rpc.receivers.RPCMessageReceiver*" />
> > >   </operation>
> > >    <parameter name="*ServiceClass*"
> > > locked="*false*">MyService2</parameter>
> > >   </service>
> > >
> > > A MyService2.java that looks like this:
> > >
> > > public class MyService2 {
> > >     public String echo(String echostring) {
> > >         return echostring;
> > >     }
> > >
> > > }
> > >
> > > I can deploy this using axis2.war on JBoss. It deploys fine, and
> I
> > > get the
> > > following WSDL:
> > >
> > > <wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
> > > xmlns:axis2="http://ws.apache.org/axis2" xmlns:mime="
> > > http://schemas.xmlsoap.org/wsdl/mime/" xmlns:http="
> > > http://schemas.xmlsoap.org/wsdl/http/" xmlns:ns0="http:///xsd"
> > > xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
> xmlns:ns1="
> > > http://org.apache.axis2/xsd"
> > > xmlns:xs="http://www.w3.org/2001/XMLSchema"
> > > xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
> targetNamespace="
> > > http://ws.apache.org/axis2"><wsdl:types><xs:schema
> > > xmlns:stn_3="http:///xsd"
> > > targetNamespace="http:///xsd" elementFormDefault="qualified"
> > > attributeFormDefault="qualified">
> > > <xs:element name="echo">
> > > <xs:complexType>
> > > <xs:sequence>
> > > <xs:element type="xs:string" name="param0" />
> > > </xs:sequence>
> > > </xs:complexType>
> > > </xs:element>
> > > <xs:element name="echoResponse">
> > > <xs:complexType>
> > > <xs:sequence>
> > > <xs:element type="xs:string" name="return" />
> > > </xs:sequence>
> > > </xs:complexType>
> > > </xs:element>
> > > </xs:schema></wsdl:types>
> > >
> > > <wsdl:message name="echoMessage"><wsdl:part element="ns0:echo"
> > > name="part1"
> > > /></wsdl:message><wsdl:message name="echoResponse"><wsdl:part
> > > element="ns0:echoResponse" name="part1"
> > > /></wsdl:message><wsdl:portType
> > > name="MyService2PortType"><wsdl:operation name="echo"><wsdl:input
> > > message="axis2:echoMessage" /><wsdl:output
> > > message="axis2:echoResponse"
> > > /></wsdl:operation></wsdl:portType><wsdl:binding
> > > type="axis2:MyService2PortType"
> > > name="MyService2SOAP11Binding"><soap:binding
> > > style="document" transport="http://schemas.xmlsoap.org/soap/http"
> > > /><wsdl:operation name="echo"><soap:operation style="document"
> > > soapAction="urn:echo" /><wsdl:input><soap:body use="literal"
> > > /></wsdl:input><wsdl:output><soap:body use="literal"
> > > /></wsdl:output></wsdl:operation></wsdl:binding><wsdl:binding
> > > type="axis2:MyService2PortType"
> > > name="MyService2SOAP12Binding"><soap12:binding style="document"
> > > transport="
> > > http://schemas.xmlsoap.org/soap/http" /><wsdl:operation
> > > name="echo"><soap12:operation style="document"
> soapAction="urn:echo"
> > > /><wsdl:input><soap12:body use="literal"
> > > /></wsdl:input><wsdl:output><soap12:body use="literal"
> > > /></wsdl:output></wsdl:operation></wsdl:binding><wsdl:binding
> > > type="axis2:MyService2PortType"
> > > name="MyService2HttpBinding"><http:binding
> > > verb="POST" /><wsdl:operation name="echo"><http:operation
> > > location="echo"
> > > /><wsdl:input><mime:content type="text/xml"
> > > /></wsdl:input><wsdl:output><mime:content type="text/xml"
> > > /></wsdl:output></wsdl:operation></wsdl:binding><wsdl:service
> > > name="MyService2"><wsdl:port
> binding="axis2:MyService2SOAP11Binding"
> > > name="MyService2SOAP11port_http"><soap:address location="
> > > http://localhost:8080/axis2/services/MyService2"
> > > /></wsdl:port><wsdl:port
> > > binding="axis2:MyService2SOAP12Binding"
> > > name="MyService2SOAP12port_http"><soap12:address location="
> > > http://localhost:8080/axis2/services/MyService2"
> > > /></wsdl:port><wsdl:port
> > > binding="axis2:MyService2HttpBinding"
> > > name="MyService2Httpport0"><http:address location="
> > > http://localhost:8080/axis2/rest/MyService2"
> > > /></wsdl:port></wsdl:service></wsdl:definitions>
> > > I then try to use WSDL2Java to create client stubs based on this
> > > WSDL. It
> > > does generate them, but when I try to run the client I get the
> > > following
> > > error:
> > >
> > >
> > > Exception in thread "main" java.lang.RuntimeException:
> > > java.lang.RuntimeException: Unexpected subelement return
> > >         at
> > > org.apache.axis2.MyService2Stub.fromOM(MyService2Stub.java:665)
> > >         at
> > > org.apache.axis2.MyService2Stub.echo(MyService2Stub.java:144)
> > >         at org.apache.axis2.Client.main(Client.java:16)
> > > Caused by: java.lang.RuntimeException: Unexpected subelement
> return
> > >         at
> > >
> > org.apache.axis2.MyService2Stub$EchoResponse$Factory.parse(
> > MyService2Stub.java:419)
> > >         at
> > > org.apache.axis2.MyService2Stub.fromOM(MyService2Stub.java:657)
> > > ... 2 more
> > > I googled this and this page (
> > >
> >
> >
>
http://mail-archives.apache.org/mod_mbox/ws-axis-dev/200605.mbox/%3C23216141.1148303070637.JavaMail.jira@brutus%3E
> > )
> > > claims
> > > that this error message appears because axis2 does not support
> RPC
> > > Bindings.
> > >
> > > I'm confused - how do I generate a client for this WSDL?
> > >
> >
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Tired of spam?  Yahoo! Mail has the best spam protection around
> > http://mail.yahoo.com
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> > For additional commands, e-mail: axis-user-help@ws.apache.org
> >
> >
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: Axis2 / Axis RPC

Posted by M S <mo...@gmail.com>.
Hi,

I saw that you have added a solution to your JIRA... is it possible for you
to give me a nightly build with the modifications you have?

Regards

On 7/6/06, Kinichiro Inoguchi <in...@yahoo.com> wrote:
>
> Hi,
>
> If you use Axis2 1.0 release version, it will work.
>
> RPCMessageReceiver of Nightly Builds have problem that returns
> "broken" qualified response.
> I created JIRA for this issue today.
>
> generated stub client send message like this,
>       <soapenv:Body>
>          <ns1:echo xmlns:ns1="http:///xsd">
>             <ns1:echostring>from client app</ns1:echostring>
>          </ns1:echo>
>       </soapenv:Body>
>
> RPCMessageReceiver returns message like this,
>       <soapenv:Body>
>          <ns:echoResponse xmlns:ns="http:///xsd">
>             <return>from client app</return>
>          </ns:echoResponse>
>       </soapenv:Body>
>
> <retrun> is NOT qualified with prefix "ns".
> your error message "Unexpected subelement return" of "return" means
> this.
>
> > claims
> > that this error message appears because axis2 does not support RPC
> > Bindings.
>
> No, this means Axis2 does not support RPC/Encoded,
> As Anne mentioned before, RPC/literal is supported.
>
> Regards,
> kinichiro
>
> --- M S <mo...@gmail.com> wrote:
>
> > Hi,
> >
> > Basically what I'm trying to do is to create a simple Web Service
> > that will
> > receive a String and retun the same string, i.e. basically an "echo"
> > web
> > service. I tried using the sample on the Axis2 documentation page
> > with
> > OMElement - it works fine.
> >
> > My problem is that I want to use String instead of OMElement on both
> > sides
> > (server as well as client). Apparently, I cant do this unless I use
> > the RPC
> >
> > So what I have is a services.xml that looks like this:
> >  - <#> <service>
> >  - <#> <operation name="*echo*">
> >    <messageReceiver class="*
> > org.apache.axis2.rpc.receivers.RPCMessageReceiver*" />
> >   </operation>
> >    <parameter name="*ServiceClass*"
> > locked="*false*">MyService2</parameter>
> >   </service>
> >
> > A MyService2.java that looks like this:
> >
> > public class MyService2 {
> >     public String echo(String echostring) {
> >         return echostring;
> >     }
> >
> > }
> >
> > I can deploy this using axis2.war on JBoss. It deploys fine, and I
> > get the
> > following WSDL:
> >
> > <wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
> > xmlns:axis2="http://ws.apache.org/axis2" xmlns:mime="
> > http://schemas.xmlsoap.org/wsdl/mime/" xmlns:http="
> > http://schemas.xmlsoap.org/wsdl/http/" xmlns:ns0="http:///xsd"
> > xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:ns1="
> > http://org.apache.axis2/xsd"
> > xmlns:xs="http://www.w3.org/2001/XMLSchema"
> > xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" targetNamespace="
> > http://ws.apache.org/axis2"><wsdl:types><xs:schema
> > xmlns:stn_3="http:///xsd"
> > targetNamespace="http:///xsd" elementFormDefault="qualified"
> > attributeFormDefault="qualified">
> > <xs:element name="echo">
> > <xs:complexType>
> > <xs:sequence>
> > <xs:element type="xs:string" name="param0" />
> > </xs:sequence>
> > </xs:complexType>
> > </xs:element>
> > <xs:element name="echoResponse">
> > <xs:complexType>
> > <xs:sequence>
> > <xs:element type="xs:string" name="return" />
> > </xs:sequence>
> > </xs:complexType>
> > </xs:element>
> > </xs:schema></wsdl:types>
> >
> > <wsdl:message name="echoMessage"><wsdl:part element="ns0:echo"
> > name="part1"
> > /></wsdl:message><wsdl:message name="echoResponse"><wsdl:part
> > element="ns0:echoResponse" name="part1"
> > /></wsdl:message><wsdl:portType
> > name="MyService2PortType"><wsdl:operation name="echo"><wsdl:input
> > message="axis2:echoMessage" /><wsdl:output
> > message="axis2:echoResponse"
> > /></wsdl:operation></wsdl:portType><wsdl:binding
> > type="axis2:MyService2PortType"
> > name="MyService2SOAP11Binding"><soap:binding
> > style="document" transport="http://schemas.xmlsoap.org/soap/http"
> > /><wsdl:operation name="echo"><soap:operation style="document"
> > soapAction="urn:echo" /><wsdl:input><soap:body use="literal"
> > /></wsdl:input><wsdl:output><soap:body use="literal"
> > /></wsdl:output></wsdl:operation></wsdl:binding><wsdl:binding
> > type="axis2:MyService2PortType"
> > name="MyService2SOAP12Binding"><soap12:binding style="document"
> > transport="
> > http://schemas.xmlsoap.org/soap/http" /><wsdl:operation
> > name="echo"><soap12:operation style="document" soapAction="urn:echo"
> > /><wsdl:input><soap12:body use="literal"
> > /></wsdl:input><wsdl:output><soap12:body use="literal"
> > /></wsdl:output></wsdl:operation></wsdl:binding><wsdl:binding
> > type="axis2:MyService2PortType"
> > name="MyService2HttpBinding"><http:binding
> > verb="POST" /><wsdl:operation name="echo"><http:operation
> > location="echo"
> > /><wsdl:input><mime:content type="text/xml"
> > /></wsdl:input><wsdl:output><mime:content type="text/xml"
> > /></wsdl:output></wsdl:operation></wsdl:binding><wsdl:service
> > name="MyService2"><wsdl:port binding="axis2:MyService2SOAP11Binding"
> > name="MyService2SOAP11port_http"><soap:address location="
> > http://localhost:8080/axis2/services/MyService2"
> > /></wsdl:port><wsdl:port
> > binding="axis2:MyService2SOAP12Binding"
> > name="MyService2SOAP12port_http"><soap12:address location="
> > http://localhost:8080/axis2/services/MyService2"
> > /></wsdl:port><wsdl:port
> > binding="axis2:MyService2HttpBinding"
> > name="MyService2Httpport0"><http:address location="
> > http://localhost:8080/axis2/rest/MyService2"
> > /></wsdl:port></wsdl:service></wsdl:definitions>
> > I then try to use WSDL2Java to create client stubs based on this
> > WSDL. It
> > does generate them, but when I try to run the client I get the
> > following
> > error:
> >
> >
> > Exception in thread "main" java.lang.RuntimeException:
> > java.lang.RuntimeException: Unexpected subelement return
> >         at
> > org.apache.axis2.MyService2Stub.fromOM(MyService2Stub.java:665)
> >         at
> > org.apache.axis2.MyService2Stub.echo(MyService2Stub.java:144)
> >         at org.apache.axis2.Client.main(Client.java:16)
> > Caused by: java.lang.RuntimeException: Unexpected subelement return
> >         at
> >
> org.apache.axis2.MyService2Stub$EchoResponse$Factory.parse(
> MyService2Stub.java:419)
> >         at
> > org.apache.axis2.MyService2Stub.fromOM(MyService2Stub.java:657)
> > ... 2 more
> > I googled this and this page (
> >
>
> http://mail-archives.apache.org/mod_mbox/ws-axis-dev/200605.mbox/%3C23216141.1148303070637.JavaMail.jira@brutus%3E
> )
> > claims
> > that this error message appears because axis2 does not support RPC
> > Bindings.
> >
> > I'm confused - how do I generate a client for this WSDL?
> >
>
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>

Re: Axis2 / Axis RPC

Posted by Rodrigo Ruiz <rr...@gridsystems.com>.
To "file a Jira" means to report the problem through the Axis2 Bug
tracking system (that just happens to be a JIRA server ;-D)

You will find the link at the Axis home page.

Regards,
Rodrigo Ruiz

M S wrote:
> Hi,
> 
> I don't know what a JIRA is... but is there a way to get around this
> problem? I have been stuck with this problem for some time now and I
> tried everything possible....
> 
> I think this problem must be known, since the author of that page
> already pointed it out and it's been a while since Axis 2 1.0 was
> released. There has to be somebody out there with the same problem...
> 
> On 7/7/06, *Ajith Ranabahu* <ajith.ranabahu@gmail.com
> <ma...@gmail.com>> wrote:
> 
>     Hmm....
>     Sounds like a bug. Please file a Jira with your WSDL attached.
> 
>     Ajith
> 
>     On 7/7/06, M S <mojmoji@gmail.com <ma...@gmail.com>> wrote:
>     > Hi,
>     >
>     >  Well the problem with using Axis2 1.0 is that it generates an
>     erroneus
>     > WSDL. I tried to reproduce the guide at
>     > http://www.wso2.net/tutorials/axis2/java/2006/05/29/hello-world.
>     > According to that page and according to my experience, it creates an
>     > erroneus WSDL which in turn, leads to java stubs that do not
>     contain inner
>     > classes (the author of the above page also points out the fact
>     that one
>     > should use nightly builds). In anycase, I have tried using a
>     nightly build
>     > axis2.war (so that the WSDL is correct) and Axis2 1.0 WSDL2Java
>     (so that the
>     > stub generation is correct), but it doesnt work. Im out of ideas.
>     Anyone?
>     >
>     >  Regards
>     >
>     >
>     > On 7/6/06, Kinichiro Inoguchi < ingc1968@yahoo.com
>     <ma...@yahoo.com>> wrote:
>     > > Hi,
>     > >
>     > > If you use Axis2 1.0 release version, it will work.
>     > >
>     > > RPCMessageReceiver of Nightly Builds have problem that returns
>     > > "broken" qualified response.
>     > > I created JIRA for this issue today.
>     > >
>     > > generated stub client send message like this,
>     > >       <soapenv:Body>
>     > >          <ns1:echo xmlns:ns1=" http:///xsd">
>     > >             <ns1:echostring>from client
>     > app</ns1:echostring>
>     > >          </ns1:echo>
>     > >       </soapenv:Body>
>     > >
>     > > RPCMessageReceiver returns message like this,
>     > >       <soapenv:Body>
>     > >          <ns:echoResponse xmlns:ns=" http:///xsd">
>     > >             <return>from client app</return>
>     > >          </ns:echoResponse>
>     > >       </soapenv:Body>
>     > >
>     > > <retrun> is NOT qualified with prefix "ns".
>     > > your error message "Unexpected subelement return" of "return" means
>     > > this.
>     > >
>     > > > claims
>     > > > that this error message appears because axis2 does not support
>     RPC
>     > > > Bindings.
>     > >
>     > > No, this means Axis2 does not support RPC/Encoded,
>     > > As Anne mentioned before, RPC/literal is supported.
>     > >
>     > > Regards,
>     > > kinichiro
>     > >
>     > > --- M S <mojmoji@gmail.com <ma...@gmail.com>> wrote:
>     > >
>     > > > Hi,
>     > > >
>     > > > Basically what I'm trying to do is to create a simple Web Service
>     > > > that will
>     > > > receive a String and retun the same string, i.e. basically an
>     "echo"
>     > > > web
>     > > > service. I tried using the sample on the Axis2 documentation page
>     > > > with
>     > > > OMElement - it works fine.
>     > > >
>     > > > My problem is that I want to use String instead of OMElement
>     on both
>     > > > sides
>     > > > (server as well as client). Apparently, I cant do this unless
>     I use
>     > > > the RPC
>     > > >
>     > > > So what I have is a services.xml that looks like this:
>     > > >  - <#> <service>
>     > > >  - <#> <operation name="*echo*">
>     > > >    <messageReceiver class="*
>     > > > org.apache.axis2.rpc.receivers.RPCMessageReceiver* " />
>     > > >   </operation>
>     > > >    <parameter name="*ServiceClass*"
>     > > > locked="*false*">MyService2</parameter>
>     > > >   </service>
>     > > >
>     > > > A MyService2.java that looks like this:
>     > > >
>     > > > public class MyService2 {
>     > > >     public String echo(String echostring) {
>     > > >         return echostring;
>     > > >     }
>     > > >
>     > > > }
>     > > >
>     > > > I can deploy this using axis2.war on JBoss. It deploys fine, and I
>     > > > get the
>     > > > following WSDL:
>     > > >
>     > > > <wsdl:definitions
>     > xmlns:wsdl=" http://schemas.xmlsoap.org/wsdl/"
>     > > > xmlns:axis2="http://ws.apache.org/axis2" xmlns:mime="
>     > > > http://schemas.xmlsoap.org/wsdl/mime/" xmlns:http="
>     > > > http://schemas.xmlsoap.org/wsdl/http/"
>     > xmlns:ns0=" http:///xsd"
>     > > > xmlns:soap12=" http://schemas.xmlsoap.org/wsdl/soap12/"
>     > xmlns:ns1="
>     > > > http://org.apache.axis2/xsd"
>     > > > xmlns:xs="http://www.w3.org/2001/XMLSchema "
>     > > > xmlns:soap=" http://schemas.xmlsoap.org/wsdl/soap/"
>     > targetNamespace="
>     > > > http://ws.apache.org/axis2 "><wsdl:types><xs:schema
>     > > > xmlns:stn_3=" http:///xsd"
>     > > > targetNamespace="http:///xsd" elementFormDefault="qualified"
>     > > > attributeFormDefault="qualified">
>     > > > <xs:element name="echo">
>     > > > <xs:complexType>
>     > > > <xs:sequence>
>     > > > <xs:element type="xs:string" name="param0" />
>     > > > </xs:sequence>
>     > > > </xs:complexType>
>     > > > </xs:element>
>     > > > <xs:element name="echoResponse">
>     > > > <xs:complexType>
>     > > > <xs:sequence>
>     > > > <xs:element type="xs:string" name="return" />
>     > > > </xs:sequence>
>     > > > </xs:complexType>
>     > > > </xs:element>
>     > > > </xs:schema></wsdl:types>
>     > > >
>     > > > <wsdl:message name="echoMessage"><wsdl:part element="ns0:echo"
>     > > > name="part1"
>     > > > /></wsdl:message><wsdl:message name="echoResponse"><wsdl:part
>     > > > element="ns0:echoResponse" name="part1"
>     > > > /></wsdl:message><wsdl:portType
>     > > > name="MyService2PortType"><wsdl:operation
>     > name="echo"><wsdl:input
>     > > > message="axis2:echoMessage" /><wsdl:output
>     > > > message="axis2:echoResponse"
>     > > > /></wsdl:operation></wsdl:portType><wsdl:binding
>     > > > type="axis2:MyService2PortType"
>     > > > name="MyService2SOAP11Binding"><soap:binding
>     > > > style="document" transport="
>     > http://schemas.xmlsoap.org/soap/http"
>     > > > /><wsdl:operation name="echo"><soap:operation style="document"
>     > > > soapAction="urn:echo" /><wsdl:input><soap:body use="literal"
>     > > > /></wsdl:input><wsdl:output><soap:body use="literal"
>     > > >
>     > /></wsdl:output></wsdl:operation></wsdl:binding><wsdl:binding
>     > > > type="axis2:MyService2PortType"
>     > > > name="MyService2SOAP12Binding"><soap12:binding
>     > style="document"
>     > > > transport="
>     > > > http://schemas.xmlsoap.org/soap/http" /><wsdl:operation
>     > > > name="echo"><soap12:operation style="document"
>     soapAction="urn:echo"
>     > > > /><wsdl:input><soap12:body use="literal"
>     > > > /></wsdl:input><wsdl:output><soap12:body use="literal"
>     > > >
>     > /></wsdl:output></wsdl:operation></wsdl:binding><wsdl:binding
>     > > > type="axis2:MyService2PortType"
>     > > > name="MyService2HttpBinding"><http:binding
>     > > > verb="POST" /><wsdl:operation name="echo"><http:operation
>     > > > location="echo"
>     > > > /><wsdl:input><mime:content type="text/xml"
>     > > > /></wsdl:input><wsdl:output><mime:content
>     > type="text/xml"
>     > > >
>     > /></wsdl:output></wsdl:operation></wsdl:binding><wsdl:service
>     > > > name="MyService2"><wsdl:port
>     > binding="axis2:MyService2SOAP11Binding"
>     > > > name="MyService2SOAP11port_http"><soap:address
>     > location="
>     > > > http://localhost:8080/axis2/services/MyService2
>     <http://localhost:8080/axis2/services/MyService2>"
>     > > > /></wsdl:port><wsdl:port
>     > > > binding="axis2:MyService2SOAP12Binding"
>     > > > name="MyService2SOAP12port_http"><soap12:address
>     > location="
>     > > > http://localhost:8080/axis2/services/MyService2"
>     > > > /></wsdl:port><wsdl:port
>     > > > binding="axis2:MyService2HttpBinding"
>     > > > name="MyService2Httpport0"><http:address location="
>     > > > http://localhost:8080/axis2/rest/MyService2"
>     > > > /></wsdl:port></wsdl:service></wsdl:definitions>
>     > > > I then try to use WSDL2Java to create client stubs based on this
>     > > > WSDL. It
>     > > > does generate them, but when I try to run the client I get the
>     > > > following
>     > > > error:
>     > > >
>     > > >
>     > > > Exception in thread "main" java.lang.RuntimeException:
>     > > > java.lang.RuntimeException: Unexpected subelement return
>     > > >         at
>     > > >
>     > org.apache.axis2.MyService2Stub.fromOM(MyService2Stub.java:665)
>     > > >         at
>     > > > org.apache.axis2.MyService2Stub.echo
>     > (MyService2Stub.java :144)
>     > > >         at org.apache.axis2.Client.main(Client.java:16)
>     > > > Caused by: java.lang.RuntimeException: Unexpected subelement
>     return
>     > > >         at
>     > > >
>     > >
>     > org.apache.axis2.MyService2Stub$EchoResponse$Factory.parse
>     > (MyService2Stub.java:419)
>     > > >         at
>     > > >
>     > org.apache.axis2.MyService2Stub.fromOM(MyService2Stub.java:657)
>     > > > ... 2 more
>     > > > I googled this and this page (
>     > > >
>     > >
>     >
>     http://mail-archives.apache.org/mod_mbox/ws-axis-dev/200605.mbox/%3C23216141.1148303070637.JavaMail.jira@brutus%3E)
>     > > > claims
>     > > > that this error message appears because axis2 does not support
>     RPC
>     > > > Bindings.
>     > > >
>     > > > I'm confused - how do I generate a client for this WSDL?
>     > > >
>     > >
>     > >
>     > > __________________________________________________
>     > > Do You Yahoo!?
>     > > Tired of spam?  Yahoo! Mail has the best spam protection around
>     > > http://mail.yahoo.com
>     > >
>     > >
>     > ---------------------------------------------------------------------
>     > > To unsubscribe, e-mail:
>     > axis-user-unsubscribe@ws.apache.org
>     <ma...@ws.apache.org>
>     > > For additional commands, e-mail: axis-user-help@ws.apache.org
>     <ma...@ws.apache.org>
>     > >
>     > >
>     >
>     >
> 
> 
>     --
>     Ajith Ranabahu
> 
>     ---------------------------------------------------------------------
>     To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
>     <ma...@ws.apache.org>
>     For additional commands, e-mail: axis-user-help@ws.apache.org
>     <ma...@ws.apache.org>
> 
> 
> 
> ------------------------------------------------------------------------
> 
> No virus found in this incoming message.
> Checked by AVG Free Edition.
> Version: 7.1.394 / Virus Database: 268.9.9/382 - Release Date: 04/07/2006

-- 
-------------------------------------------------------------------
GRIDSYSTEMS                    Rodrigo Ruiz Aguayo
Parc Bit - Son Espanyol
07120 Palma de Mallorca        mailto:rruiz@gridsystems.com
Baleares - EspaƱa              Tel:+34-971435085 Fax:+34-971435082
http://www.gridsystems.com
-------------------------------------------------------------------


-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.394 / Virus Database: 268.9.9/382 - Release Date: 04/07/2006


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: Axis2 / Axis RPC

Posted by M S <mo...@gmail.com>.
Hi,

I don't know what a JIRA is... but is there a way to get around this
problem? I have been stuck with this problem for some time now and I tried
everything possible....

I think this problem must be known, since the author of that page already
pointed it out and it's been a while since Axis 2 1.0 was released. There
has to be somebody out there with the same problem...

On 7/7/06, Ajith Ranabahu <aj...@gmail.com> wrote:
>
> Hmm....
> Sounds like a bug. Please file a Jira with your WSDL attached.
>
> Ajith
>
> On 7/7/06, M S <mo...@gmail.com> wrote:
> > Hi,
> >
> >  Well the problem with using Axis2 1.0 is that it generates an erroneus
> > WSDL. I tried to reproduce the guide at
> > http://www.wso2.net/tutorials/axis2/java/2006/05/29/hello-world.
> > According to that page and according to my experience, it creates an
> > erroneus WSDL which in turn, leads to java stubs that do not contain
> inner
> > classes (the author of the above page also points out the fact that one
> > should use nightly builds). In anycase, I have tried using a nightly
> build
> > axis2.war (so that the WSDL is correct) and Axis2 1.0 WSDL2Java (so that
> the
> > stub generation is correct), but it doesnt work. Im out of ideas.
> Anyone?
> >
> >  Regards
> >
> >
> > On 7/6/06, Kinichiro Inoguchi <in...@yahoo.com> wrote:
> > > Hi,
> > >
> > > If you use Axis2 1.0 release version, it will work.
> > >
> > > RPCMessageReceiver of Nightly Builds have problem that returns
> > > "broken" qualified response.
> > > I created JIRA for this issue today.
> > >
> > > generated stub client send message like this,
> > >       <soapenv:Body>
> > >          <ns1:echo xmlns:ns1="http:///xsd">
> > >             <ns1:echostring>from client
> > app</ns1:echostring>
> > >          </ns1:echo>
> > >       </soapenv:Body>
> > >
> > > RPCMessageReceiver returns message like this,
> > >       <soapenv:Body>
> > >          <ns:echoResponse xmlns:ns=" http:///xsd">
> > >             <return>from client app</return>
> > >          </ns:echoResponse>
> > >       </soapenv:Body>
> > >
> > > <retrun> is NOT qualified with prefix "ns".
> > > your error message "Unexpected subelement return" of "return" means
> > > this.
> > >
> > > > claims
> > > > that this error message appears because axis2 does not support RPC
> > > > Bindings.
> > >
> > > No, this means Axis2 does not support RPC/Encoded,
> > > As Anne mentioned before, RPC/literal is supported.
> > >
> > > Regards,
> > > kinichiro
> > >
> > > --- M S <mo...@gmail.com> wrote:
> > >
> > > > Hi,
> > > >
> > > > Basically what I'm trying to do is to create a simple Web Service
> > > > that will
> > > > receive a String and retun the same string, i.e. basically an "echo"
> > > > web
> > > > service. I tried using the sample on the Axis2 documentation page
> > > > with
> > > > OMElement - it works fine.
> > > >
> > > > My problem is that I want to use String instead of OMElement on both
> > > > sides
> > > > (server as well as client). Apparently, I cant do this unless I use
> > > > the RPC
> > > >
> > > > So what I have is a services.xml that looks like this:
> > > >  - <#> <service>
> > > >  - <#> <operation name="*echo*">
> > > >    <messageReceiver class="*
> > > > org.apache.axis2.rpc.receivers.RPCMessageReceiver* " />
> > > >   </operation>
> > > >    <parameter name="*ServiceClass*"
> > > > locked="*false*">MyService2</parameter>
> > > >   </service>
> > > >
> > > > A MyService2.java that looks like this:
> > > >
> > > > public class MyService2 {
> > > >     public String echo(String echostring) {
> > > >         return echostring;
> > > >     }
> > > >
> > > > }
> > > >
> > > > I can deploy this using axis2.war on JBoss. It deploys fine, and I
> > > > get the
> > > > following WSDL:
> > > >
> > > > <wsdl:definitions
> > xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
> > > > xmlns:axis2="http://ws.apache.org/axis2" xmlns:mime="
> > > > http://schemas.xmlsoap.org/wsdl/mime/" xmlns:http="
> > > > http://schemas.xmlsoap.org/wsdl/http/"
> > xmlns:ns0="http:///xsd"
> > > > xmlns:soap12=" http://schemas.xmlsoap.org/wsdl/soap12/"
> > xmlns:ns1="
> > > > http://org.apache.axis2/xsd"
> > > > xmlns:xs="http://www.w3.org/2001/XMLSchema "
> > > > xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
> > targetNamespace="
> > > > http://ws.apache.org/axis2 "><wsdl:types><xs:schema
> > > > xmlns:stn_3="http:///xsd"
> > > > targetNamespace="http:///xsd" elementFormDefault="qualified"
> > > > attributeFormDefault="qualified">
> > > > <xs:element name="echo">
> > > > <xs:complexType>
> > > > <xs:sequence>
> > > > <xs:element type="xs:string" name="param0" />
> > > > </xs:sequence>
> > > > </xs:complexType>
> > > > </xs:element>
> > > > <xs:element name="echoResponse">
> > > > <xs:complexType>
> > > > <xs:sequence>
> > > > <xs:element type="xs:string" name="return" />
> > > > </xs:sequence>
> > > > </xs:complexType>
> > > > </xs:element>
> > > > </xs:schema></wsdl:types>
> > > >
> > > > <wsdl:message name="echoMessage"><wsdl:part element="ns0:echo"
> > > > name="part1"
> > > > /></wsdl:message><wsdl:message name="echoResponse"><wsdl:part
> > > > element="ns0:echoResponse" name="part1"
> > > > /></wsdl:message><wsdl:portType
> > > > name="MyService2PortType"><wsdl:operation
> > name="echo"><wsdl:input
> > > > message="axis2:echoMessage" /><wsdl:output
> > > > message="axis2:echoResponse"
> > > > /></wsdl:operation></wsdl:portType><wsdl:binding
> > > > type="axis2:MyService2PortType"
> > > > name="MyService2SOAP11Binding"><soap:binding
> > > > style="document" transport="
> > http://schemas.xmlsoap.org/soap/http"
> > > > /><wsdl:operation name="echo"><soap:operation style="document"
> > > > soapAction="urn:echo" /><wsdl:input><soap:body use="literal"
> > > > /></wsdl:input><wsdl:output><soap:body use="literal"
> > > >
> > /></wsdl:output></wsdl:operation></wsdl:binding><wsdl:binding
> > > > type="axis2:MyService2PortType"
> > > > name="MyService2SOAP12Binding"><soap12:binding
> > style="document"
> > > > transport="
> > > > http://schemas.xmlsoap.org/soap/http" /><wsdl:operation
> > > > name="echo"><soap12:operation style="document" soapAction="urn:echo"
> > > > /><wsdl:input><soap12:body use="literal"
> > > > /></wsdl:input><wsdl:output><soap12:body use="literal"
> > > >
> > /></wsdl:output></wsdl:operation></wsdl:binding><wsdl:binding
> > > > type="axis2:MyService2PortType"
> > > > name="MyService2HttpBinding"><http:binding
> > > > verb="POST" /><wsdl:operation name="echo"><http:operation
> > > > location="echo"
> > > > /><wsdl:input><mime:content type="text/xml"
> > > > /></wsdl:input><wsdl:output><mime:content
> > type="text/xml"
> > > >
> > /></wsdl:output></wsdl:operation></wsdl:binding><wsdl:service
> > > > name="MyService2"><wsdl:port
> > binding="axis2:MyService2SOAP11Binding"
> > > > name="MyService2SOAP11port_http"><soap:address
> > location="
> > > > http://localhost:8080/axis2/services/MyService2"
> > > > /></wsdl:port><wsdl:port
> > > > binding="axis2:MyService2SOAP12Binding"
> > > > name="MyService2SOAP12port_http"><soap12:address
> > location="
> > > > http://localhost:8080/axis2/services/MyService2"
> > > > /></wsdl:port><wsdl:port
> > > > binding="axis2:MyService2HttpBinding"
> > > > name="MyService2Httpport0"><http:address location="
> > > > http://localhost:8080/axis2/rest/MyService2"
> > > > /></wsdl:port></wsdl:service></wsdl:definitions>
> > > > I then try to use WSDL2Java to create client stubs based on this
> > > > WSDL. It
> > > > does generate them, but when I try to run the client I get the
> > > > following
> > > > error:
> > > >
> > > >
> > > > Exception in thread "main" java.lang.RuntimeException:
> > > > java.lang.RuntimeException: Unexpected subelement return
> > > >         at
> > > >
> > org.apache.axis2.MyService2Stub.fromOM(MyService2Stub.java:665)
> > > >         at
> > > > org.apache.axis2.MyService2Stub.echo
> > (MyService2Stub.java:144)
> > > >         at org.apache.axis2.Client.main(Client.java:16)
> > > > Caused by: java.lang.RuntimeException: Unexpected subelement return
> > > >         at
> > > >
> > >
> > org.apache.axis2.MyService2Stub$EchoResponse$Factory.parse
> > (MyService2Stub.java:419)
> > > >         at
> > > >
> > org.apache.axis2.MyService2Stub.fromOM(MyService2Stub.java:657)
> > > > ... 2 more
> > > > I googled this and this page (
> > > >
> > >
> >
> http://mail-archives.apache.org/mod_mbox/ws-axis-dev/200605.mbox/%3C23216141.1148303070637.JavaMail.jira@brutus%3E
> )
> > > > claims
> > > > that this error message appears because axis2 does not support RPC
> > > > Bindings.
> > > >
> > > > I'm confused - how do I generate a client for this WSDL?
> > > >
> > >
> > >
> > > __________________________________________________
> > > Do You Yahoo!?
> > > Tired of spam?  Yahoo! Mail has the best spam protection around
> > > http://mail.yahoo.com
> > >
> > >
> > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail:
> > axis-user-unsubscribe@ws.apache.org
> > > For additional commands, e-mail: axis-user-help@ws.apache.org
> > >
> > >
> >
> >
>
>
> --
> Ajith Ranabahu
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>

Re: Axis2 / Axis RPC

Posted by Ajith Ranabahu <aj...@gmail.com>.
Hmm....
Sounds like a bug. Please file a Jira with your WSDL attached.

Ajith

On 7/7/06, M S <mo...@gmail.com> wrote:
> Hi,
>
>  Well the problem with using Axis2 1.0 is that it generates an erroneus
> WSDL. I tried to reproduce the guide at
> http://www.wso2.net/tutorials/axis2/java/2006/05/29/hello-world.
> According to that page and according to my experience, it creates an
> erroneus WSDL which in turn, leads to java stubs that do not contain inner
> classes (the author of the above page also points out the fact that one
> should use nightly builds). In anycase, I have tried using a nightly build
> axis2.war (so that the WSDL is correct) and Axis2 1.0 WSDL2Java (so that the
> stub generation is correct), but it doesnt work. Im out of ideas. Anyone?
>
>  Regards
>
>
> On 7/6/06, Kinichiro Inoguchi <in...@yahoo.com> wrote:
> > Hi,
> >
> > If you use Axis2 1.0 release version, it will work.
> >
> > RPCMessageReceiver of Nightly Builds have problem that returns
> > "broken" qualified response.
> > I created JIRA for this issue today.
> >
> > generated stub client send message like this,
> >       <soapenv:Body>
> >          <ns1:echo xmlns:ns1="http:///xsd">
> >             <ns1:echostring>from client
> app</ns1:echostring>
> >          </ns1:echo>
> >       </soapenv:Body>
> >
> > RPCMessageReceiver returns message like this,
> >       <soapenv:Body>
> >          <ns:echoResponse xmlns:ns=" http:///xsd">
> >             <return>from client app</return>
> >          </ns:echoResponse>
> >       </soapenv:Body>
> >
> > <retrun> is NOT qualified with prefix "ns".
> > your error message "Unexpected subelement return" of "return" means
> > this.
> >
> > > claims
> > > that this error message appears because axis2 does not support RPC
> > > Bindings.
> >
> > No, this means Axis2 does not support RPC/Encoded,
> > As Anne mentioned before, RPC/literal is supported.
> >
> > Regards,
> > kinichiro
> >
> > --- M S <mo...@gmail.com> wrote:
> >
> > > Hi,
> > >
> > > Basically what I'm trying to do is to create a simple Web Service
> > > that will
> > > receive a String and retun the same string, i.e. basically an "echo"
> > > web
> > > service. I tried using the sample on the Axis2 documentation page
> > > with
> > > OMElement - it works fine.
> > >
> > > My problem is that I want to use String instead of OMElement on both
> > > sides
> > > (server as well as client). Apparently, I cant do this unless I use
> > > the RPC
> > >
> > > So what I have is a services.xml that looks like this:
> > >  - <#> <service>
> > >  - <#> <operation name="*echo*">
> > >    <messageReceiver class="*
> > > org.apache.axis2.rpc.receivers.RPCMessageReceiver* " />
> > >   </operation>
> > >    <parameter name="*ServiceClass*"
> > > locked="*false*">MyService2</parameter>
> > >   </service>
> > >
> > > A MyService2.java that looks like this:
> > >
> > > public class MyService2 {
> > >     public String echo(String echostring) {
> > >         return echostring;
> > >     }
> > >
> > > }
> > >
> > > I can deploy this using axis2.war on JBoss. It deploys fine, and I
> > > get the
> > > following WSDL:
> > >
> > > <wsdl:definitions
> xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
> > > xmlns:axis2="http://ws.apache.org/axis2" xmlns:mime="
> > > http://schemas.xmlsoap.org/wsdl/mime/" xmlns:http="
> > > http://schemas.xmlsoap.org/wsdl/http/"
> xmlns:ns0="http:///xsd"
> > > xmlns:soap12=" http://schemas.xmlsoap.org/wsdl/soap12/"
> xmlns:ns1="
> > > http://org.apache.axis2/xsd"
> > > xmlns:xs="http://www.w3.org/2001/XMLSchema "
> > > xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
> targetNamespace="
> > > http://ws.apache.org/axis2 "><wsdl:types><xs:schema
> > > xmlns:stn_3="http:///xsd"
> > > targetNamespace="http:///xsd" elementFormDefault="qualified"
> > > attributeFormDefault="qualified">
> > > <xs:element name="echo">
> > > <xs:complexType>
> > > <xs:sequence>
> > > <xs:element type="xs:string" name="param0" />
> > > </xs:sequence>
> > > </xs:complexType>
> > > </xs:element>
> > > <xs:element name="echoResponse">
> > > <xs:complexType>
> > > <xs:sequence>
> > > <xs:element type="xs:string" name="return" />
> > > </xs:sequence>
> > > </xs:complexType>
> > > </xs:element>
> > > </xs:schema></wsdl:types>
> > >
> > > <wsdl:message name="echoMessage"><wsdl:part element="ns0:echo"
> > > name="part1"
> > > /></wsdl:message><wsdl:message name="echoResponse"><wsdl:part
> > > element="ns0:echoResponse" name="part1"
> > > /></wsdl:message><wsdl:portType
> > > name="MyService2PortType"><wsdl:operation
> name="echo"><wsdl:input
> > > message="axis2:echoMessage" /><wsdl:output
> > > message="axis2:echoResponse"
> > > /></wsdl:operation></wsdl:portType><wsdl:binding
> > > type="axis2:MyService2PortType"
> > > name="MyService2SOAP11Binding"><soap:binding
> > > style="document" transport="
> http://schemas.xmlsoap.org/soap/http"
> > > /><wsdl:operation name="echo"><soap:operation style="document"
> > > soapAction="urn:echo" /><wsdl:input><soap:body use="literal"
> > > /></wsdl:input><wsdl:output><soap:body use="literal"
> > >
> /></wsdl:output></wsdl:operation></wsdl:binding><wsdl:binding
> > > type="axis2:MyService2PortType"
> > > name="MyService2SOAP12Binding"><soap12:binding
> style="document"
> > > transport="
> > > http://schemas.xmlsoap.org/soap/http" /><wsdl:operation
> > > name="echo"><soap12:operation style="document" soapAction="urn:echo"
> > > /><wsdl:input><soap12:body use="literal"
> > > /></wsdl:input><wsdl:output><soap12:body use="literal"
> > >
> /></wsdl:output></wsdl:operation></wsdl:binding><wsdl:binding
> > > type="axis2:MyService2PortType"
> > > name="MyService2HttpBinding"><http:binding
> > > verb="POST" /><wsdl:operation name="echo"><http:operation
> > > location="echo"
> > > /><wsdl:input><mime:content type="text/xml"
> > > /></wsdl:input><wsdl:output><mime:content
> type="text/xml"
> > >
> /></wsdl:output></wsdl:operation></wsdl:binding><wsdl:service
> > > name="MyService2"><wsdl:port
> binding="axis2:MyService2SOAP11Binding"
> > > name="MyService2SOAP11port_http"><soap:address
> location="
> > > http://localhost:8080/axis2/services/MyService2"
> > > /></wsdl:port><wsdl:port
> > > binding="axis2:MyService2SOAP12Binding"
> > > name="MyService2SOAP12port_http"><soap12:address
> location="
> > > http://localhost:8080/axis2/services/MyService2"
> > > /></wsdl:port><wsdl:port
> > > binding="axis2:MyService2HttpBinding"
> > > name="MyService2Httpport0"><http:address location="
> > > http://localhost:8080/axis2/rest/MyService2"
> > > /></wsdl:port></wsdl:service></wsdl:definitions>
> > > I then try to use WSDL2Java to create client stubs based on this
> > > WSDL. It
> > > does generate them, but when I try to run the client I get the
> > > following
> > > error:
> > >
> > >
> > > Exception in thread "main" java.lang.RuntimeException:
> > > java.lang.RuntimeException: Unexpected subelement return
> > >         at
> > >
> org.apache.axis2.MyService2Stub.fromOM(MyService2Stub.java:665)
> > >         at
> > > org.apache.axis2.MyService2Stub.echo
> (MyService2Stub.java:144)
> > >         at org.apache.axis2.Client.main(Client.java:16)
> > > Caused by: java.lang.RuntimeException: Unexpected subelement return
> > >         at
> > >
> >
> org.apache.axis2.MyService2Stub$EchoResponse$Factory.parse
> (MyService2Stub.java:419)
> > >         at
> > >
> org.apache.axis2.MyService2Stub.fromOM(MyService2Stub.java:657)
> > > ... 2 more
> > > I googled this and this page (
> > >
> >
> http://mail-archives.apache.org/mod_mbox/ws-axis-dev/200605.mbox/%3C23216141.1148303070637.JavaMail.jira@brutus%3E)
> > > claims
> > > that this error message appears because axis2 does not support RPC
> > > Bindings.
> > >
> > > I'm confused - how do I generate a client for this WSDL?
> > >
> >
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Tired of spam?  Yahoo! Mail has the best spam protection around
> > http://mail.yahoo.com
> >
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> axis-user-unsubscribe@ws.apache.org
> > For additional commands, e-mail: axis-user-help@ws.apache.org
> >
> >
>
>


-- 
Ajith Ranabahu

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: Axis2 / Axis RPC

Posted by M S <mo...@gmail.com>.
Hi,

Well the problem with using Axis2 1.0 is that it generates an erroneus WSDL.
I tried to reproduce the guide at
http://www.wso2.net/tutorials/axis2/java/2006/05/29/hello-world. According
to that page and according to my experience, it creates an erroneus WSDL
which in turn, leads to java stubs that do not contain inner classes (the
author of the above page also points out the fact that one should use
nightly builds). In anycase, I have tried using a nightly build
axis2.war(so that the WSDL is correct) and Axis2
1.0 WSDL2Java (so that the stub generation is correct), but it doesnt work.
Im out of ideas. Anyone?

Regards

On 7/6/06, Kinichiro Inoguchi <in...@yahoo.com> wrote:
>
> Hi,
>
> If you use Axis2 1.0 release version, it will work.
>
> RPCMessageReceiver of Nightly Builds have problem that returns
> "broken" qualified response.
> I created JIRA for this issue today.
>
> generated stub client send message like this,
>       <soapenv:Body>
>          <ns1:echo xmlns:ns1="http:///xsd">
>             <ns1:echostring>from client app</ns1:echostring>
>          </ns1:echo>
>       </soapenv:Body>
>
> RPCMessageReceiver returns message like this,
>       <soapenv:Body>
>          <ns:echoResponse xmlns:ns="http:///xsd">
>             <return>from client app</return>
>          </ns:echoResponse>
>       </soapenv:Body>
>
> <retrun> is NOT qualified with prefix "ns".
> your error message "Unexpected subelement return" of "return" means
> this.
>
> > claims
> > that this error message appears because axis2 does not support RPC
> > Bindings.
>
> No, this means Axis2 does not support RPC/Encoded,
> As Anne mentioned before, RPC/literal is supported.
>
> Regards,
> kinichiro
>
> --- M S <mo...@gmail.com> wrote:
>
> > Hi,
> >
> > Basically what I'm trying to do is to create a simple Web Service
> > that will
> > receive a String and retun the same string, i.e. basically an "echo"
> > web
> > service. I tried using the sample on the Axis2 documentation page
> > with
> > OMElement - it works fine.
> >
> > My problem is that I want to use String instead of OMElement on both
> > sides
> > (server as well as client). Apparently, I cant do this unless I use
> > the RPC
> >
> > So what I have is a services.xml that looks like this:
> >  - <#> <service>
> >  - <#> <operation name="*echo*">
> >    <messageReceiver class="*
> > org.apache.axis2.rpc.receivers.RPCMessageReceiver*" />
> >   </operation>
> >    <parameter name="*ServiceClass*"
> > locked="*false*">MyService2</parameter>
> >   </service>
> >
> > A MyService2.java that looks like this:
> >
> > public class MyService2 {
> >     public String echo(String echostring) {
> >         return echostring;
> >     }
> >
> > }
> >
> > I can deploy this using axis2.war on JBoss. It deploys fine, and I
> > get the
> > following WSDL:
> >
> > <wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
> > xmlns:axis2="http://ws.apache.org/axis2" xmlns:mime="
> > http://schemas.xmlsoap.org/wsdl/mime/" xmlns:http="
> > http://schemas.xmlsoap.org/wsdl/http/" xmlns:ns0="http:///xsd"
> > xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:ns1="
> > http://org.apache.axis2/xsd"
> > xmlns:xs="http://www.w3.org/2001/XMLSchema"
> > xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" targetNamespace="
> > http://ws.apache.org/axis2"><wsdl:types><xs:schema
> > xmlns:stn_3="http:///xsd"
> > targetNamespace="http:///xsd" elementFormDefault="qualified"
> > attributeFormDefault="qualified">
> > <xs:element name="echo">
> > <xs:complexType>
> > <xs:sequence>
> > <xs:element type="xs:string" name="param0" />
> > </xs:sequence>
> > </xs:complexType>
> > </xs:element>
> > <xs:element name="echoResponse">
> > <xs:complexType>
> > <xs:sequence>
> > <xs:element type="xs:string" name="return" />
> > </xs:sequence>
> > </xs:complexType>
> > </xs:element>
> > </xs:schema></wsdl:types>
> >
> > <wsdl:message name="echoMessage"><wsdl:part element="ns0:echo"
> > name="part1"
> > /></wsdl:message><wsdl:message name="echoResponse"><wsdl:part
> > element="ns0:echoResponse" name="part1"
> > /></wsdl:message><wsdl:portType
> > name="MyService2PortType"><wsdl:operation name="echo"><wsdl:input
> > message="axis2:echoMessage" /><wsdl:output
> > message="axis2:echoResponse"
> > /></wsdl:operation></wsdl:portType><wsdl:binding
> > type="axis2:MyService2PortType"
> > name="MyService2SOAP11Binding"><soap:binding
> > style="document" transport="http://schemas.xmlsoap.org/soap/http"
> > /><wsdl:operation name="echo"><soap:operation style="document"
> > soapAction="urn:echo" /><wsdl:input><soap:body use="literal"
> > /></wsdl:input><wsdl:output><soap:body use="literal"
> > /></wsdl:output></wsdl:operation></wsdl:binding><wsdl:binding
> > type="axis2:MyService2PortType"
> > name="MyService2SOAP12Binding"><soap12:binding style="document"
> > transport="
> > http://schemas.xmlsoap.org/soap/http" /><wsdl:operation
> > name="echo"><soap12:operation style="document" soapAction="urn:echo"
> > /><wsdl:input><soap12:body use="literal"
> > /></wsdl:input><wsdl:output><soap12:body use="literal"
> > /></wsdl:output></wsdl:operation></wsdl:binding><wsdl:binding
> > type="axis2:MyService2PortType"
> > name="MyService2HttpBinding"><http:binding
> > verb="POST" /><wsdl:operation name="echo"><http:operation
> > location="echo"
> > /><wsdl:input><mime:content type="text/xml"
> > /></wsdl:input><wsdl:output><mime:content type="text/xml"
> > /></wsdl:output></wsdl:operation></wsdl:binding><wsdl:service
> > name="MyService2"><wsdl:port binding="axis2:MyService2SOAP11Binding"
> > name="MyService2SOAP11port_http"><soap:address location="
> > http://localhost:8080/axis2/services/MyService2"
> > /></wsdl:port><wsdl:port
> > binding="axis2:MyService2SOAP12Binding"
> > name="MyService2SOAP12port_http"><soap12:address location="
> > http://localhost:8080/axis2/services/MyService2"
> > /></wsdl:port><wsdl:port
> > binding="axis2:MyService2HttpBinding"
> > name="MyService2Httpport0"><http:address location="
> > http://localhost:8080/axis2/rest/MyService2"
> > /></wsdl:port></wsdl:service></wsdl:definitions>
> > I then try to use WSDL2Java to create client stubs based on this
> > WSDL. It
> > does generate them, but when I try to run the client I get the
> > following
> > error:
> >
> >
> > Exception in thread "main" java.lang.RuntimeException:
> > java.lang.RuntimeException: Unexpected subelement return
> >         at
> > org.apache.axis2.MyService2Stub.fromOM(MyService2Stub.java:665)
> >         at
> > org.apache.axis2.MyService2Stub.echo(MyService2Stub.java:144)
> >         at org.apache.axis2.Client.main(Client.java:16)
> > Caused by: java.lang.RuntimeException: Unexpected subelement return
> >         at
> >
> org.apache.axis2.MyService2Stub$EchoResponse$Factory.parse(
> MyService2Stub.java:419)
> >         at
> > org.apache.axis2.MyService2Stub.fromOM(MyService2Stub.java:657)
> > ... 2 more
> > I googled this and this page (
> >
>
> http://mail-archives.apache.org/mod_mbox/ws-axis-dev/200605.mbox/%3C23216141.1148303070637.JavaMail.jira@brutus%3E
> )
> > claims
> > that this error message appears because axis2 does not support RPC
> > Bindings.
> >
> > I'm confused - how do I generate a client for this WSDL?
> >
>
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>

Re: Axis2 / Axis RPC

Posted by Kinichiro Inoguchi <in...@yahoo.com>.
Hi,

If you use Axis2 1.0 release version, it will work.

RPCMessageReceiver of Nightly Builds have problem that returns
"broken" qualified response.
I created JIRA for this issue today.

generated stub client send message like this,
      <soapenv:Body>
         <ns1:echo xmlns:ns1="http:///xsd">
            <ns1:echostring>from client app</ns1:echostring>
         </ns1:echo>
      </soapenv:Body>

RPCMessageReceiver returns message like this,
      <soapenv:Body>
         <ns:echoResponse xmlns:ns="http:///xsd">
            <return>from client app</return>
         </ns:echoResponse>
      </soapenv:Body>

<retrun> is NOT qualified with prefix "ns".
your error message "Unexpected subelement return" of "return" means
this.

> claims
> that this error message appears because axis2 does not support RPC
> Bindings.

No, this means Axis2 does not support RPC/Encoded,
As Anne mentioned before, RPC/literal is supported.

Regards,
kinichiro

--- M S <mo...@gmail.com> wrote:

> Hi,
> 
> Basically what I'm trying to do is to create a simple Web Service
> that will
> receive a String and retun the same string, i.e. basically an "echo"
> web
> service. I tried using the sample on the Axis2 documentation page
> with
> OMElement - it works fine.
> 
> My problem is that I want to use String instead of OMElement on both
> sides
> (server as well as client). Apparently, I cant do this unless I use
> the RPC
> 
> So what I have is a services.xml that looks like this:
>  - <#> <service>
>  - <#> <operation name="*echo*">
>    <messageReceiver class="*
> org.apache.axis2.rpc.receivers.RPCMessageReceiver*" />
>   </operation>
>    <parameter name="*ServiceClass*"
> locked="*false*">MyService2</parameter>
>   </service>
> 
> A MyService2.java that looks like this:
> 
> public class MyService2 {
>     public String echo(String echostring) {
>         return echostring;
>     }
> 
> }
> 
> I can deploy this using axis2.war on JBoss. It deploys fine, and I
> get the
> following WSDL:
> 
> <wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
> xmlns:axis2="http://ws.apache.org/axis2" xmlns:mime="
> http://schemas.xmlsoap.org/wsdl/mime/" xmlns:http="
> http://schemas.xmlsoap.org/wsdl/http/" xmlns:ns0="http:///xsd"
> xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:ns1="
> http://org.apache.axis2/xsd"
> xmlns:xs="http://www.w3.org/2001/XMLSchema"
> xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" targetNamespace="
> http://ws.apache.org/axis2"><wsdl:types><xs:schema
> xmlns:stn_3="http:///xsd"
> targetNamespace="http:///xsd" elementFormDefault="qualified"
> attributeFormDefault="qualified">
> <xs:element name="echo">
> <xs:complexType>
> <xs:sequence>
> <xs:element type="xs:string" name="param0" />
> </xs:sequence>
> </xs:complexType>
> </xs:element>
> <xs:element name="echoResponse">
> <xs:complexType>
> <xs:sequence>
> <xs:element type="xs:string" name="return" />
> </xs:sequence>
> </xs:complexType>
> </xs:element>
> </xs:schema></wsdl:types>
> 
> <wsdl:message name="echoMessage"><wsdl:part element="ns0:echo"
> name="part1"
> /></wsdl:message><wsdl:message name="echoResponse"><wsdl:part
> element="ns0:echoResponse" name="part1"
> /></wsdl:message><wsdl:portType
> name="MyService2PortType"><wsdl:operation name="echo"><wsdl:input
> message="axis2:echoMessage" /><wsdl:output
> message="axis2:echoResponse"
> /></wsdl:operation></wsdl:portType><wsdl:binding
> type="axis2:MyService2PortType"
> name="MyService2SOAP11Binding"><soap:binding
> style="document" transport="http://schemas.xmlsoap.org/soap/http"
> /><wsdl:operation name="echo"><soap:operation style="document"
> soapAction="urn:echo" /><wsdl:input><soap:body use="literal"
> /></wsdl:input><wsdl:output><soap:body use="literal"
> /></wsdl:output></wsdl:operation></wsdl:binding><wsdl:binding
> type="axis2:MyService2PortType"
> name="MyService2SOAP12Binding"><soap12:binding style="document"
> transport="
> http://schemas.xmlsoap.org/soap/http" /><wsdl:operation
> name="echo"><soap12:operation style="document" soapAction="urn:echo"
> /><wsdl:input><soap12:body use="literal"
> /></wsdl:input><wsdl:output><soap12:body use="literal"
> /></wsdl:output></wsdl:operation></wsdl:binding><wsdl:binding
> type="axis2:MyService2PortType"
> name="MyService2HttpBinding"><http:binding
> verb="POST" /><wsdl:operation name="echo"><http:operation
> location="echo"
> /><wsdl:input><mime:content type="text/xml"
> /></wsdl:input><wsdl:output><mime:content type="text/xml"
> /></wsdl:output></wsdl:operation></wsdl:binding><wsdl:service
> name="MyService2"><wsdl:port binding="axis2:MyService2SOAP11Binding"
> name="MyService2SOAP11port_http"><soap:address location="
> http://localhost:8080/axis2/services/MyService2"
> /></wsdl:port><wsdl:port
> binding="axis2:MyService2SOAP12Binding"
> name="MyService2SOAP12port_http"><soap12:address location="
> http://localhost:8080/axis2/services/MyService2"
> /></wsdl:port><wsdl:port
> binding="axis2:MyService2HttpBinding"
> name="MyService2Httpport0"><http:address location="
> http://localhost:8080/axis2/rest/MyService2"
> /></wsdl:port></wsdl:service></wsdl:definitions>
> I then try to use WSDL2Java to create client stubs based on this
> WSDL. It
> does generate them, but when I try to run the client I get the
> following
> error:
> 
> 
> Exception in thread "main" java.lang.RuntimeException:
> java.lang.RuntimeException: Unexpected subelement return
>         at
> org.apache.axis2.MyService2Stub.fromOM(MyService2Stub.java:665)
>         at
> org.apache.axis2.MyService2Stub.echo(MyService2Stub.java:144)
>         at org.apache.axis2.Client.main(Client.java:16)
> Caused by: java.lang.RuntimeException: Unexpected subelement return
>         at
>
org.apache.axis2.MyService2Stub$EchoResponse$Factory.parse(MyService2Stub.java:419)
>         at
> org.apache.axis2.MyService2Stub.fromOM(MyService2Stub.java:657)
> ... 2 more
> I googled this and this page (
>
http://mail-archives.apache.org/mod_mbox/ws-axis-dev/200605.mbox/%3C23216141.1148303070637.JavaMail.jira@brutus%3E)
> claims
> that this error message appears because axis2 does not support RPC
> Bindings.
> 
> I'm confused - how do I generate a client for this WSDL?
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: Axis2 / Axis RPC

Posted by M S <mo...@gmail.com>.
Hi,

Basically what I'm trying to do is to create a simple Web Service that will
receive a String and retun the same string, i.e. basically an "echo" web
service. I tried using the sample on the Axis2 documentation page with
OMElement - it works fine.

My problem is that I want to use String instead of OMElement on both sides
(server as well as client). Apparently, I cant do this unless I use the RPC

So what I have is a services.xml that looks like this:
 - <#> <service>
 - <#> <operation name="*echo*">
   <messageReceiver class="*
org.apache.axis2.rpc.receivers.RPCMessageReceiver*" />
  </operation>
   <parameter name="*ServiceClass*" locked="*false*">MyService2</parameter>
  </service>

A MyService2.java that looks like this:

public class MyService2 {
    public String echo(String echostring) {
        return echostring;
    }

}

I can deploy this using axis2.war on JBoss. It deploys fine, and I get the
following WSDL:

<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:axis2="http://ws.apache.org/axis2" xmlns:mime="
http://schemas.xmlsoap.org/wsdl/mime/" xmlns:http="
http://schemas.xmlsoap.org/wsdl/http/" xmlns:ns0="http:///xsd"
xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:ns1="
http://org.apache.axis2/xsd" xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" targetNamespace="
http://ws.apache.org/axis2"><wsdl:types><xs:schema xmlns:stn_3="http:///xsd"
targetNamespace="http:///xsd" elementFormDefault="qualified"
attributeFormDefault="qualified">
<xs:element name="echo">
<xs:complexType>
<xs:sequence>
<xs:element type="xs:string" name="param0" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="echoResponse">
<xs:complexType>
<xs:sequence>
<xs:element type="xs:string" name="return" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema></wsdl:types>

<wsdl:message name="echoMessage"><wsdl:part element="ns0:echo" name="part1"
/></wsdl:message><wsdl:message name="echoResponse"><wsdl:part
element="ns0:echoResponse" name="part1" /></wsdl:message><wsdl:portType
name="MyService2PortType"><wsdl:operation name="echo"><wsdl:input
message="axis2:echoMessage" /><wsdl:output message="axis2:echoResponse"
/></wsdl:operation></wsdl:portType><wsdl:binding
type="axis2:MyService2PortType" name="MyService2SOAP11Binding"><soap:binding
style="document" transport="http://schemas.xmlsoap.org/soap/http"
/><wsdl:operation name="echo"><soap:operation style="document"
soapAction="urn:echo" /><wsdl:input><soap:body use="literal"
/></wsdl:input><wsdl:output><soap:body use="literal"
/></wsdl:output></wsdl:operation></wsdl:binding><wsdl:binding
type="axis2:MyService2PortType"
name="MyService2SOAP12Binding"><soap12:binding style="document" transport="
http://schemas.xmlsoap.org/soap/http" /><wsdl:operation
name="echo"><soap12:operation style="document" soapAction="urn:echo"
/><wsdl:input><soap12:body use="literal"
/></wsdl:input><wsdl:output><soap12:body use="literal"
/></wsdl:output></wsdl:operation></wsdl:binding><wsdl:binding
type="axis2:MyService2PortType" name="MyService2HttpBinding"><http:binding
verb="POST" /><wsdl:operation name="echo"><http:operation location="echo"
/><wsdl:input><mime:content type="text/xml"
/></wsdl:input><wsdl:output><mime:content type="text/xml"
/></wsdl:output></wsdl:operation></wsdl:binding><wsdl:service
name="MyService2"><wsdl:port binding="axis2:MyService2SOAP11Binding"
name="MyService2SOAP11port_http"><soap:address location="
http://localhost:8080/axis2/services/MyService2" /></wsdl:port><wsdl:port
binding="axis2:MyService2SOAP12Binding"
name="MyService2SOAP12port_http"><soap12:address location="
http://localhost:8080/axis2/services/MyService2" /></wsdl:port><wsdl:port
binding="axis2:MyService2HttpBinding"
name="MyService2Httpport0"><http:address location="
http://localhost:8080/axis2/rest/MyService2"
/></wsdl:port></wsdl:service></wsdl:definitions>
I then try to use WSDL2Java to create client stubs based on this WSDL. It
does generate them, but when I try to run the client I get the following
error:


Exception in thread "main" java.lang.RuntimeException:
java.lang.RuntimeException: Unexpected subelement return
        at org.apache.axis2.MyService2Stub.fromOM(MyService2Stub.java:665)
        at org.apache.axis2.MyService2Stub.echo(MyService2Stub.java:144)
        at org.apache.axis2.Client.main(Client.java:16)
Caused by: java.lang.RuntimeException: Unexpected subelement return
        at
org.apache.axis2.MyService2Stub$EchoResponse$Factory.parse(MyService2Stub.java:419)
        at org.apache.axis2.MyService2Stub.fromOM(MyService2Stub.java:657)
... 2 more
I googled this and this page (
http://mail-archives.apache.org/mod_mbox/ws-axis-dev/200605.mbox/%3C23216141.1148303070637.JavaMail.jira@brutus%3E)
claims
that this error message appears because axis2 does not support RPC Bindings.

I'm confused - how do I generate a client for this WSDL?

Re: Axis2 / Axis RPC

Posted by Anne Thomas Manes <at...@gmail.com>.
Axis2 doesn't support SOAP encoding, but it does support RPC/literal.

Could you please provide a little more information about what you're
doing? I thought you said that the service was implemented using
Axis2.

Also, please post the WSDL.

Anne

On 7/6/06, M S <mo...@gmail.com> wrote:
>  I tried to make my own by generating the stub files using
> WSDL2Java from the WSDL generated by Axis.
>
> Everything seems fine, I deploy it, etc. but when I try to run the client
> I get the following:
>
>
> Exception in thread "main" java.lang.RuntimeException:
> java.lang.RuntimeException: Unexpected subelement return
>  at
> org.apache.axis2.MyService2Stub.fromOM(MyService2Stub.java:665)
>  at org.apache.axis2.MyService2Stub.echo
> (MyService2Stub.java:144)
>  at org.apache.axis2.Client.main(Client.java:16)
> Caused by: java.lang.RuntimeException: Unexpected subelement return
>  at
> org.apache.axis2.MyService2Stub$EchoResponse$Factory.parse
> (MyService2Stub.java:419)
>  at
> org.apache.axis2.MyService2Stub.fromOM(MyService2Stub.java:657)
>  ... 2 more
>
>
> I googled it and according to
>
> http://mail-archives.apache.org/mod_mbox/ws-axis-dev/200605.mbox/%3C23216141.1148303070637.JavaMail.jira@brutus%3E
> this is because axis does not support RPC bindings.
>
>
>
> On 7/6/06, Anne Thomas Manes <at...@gmail.com> wrote:
> >
>  Why were you unable to generate a client using Axis2?
> See
> http://ws.apache.org/axis2/tools/1_0/CodegenToolReference.html.
>
> Anne
>
>  On 7/6/06, M S <mo...@gmail.com> wrote:
> > Hi,
> >
> >  I am a newbie trying to create a RPC-based Web Service. I created this
> > using Axis2 (latest nightly build dated 5th July). The problem is that I
> > cannot use WSDL2Java to generate the Client stubs. So what I did is to use
> > the old Axis (1.4 from 22nd April) to do this.
> >
> >  For some reason I don't get it to work. My Client code looks like this:
> >
> >  package org.apache.ws.axis;
> >
> >  import javax.xml.namespace.*;
> >  import javax.xml.rpc.*;
> >  import java.rmi.*;
> >  import java.net.*;
> >
> >  public class Client2 {
> >
> >      public Client2() {}
> >
> >      interface MyPrimeHandler extends Remote {
> >          public String echo(String echostring) throws RemoteException;
> >      }
> >
> >      public void invokeService() {
> >          String msg = "Det funkar";
> >          try {
> >              String wsdlLoc =
> > "http://localhost:8080/axis2/services/MyService2?wsdl ";
> >              QName serviceName = new
> > QName("http://localhost:8080/axis2/services/MyService2",
> > "MyService2");
> >              ServiceFactory sFactory = ServiceFactory.newInstance();
> >              Service service = sFactory.createService(new URL(wsdlLoc),
> > serviceName);
> >              MyPrimeHandler mp =
> > (MyPrimeHandler)service.getPort(MyPrimeHandler.class);
> >              String resp = mp.echo(msg);
> >              System.out.println(resp);
> >          }
> >
> >          catch (Exception e) { e.printStackTrace();}
> >      }
> >
> >      public static void main(String[] args) {
> >          Client2 cl2 = new Client2();
> >          cl2.invokeService();
> >      }
> >
> >  }
> >
> >  The exception that I get is:
> >
> >  - Unable to find required classes (javax.activation.DataHandler and
> > javax.mail.internet.MimeMultipart ). Attachment support
> is
> > disabled.
> >  javax.xml.rpc.ServiceException: Error processing WSDL document:
> >  javax.xml.rpc.ServiceException: Error processing WSDL document:
> >  javax.xml.rpc.ServiceException : Cannot find service:
> >
> {http://localhost:8080/axis2/services/MyService2}MyService2
> >      at
> > org.apache.axis.client.Service.initService
> (Service.java:250)
> >      at org.apache.axis.client.Service.<init>(Service.java:165)
> >      at
> >
> org.apache.axis.client.ServiceFactory.createService(ServiceFactory.java:198)
> >      at
> > org.apache.ws.axis.Client2.invokeService(Client2.java:22)
> >      at org.apache.ws.axis.Client2.main(Client2.java:33)
> >
> >
> >  I have checked and the EPR exists at the specified URL above.
> >
>  >  Does anyone have an idea on how I should solve this problem? Or am I
> > barking up the wrong tree? Perhaps there is some other way generating
> client
> > stubs with Axis2? Any help would be appreciated.
> >
> >  Regards
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: Axis2 / Axis RPC

Posted by M S <mo...@gmail.com>.
 I tried to make my own by generating the stub files using
WSDL2Java from the WSDL generated by Axis.

Everything seems fine, I deploy it, etc. but when I try to run the client
I get the following:

Exception in thread "main" java.lang.RuntimeException:
java.lang.RuntimeException: Unexpected subelement return
        at org.apache.axis2.MyService2Stub.fromOM(MyService2Stub.java:665)
        at org.apache.axis2.MyService2Stub.echo(MyService2Stub.java:144)
        at org.apache.axis2.Client.main(Client.java:16)
Caused by: java.lang.RuntimeException: Unexpected subelement return
        at
org.apache.axis2.MyService2Stub$EchoResponse$Factory.parse(MyService2Stub.java:419)
        at org.apache.axis2.MyService2Stub.fromOM(MyService2Stub.java:657)
        ... 2 more


I googled it and according to
http://mail-archives.apache.org/mod_mbox/ws-axis-dev/200605.mbox/%3C23216141.1148303070637.JavaMail.jira@brutus%3E
this is because axis does not support RPC bindings.



On 7/6/06, Anne Thomas Manes <at...@gmail.com> wrote:
>
> Why were you unable to generate a client using Axis2?
> See http://ws.apache.org/axis2/tools/1_0/CodegenToolReference.html.
>
> Anne
>
> On 7/6/06, M S <mo...@gmail.com> wrote:
> > Hi,
> >
> >  I am a newbie trying to create a RPC-based Web Service. I created this
> > using Axis2 (latest nightly build dated 5th July). The problem is that I
> > cannot use WSDL2Java to generate the Client stubs. So what I did is to
> use
> > the old Axis (1.4 from 22nd April) to do this.
> >
> >  For some reason I don't get it to work. My Client code looks like this:
> >
> >  package org.apache.ws.axis;
> >
> >  import javax.xml.namespace.*;
> >  import javax.xml.rpc.*;
> >  import java.rmi.*;
> >  import java.net.*;
> >
> >  public class Client2 {
> >
> >      public Client2() {}
> >
> >      interface MyPrimeHandler extends Remote {
> >          public String echo(String echostring) throws RemoteException;
> >      }
> >
> >      public void invokeService() {
> >          String msg = "Det funkar";
> >          try {
> >              String wsdlLoc =
> > "http://localhost:8080/axis2/services/MyService2?wsdl";
> >              QName serviceName = new
> > QName("http://localhost:8080/axis2/services/MyService2",
> > "MyService2");
> >              ServiceFactory sFactory = ServiceFactory.newInstance();
> >              Service service = sFactory.createService(new URL(wsdlLoc),
> > serviceName);
> >              MyPrimeHandler mp =
> > (MyPrimeHandler)service.getPort(MyPrimeHandler.class);
> >              String resp = mp.echo(msg);
> >              System.out.println(resp);
> >          }
> >
> >          catch (Exception e) { e.printStackTrace();}
> >      }
> >
> >      public static void main(String[] args) {
> >          Client2 cl2 = new Client2();
> >          cl2.invokeService();
> >      }
> >
> >  }
> >
> >  The exception that I get is:
> >
> >  - Unable to find required classes (javax.activation.DataHandler and
> > javax.mail.internet.MimeMultipart). Attachment support is
> > disabled.
> >  javax.xml.rpc.ServiceException: Error processing WSDL document:
> >  javax.xml.rpc.ServiceException: Error processing WSDL document:
> >  javax.xml.rpc.ServiceException: Cannot find service:
> > {http://localhost:8080/axis2/services/MyService2}MyService2
> >      at
> > org.apache.axis.client.Service.initService(Service.java:250)
> >      at org.apache.axis.client.Service.<init>(Service.java:165)
> >      at
> > org.apache.axis.client.ServiceFactory.createService(ServiceFactory.java
> :198)
> >      at
> > org.apache.ws.axis.Client2.invokeService(Client2.java:22)
> >      at org.apache.ws.axis.Client2.main(Client2.java:33)
> >
> >
> >  I have checked and the EPR exists at the specified URL above.
> >
> >  Does anyone have an idea on how I should solve this problem? Or am I
> > barking up the wrong tree? Perhaps there is some other way generating
> client
> > stubs with Axis2? Any help would be appreciated.
> >
> >  Regards
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>

Re: Axis2 / Axis RPC

Posted by Anne Thomas Manes <at...@gmail.com>.
Why were you unable to generate a client using Axis2?
See http://ws.apache.org/axis2/tools/1_0/CodegenToolReference.html.

Anne

On 7/6/06, M S <mo...@gmail.com> wrote:
> Hi,
>
>  I am a newbie trying to create a RPC-based Web Service. I created this
> using Axis2 (latest nightly build dated 5th July). The problem is that I
> cannot use WSDL2Java to generate the Client stubs. So what I did is to use
> the old Axis (1.4 from 22nd April) to do this.
>
>  For some reason I don't get it to work. My Client code looks like this:
>
>  package org.apache.ws.axis;
>
>  import javax.xml.namespace.*;
>  import javax.xml.rpc.*;
>  import java.rmi.*;
>  import java.net.*;
>
>  public class Client2 {
>
>      public Client2() {}
>
>      interface MyPrimeHandler extends Remote {
>          public String echo(String echostring) throws RemoteException;
>      }
>
>      public void invokeService() {
>          String msg = "Det funkar";
>          try {
>              String wsdlLoc =
> "http://localhost:8080/axis2/services/MyService2?wsdl";
>              QName serviceName = new
> QName("http://localhost:8080/axis2/services/MyService2",
> "MyService2");
>              ServiceFactory sFactory = ServiceFactory.newInstance();
>              Service service = sFactory.createService(new URL(wsdlLoc),
> serviceName);
>              MyPrimeHandler mp =
> (MyPrimeHandler)service.getPort(MyPrimeHandler.class);
>              String resp = mp.echo(msg);
>              System.out.println(resp);
>          }
>
>          catch (Exception e) { e.printStackTrace();}
>      }
>
>      public static void main(String[] args) {
>          Client2 cl2 = new Client2();
>          cl2.invokeService();
>      }
>
>  }
>
>  The exception that I get is:
>
>  - Unable to find required classes (javax.activation.DataHandler and
> javax.mail.internet.MimeMultipart). Attachment support is
> disabled.
>  javax.xml.rpc.ServiceException: Error processing WSDL document:
>  javax.xml.rpc.ServiceException: Error processing WSDL document:
>  javax.xml.rpc.ServiceException: Cannot find service:
> {http://localhost:8080/axis2/services/MyService2}MyService2
>      at
> org.apache.axis.client.Service.initService(Service.java:250)
>      at org.apache.axis.client.Service.<init>(Service.java:165)
>      at
> org.apache.axis.client.ServiceFactory.createService(ServiceFactory.java:198)
>      at
> org.apache.ws.axis.Client2.invokeService(Client2.java:22)
>      at org.apache.ws.axis.Client2.main(Client2.java:33)
>
>
>  I have checked and the EPR exists at the specified URL above.
>
>  Does anyone have an idea on how I should solve this problem? Or am I
> barking up the wrong tree? Perhaps there is some other way generating client
> stubs with Axis2? Any help would be appreciated.
>
>  Regards
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org