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 August Visco <av...@columbia.edu> on 2007/09/20 19:40:15 UTC
crisscrossed responses in axis2
Hello, I am new to web services and soap. I am using axis2 1.1.1 to load
Spring 2.0 and expose a POJO as a web service. Additionally, I have a
passwordCallbackClass for the rampart wss4j InflowSecurity which
authenticates a username and password via kerberos via JAAS. Here is my
services.xml:
> <serviceGroup>
>
> <service name="SpringInitV1" class="myservice.SpringInit">
> <description>
> Initialize Spring
> </description>
> <parameter name="ServiceClass">myservice.SpringInit</parameter>
> <parameter name="ServiceTCCL">composite</parameter>
> <parameter name="load-on-startup">true</parameter>
> <operation name="springInit">
> <messageReceiver
> class="org.apache.axis2.receivers.RawXMLINOutMessageReceiver"/>
> </operation>
> </service>
>
> <service name="MyService"
> targetNamespace="http://example.com/MyService">
> <description>
> MyService Web Service
> </description>
> <transports>
> <transport>http</transport>
> </transports>
> <schema schemaNamespace="http://example.com/MyService/service/xsd">
> <mapping
> namespace="http://example.com/MyService/service/types/xsd"
> package="myservice.types"></mapping>
> </schema>
> <parameter name="ServiceClass">myservice.MyServicePojo</parameter>
> <parameter
> name="ServiceObjectSupplier">org.apache.axis2.extensions.spring.receivers.SpringAppContextAwareObjectSupplier</parameter>
>
> <parameter name="SpringBeanName">myservice</parameter>
> <messageReceivers>
> <messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-only"
> class="org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiver"/>
> <messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-out"
> class="org.apache.axis2.rpc.receivers.RPCMessageReceiver"/>
> </messageReceivers>
> <module ref="rampart" />
> <parameter name="InflowSecurity">
> <action>
> <items>UsernameToken</items>
>
> <passwordCallbackClass>myservice.MyServiceSecurityManager</passwordCallbackClass>
>
> </action>
> </parameter>
> </service>
>
> </serviceGroup>
I have a client written in perl (SOAP::Lite) which runs in a loop and
makes requests to one of the methods exposed through the POJO. Here is a
snippet:
> my $soap = SOAP::Lite -> uri($uri) -> proxy($proxy) -> outputxml(1);
>
> my $Username = SOAP::Data->name('Username' => $cur_username);
> my $Password = SOAP::Data->name('Password' => $cur_password)
> ->attr({Type =>
> 'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText'});
>
> my $UsernameToken = SOAP::Data->name('UsernameToken')
> ->value(\SOAP::Data->value($Username, $Password));
> my $security = SOAP::Header->name(Security)
> ->attr({'xmlns' =>
> 'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd'})
>
> ->value(\$UsernameToken);
>
> $method = SOAP::Data->name('myServiceMethodName')->attr({xmlns =>
> '$service_ns'});
> my $param1 = SOAP::Data->name('param1')
> ->value(\SOAP::Data->value($param2, $param3)) ->attr({xmlns =>
> '$service_type_ns'});
> @param = SOAP::Data->value($param1)->attr({xmlns =>
> '$service_ns'});
>
> my $result = $soap->call($security, $method => @param);
The WSDL lists MyServiceSOAP11Binding and MyServiceSOAP11Binding
bindings attached to the endpoint in the web service to which I am
making the request. I'm using soap over an http transport.
It works perfectly in that I get the response I expect for that request.
However, when I launch a parallel second client which loops and makes
calls to a different method in the web service, then the two clients
begin to intermittently receive responses destined to each other.
Apparently, Axis2 is returning the first completed response to the first
client waiting for a response. What am I doing wrong? Is this a
configuration problem in axis2? I want a synchronous request/response
behavior from the web service. Do I need to incorporate WS-Addressing
into the request sent from the client? I was under the impressing that
WS-Addressing was only required to redirect the response to a different
endpoint than the one that made the request.
Thx
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org
Re: Axis2 + ADB + Asynchronous
Posted by Arlindo <ar...@yahoo.com.br>.
Hi All
I appreciate very much your tips...
Many Thanks for your attention...
@jr@
_______________________________________________________
Yahoo! Mail - Sempre a melhor opção para você!
Experimente já e veja as novidades.
http://br.yahoo.com/mailbeta/tudonovo/
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org
Re: Axis2 + ADB + Asynchronous
Posted by Amila Suriarachchi <am...@gmail.com>.
hi,
this is a client code I wrote to invoke the microsoft addressing end point
with ADB using unwrapping.
http://131.107.72.15/WSAddressingCR_Service_WCF/WSAddressingAugust2004.svc?wsdl
scripts:
sh wsdl2java.sh -uri
http://131.107.72.15/WSAddressingCR_Service_WCF/WSAddressingAugust2004.svc?wsdl-o
/home/amila/projects/interop/interop/microsoftInterop/addressing_client_wcf
-ap -uw -u -p org.tempuri.submission.echo
sh wsdl2java.sh -uri
http://131.107.72.15/WSAddressingCR_Service_WCF/WSAddressingAugust2004.svc?wsdl-o
/home/amila/projects/interop/interop/microsoftInterop/addressing_client_wcf
-uw -u -pn CustomBinding_Notify -p org.tempuri.submission.notify
sh wsdl2java.sh -uri
http://131.107.72.15/WSAddressingCR_Service_WCF/WSAddressingAugust2004.svc?wsdl-o
/home/amila/projects/interop/interop/microsoftInterop/addressing_client_wcf
-uw -u -pn CustomBinding_Notify1 -p org.tempuri.submission.notify1
here I have
stub._getServiceClient().getOptions().setProperty(
Constants.Configuration.TRANSPORT_URL,
"
http://localhost:8085/WSAddressingCR_Service_WCF/WSAddressing10.svc/Soap11
");
used to redirect the request to the tcp mon. So you may not need it.
hope this would help you.
thanks,
Amila.
On 9/21/07, Dennis Sosnoski <dm...@sosnoski.com> wrote:
>
> Hi @jr@,
>
> See the ADB example from my devWorks article:
> http://www.ibm.com/developerworks/webservices/library/ws-java3/ You
> probably want to look at the ADB wrapped example code, since you're not
> unwrapping the messages. The example includes an asynchronous call, and
> the article also has some discussion of how the asynchronous support
> works in Axis2.
>
> - Dennis
>
> --
> Dennis M. Sosnoski
> SOA and Web Services in Java
> Axis2 Training and Consulting
> http://www.sosnoski.com - http://www.sosnoski.co.nz
> Seattle, WA +1-425-939-0576 - Wellington, NZ +64-4-298-6117
>
>
>
> Arlindo wrote:
> > Hi All...
> >
> > I would like to create an asynchronous client using ADB, is it possible?
> > I have the client classes generated by the tool (wsdl2java) with the
> > correct parameters (I think)
> >
> > ( wsdl2java -uri XXX.wsdl -p packXXX -d adb -a -o build/client )
> >
> > but I don't know what is the right way to use the "XXXXCallbackHandler".
> > Could you, please, give me a simple example of how should I proceed?
> >
> > Many Thanks in Advance
> > @jr@
> >
> > (( With the synchronou's ADB client, I dont have any problem...))
> >
> >
> > _______________________________________________________ Yahoo! Mail -
> > Sempre a melhor opção para você! Experimente já e veja as novidades.
> > http://br.yahoo.com/mailbeta/tudonovo/
> >
> >
> >
> > ---------------------------------------------------------------------
> > 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
>
>
--
Amila Suriarachchi,
WSO2 Inc.
Re: Axis2 + ADB + Asynchronous
Posted by Dennis Sosnoski <dm...@sosnoski.com>.
Hi @jr@,
See the ADB example from my devWorks article:
http://www.ibm.com/developerworks/webservices/library/ws-java3/ You
probably want to look at the ADB wrapped example code, since you're not
unwrapping the messages. The example includes an asynchronous call, and
the article also has some discussion of how the asynchronous support
works in Axis2.
- Dennis
--
Dennis M. Sosnoski
SOA and Web Services in Java
Axis2 Training and Consulting
http://www.sosnoski.com - http://www.sosnoski.co.nz
Seattle, WA +1-425-939-0576 - Wellington, NZ +64-4-298-6117
Arlindo wrote:
> Hi All...
>
> I would like to create an asynchronous client using ADB, is it possible?
> I have the client classes generated by the tool (wsdl2java) with the
> correct parameters (I think)
>
> ( wsdl2java -uri XXX.wsdl -p packXXX -d adb -a -o build/client )
>
> but I don't know what is the right way to use the "XXXXCallbackHandler".
> Could you, please, give me a simple example of how should I proceed?
>
> Many Thanks in Advance
> @jr@
>
> (( With the synchronou's ADB client, I dont have any problem...))
>
>
> _______________________________________________________ Yahoo! Mail -
> Sempre a melhor opção para você! Experimente já e veja as novidades.
> http://br.yahoo.com/mailbeta/tudonovo/
>
>
>
> ---------------------------------------------------------------------
> 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
Axis2 + ADB + Asynchronous
Posted by Arlindo <ar...@yahoo.com.br>.
Hi All...
I would like to create an asynchronous client using ADB, is it possible?
I have the client classes generated by the tool (wsdl2java) with the
correct parameters (I think)
( wsdl2java -uri XXX.wsdl -p packXXX -d adb -a -o build/client )
but I don't know what is the right way to use the "XXXXCallbackHandler".
Could you, please, give me a simple example of how should I proceed?
Many Thanks in Advance
@jr@
(( With the synchronou's ADB client, I dont have any problem...))
_______________________________________________________
Yahoo! Mail - Sempre a melhor opção para você!
Experimente já e veja as novidades.
http://br.yahoo.com/mailbeta/tudonovo/
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org
Re: crisscrossed responses in axis2
Posted by August Visco <av...@columbia.edu>.
Ajith,
Thank you for the response. The problem is actually stranger than I
originally described. I am in fact receiving the correct soap response
except for the fact the the tag that wraps the <return> tag is wrong.
I am running two clients in parallel, one which makes repeated calls to
methodONE and another that makes repeated calls to methodTWO. The client
calling methodONE will intermittently receive the following response:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Header />
<soapenv:Body>
<ns:methodTWOResponse xmlns:ns="myServiceNS">
<ns:return>
correct methodONEResponse xml
</ns:return>
</ns:methodTWOResponse >
</soapenv:Body>
</soapenv:Envelope>
And the client calling methodTWO will intermittently receive this:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Header />
<soapenv:Body>
<ns:methodONEResponse xmlns:ns="myServiceNS">
<ns:return>
correct methodTWOResponse xml
</ns:return>
</ns:methodONEResponse >
</soapenv:Body>
</soapenv:Envelope>
Again, I am using Axis2 1.1.1, load Spring 2.0 and exposing a POJO as a
web service. I am sorry for inaccurately describing the problem in my
original post. I was verifying the response by simply checking this tag,
and not actually parsing the xml. It doesn't appear to have anything to
do with WS-Addressing or HTTP channels after all. Anyone have any
ideas/suggestions?
Thx
Ajith Ranabahu wrote:
> hi,
> Is there a chance that these two clients share the same HTTP channel ?
> it is highly unlikely but if the two requests are in different
> channels then there is no chance to mix them up even when there is no
> use of WS-Addressing (AFAIK)
>
> I guess the best thing to do would be to monitor the traffic using
> tcpmon (http://ws.apache.org/commons/tcpmon/) and see whether there is
> a connection getting reused. Also if this fails try enabling
> WS-Addressing
>
> Ajith
>
> On 9/20/07, August Visco <av...@columbia.edu> wrote:
>
>> Hello, I am new to web services and soap. I am using axis2 1.1.1 to load
>> Spring 2.0 and expose a POJO as a web service. Additionally, I have a
>> passwordCallbackClass for the rampart wss4j InflowSecurity which
>> authenticates a username and password via kerberos via JAAS. Here is my
>> services.xml:
>>
>>> <serviceGroup>
>>>
>>> <service name="SpringInitV1" class="myservice.SpringInit">
>>> <description>
>>> Initialize Spring
>>> </description>
>>> <parameter name="ServiceClass">myservice.SpringInit</parameter>
>>> <parameter name="ServiceTCCL">composite</parameter>
>>> <parameter name="load-on-startup">true</parameter>
>>> <operation name="springInit">
>>> <messageReceiver
>>> class="org.apache.axis2.receivers.RawXMLINOutMessageReceiver"/>
>>> </operation>
>>> </service>
>>>
>>> <service name="MyService"
>>> targetNamespace="http://example.com/MyService">
>>> <description>
>>> MyService Web Service
>>> </description>
>>> <transports>
>>> <transport>http</transport>
>>> </transports>
>>> <schema schemaNamespace="http://example.com/MyService/service/xsd">
>>> <mapping
>>> namespace="http://example.com/MyService/service/types/xsd"
>>> package="myservice.types"></mapping>
>>> </schema>
>>> <parameter name="ServiceClass">myservice.MyServicePojo</parameter>
>>> <parameter
>>> name="ServiceObjectSupplier">org.apache.axis2.extensions.spring.receivers.SpringAppContextAwareObjectSupplier</parameter>
>>>
>>> <parameter name="SpringBeanName">myservice</parameter>
>>> <messageReceivers>
>>> <messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-only"
>>> class="org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiver"/>
>>> <messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-out"
>>> class="org.apache.axis2.rpc.receivers.RPCMessageReceiver"/>
>>> </messageReceivers>
>>> <module ref="rampart" />
>>> <parameter name="InflowSecurity">
>>> <action>
>>> <items>UsernameToken</items>
>>>
>>> <passwordCallbackClass>myservice.MyServiceSecurityManager</passwordCallbackClass>
>>>
>>> </action>
>>> </parameter>
>>> </service>
>>>
>>> </serviceGroup>
>>>
>> I have a client written in perl (SOAP::Lite) which runs in a loop and
>> makes requests to one of the methods exposed through the POJO. Here is a
>> snippet:
>>
>>> my $soap = SOAP::Lite -> uri($uri) -> proxy($proxy) -> outputxml(1);
>>>
>>> my $Username = SOAP::Data->name('Username' => $cur_username);
>>> my $Password = SOAP::Data->name('Password' => $cur_password)
>>> ->attr({Type =>
>>> 'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText'});
>>>
>>> my $UsernameToken = SOAP::Data->name('UsernameToken')
>>> ->value(\SOAP::Data->value($Username, $Password));
>>> my $security = SOAP::Header->name(Security)
>>> ->attr({'xmlns' =>
>>> 'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd'})
>>>
>>> ->value(\$UsernameToken);
>>>
>>> $method = SOAP::Data->name('myServiceMethodName')->attr({xmlns =>
>>> '$service_ns'});
>>> my $param1 = SOAP::Data->name('param1')
>>> ->value(\SOAP::Data->value($param2, $param3)) ->attr({xmlns =>
>>> '$service_type_ns'});
>>> @param = SOAP::Data->value($param1)->attr({xmlns =>
>>> '$service_ns'});
>>>
>>> my $result = $soap->call($security, $method => @param);
>>>
>> The WSDL lists MyServiceSOAP11Binding and MyServiceSOAP11Binding
>> bindings attached to the endpoint in the web service to which I am
>> making the request. I'm using soap over an http transport.
>>
>> It works perfectly in that I get the response I expect for that request.
>> However, when I launch a parallel second client which loops and makes
>> calls to a different method in the web service, then the two clients
>> begin to intermittently receive responses destined to each other.
>> Apparently, Axis2 is returning the first completed response to the first
>> client waiting for a response. What am I doing wrong? Is this a
>> configuration problem in axis2? I want a synchronous request/response
>> behavior from the web service. Do I need to incorporate WS-Addressing
>> into the request sent from the client? I was under the impressing that
>> WS-Addressing was only required to redirect the response to a different
>> endpoint than the one that made the request.
>>
>> Thx
>>
>>
>> ---------------------------------------------------------------------
>> 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: crisscrossed responses in axis2
Posted by Ajith Ranabahu <aj...@gmail.com>.
hi,
Is there a chance that these two clients share the same HTTP channel ?
it is highly unlikely but if the two requests are in different
channels then there is no chance to mix them up even when there is no
use of WS-Addressing (AFAIK)
I guess the best thing to do would be to monitor the traffic using
tcpmon (http://ws.apache.org/commons/tcpmon/) and see whether there is
a connection getting reused. Also if this fails try enabling
WS-Addressing
Ajith
On 9/20/07, August Visco <av...@columbia.edu> wrote:
> Hello, I am new to web services and soap. I am using axis2 1.1.1 to load
> Spring 2.0 and expose a POJO as a web service. Additionally, I have a
> passwordCallbackClass for the rampart wss4j InflowSecurity which
> authenticates a username and password via kerberos via JAAS. Here is my
> services.xml:
> > <serviceGroup>
> >
> > <service name="SpringInitV1" class="myservice.SpringInit">
> > <description>
> > Initialize Spring
> > </description>
> > <parameter name="ServiceClass">myservice.SpringInit</parameter>
> > <parameter name="ServiceTCCL">composite</parameter>
> > <parameter name="load-on-startup">true</parameter>
> > <operation name="springInit">
> > <messageReceiver
> > class="org.apache.axis2.receivers.RawXMLINOutMessageReceiver"/>
> > </operation>
> > </service>
> >
> > <service name="MyService"
> > targetNamespace="http://example.com/MyService">
> > <description>
> > MyService Web Service
> > </description>
> > <transports>
> > <transport>http</transport>
> > </transports>
> > <schema schemaNamespace="http://example.com/MyService/service/xsd">
> > <mapping
> > namespace="http://example.com/MyService/service/types/xsd"
> > package="myservice.types"></mapping>
> > </schema>
> > <parameter name="ServiceClass">myservice.MyServicePojo</parameter>
> > <parameter
> > name="ServiceObjectSupplier">org.apache.axis2.extensions.spring.receivers.SpringAppContextAwareObjectSupplier</parameter>
> >
> > <parameter name="SpringBeanName">myservice</parameter>
> > <messageReceivers>
> > <messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-only"
> > class="org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiver"/>
> > <messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-out"
> > class="org.apache.axis2.rpc.receivers.RPCMessageReceiver"/>
> > </messageReceivers>
> > <module ref="rampart" />
> > <parameter name="InflowSecurity">
> > <action>
> > <items>UsernameToken</items>
> >
> > <passwordCallbackClass>myservice.MyServiceSecurityManager</passwordCallbackClass>
> >
> > </action>
> > </parameter>
> > </service>
> >
> > </serviceGroup>
> I have a client written in perl (SOAP::Lite) which runs in a loop and
> makes requests to one of the methods exposed through the POJO. Here is a
> snippet:
> > my $soap = SOAP::Lite -> uri($uri) -> proxy($proxy) -> outputxml(1);
> >
> > my $Username = SOAP::Data->name('Username' => $cur_username);
> > my $Password = SOAP::Data->name('Password' => $cur_password)
> > ->attr({Type =>
> > 'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText'});
> >
> > my $UsernameToken = SOAP::Data->name('UsernameToken')
> > ->value(\SOAP::Data->value($Username, $Password));
> > my $security = SOAP::Header->name(Security)
> > ->attr({'xmlns' =>
> > 'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd'})
> >
> > ->value(\$UsernameToken);
> >
> > $method = SOAP::Data->name('myServiceMethodName')->attr({xmlns =>
> > '$service_ns'});
> > my $param1 = SOAP::Data->name('param1')
> > ->value(\SOAP::Data->value($param2, $param3)) ->attr({xmlns =>
> > '$service_type_ns'});
> > @param = SOAP::Data->value($param1)->attr({xmlns =>
> > '$service_ns'});
> >
> > my $result = $soap->call($security, $method => @param);
> The WSDL lists MyServiceSOAP11Binding and MyServiceSOAP11Binding
> bindings attached to the endpoint in the web service to which I am
> making the request. I'm using soap over an http transport.
>
> It works perfectly in that I get the response I expect for that request.
> However, when I launch a parallel second client which loops and makes
> calls to a different method in the web service, then the two clients
> begin to intermittently receive responses destined to each other.
> Apparently, Axis2 is returning the first completed response to the first
> client waiting for a response. What am I doing wrong? Is this a
> configuration problem in axis2? I want a synchronous request/response
> behavior from the web service. Do I need to incorporate WS-Addressing
> into the request sent from the client? I was under the impressing that
> WS-Addressing was only required to redirect the response to a different
> endpoint than the one that made the request.
>
> Thx
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>
--
Ajith Ranabahu
Reading, after a certain age, diverts the mind too much from its
creative pursuits. Any man who reads too much and uses his own brain
too little falls into lazy habits of thinking - Albert Einstein
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org