Hi Paul,

Thanks, for reply.

I am using axis2-1.0.

Is rampart1.1 is compatible with axis2-1.0 because I am getting some
errors when I am initializing the Configuration. I have attached the
axis2.xml file along with the mail. Following line of code gives me an
error.


ConfigurationContext context = ConfigurationContextFactory
.createConfigurationContextFromFileSystem(
"resources", "resources/axis2.xml");

If you have some idea then please let me know.


axis2.xml

<?xml version="1.0" encoding="UTF-8"?>
<axisconfig name="AxisJava2.0">
        <module ref="rampart" />
        <parameter name="OutflowSecurity">
        <action>
                <items>UsernameToken Timestamp</items>
                <user>wfws</user>
 
<passwordCallbackClass>com.test.PWCallback</passwordCallbackClass>
        </action>
    </parameter>
    
    <parameter name="hotdeployment" locked="false">true</parameter>
    <parameter name="hotupdate" locked="false">false</parameter>
    <parameter name="enableMTOM" locked="false">false</parameter>
    <parameter name="sendStacktraceDetailsWithFaults"
locked="false">true</parameter>
    <parameter name="DrillDownToRootCauseForFaultReason"
locked="false">false</parameter>
    <parameter name="userName" locked="false">admin</parameter>
    <parameter name="password" locked="false">axis2</parameter>
    <parameter name="manageTransportSession"
locked="false">false</parameter>
    <parameter name="enableRESTInAxis2MainServlet"
locked="true">true</parameter>
    <parameter name="disableREST" locked="true">false</parameter>
    <parameter name="disableSeparateEndpointForREST"
locked="true">false</parameter>
    
    <messageReceivers>
        <messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-only";
 
class="org.apache.axis2.receivers.RawXMLINOnlyMessageReceiver"/>
        <messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-out";
 
class="org.apache.axis2.receivers.RawXMLINOutMessageReceiver"/>
    </messageReceivers>

    <transportReceiver name="http"
 
class="org.apache.axis2.transport.http.SimpleHTTPServer">
        <parameter name="port" locked="false">6060</parameter>
    </transportReceiver>

    <transportReceiver name="tcp"
                       class="org.apache.axis2.transport.tcp.TCPServer">
        <parameter name="port" locked="false">6061</parameter>
    </transportReceiver>

    <transportSender name="jms"
                     class="org.apache.axis2.transport.jms.JMSSender"/>
    <transportSender name="tcp"
 
class="org.apache.axis2.transport.tcp.TCPTransportSender"/>
    <transportSender name="local"
 
class="org.apache.axis2.transport.local.LocalTransportSender"/>
    <transportSender name="http"
 
class="org.apache.axis2.transport.http.CommonsHTTPTransportSender">
        <parameter name="PROTOCOL" locked="false">HTTP/1.1</parameter>
        <parameter name="Transfer-Encoding"
locked="false">chunked</parameter>
    </transportSender>
    <transportSender name="https"
 
class="org.apache.axis2.transport.http.CommonsHTTPTransportSender">
        <parameter name="PROTOCOL" locked="false">HTTP/1.1</parameter>
        <parameter name="Transfer-Encoding"
locked="false">chunked</parameter>
    </transportSender>

    <phaseOrder type="InFlow">
        <!--  System pre-defined phases       -->
         <phase name="Transport">
            <handler name="RequestURIBasedDispatcher"
 
class="org.apache.axis2.engine.RequestURIBasedDispatcher">
                <order phase="Transport"/>
            </handler>
            <handler name="SOAPActionBasedDispatcher"
 
class="org.apache.axis2.engine.SOAPActionBasedDispatcher">
                <order phase="Transport"/>
            </handler>
        </phase>
        <phase name="Security"/>
        <phase name="PreDispatch"/>
        <phase name="Dispatch"
class="org.apache.axis2.engine.DispatchPhase">
            <handler name="AddressingBasedDispatcher"
 
class="org.apache.axis2.engine.AddressingBasedDispatcher">
                <order phase="Dispatch"/>
            </handler>

            <handler name="SOAPMessageBodyBasedDispatcher"
 
class="org.apache.axis2.engine.SOAPMessageBodyBasedDispatcher">
                <order phase="Dispatch"/>
            </handler>
            <handler name="InstanceDispatcher"
                     class="org.apache.axis2.engine.InstanceDispatcher">
                <order phase="Dispatch"/>
            </handler>
        </phase>
        <phase name="OperationInPhase"/>
    </phaseOrder>
    <phaseOrder type="OutFlow">
        <phase name="OperationOutPhase"/>
        <phase name="PolicyDetermination"/>
        <phase name="MessageOut"/>
        <phase name="Security"/>
    </phaseOrder>
    <phaseOrder type="InFaultFlow">
        <phase name="PreDispatch"/>
        <phase name="Dispatch"
class="org.apache.axis2.engine.DispatchPhase">
            <handler name="RequestURIBasedDispatcher"
 
class="org.apache.axis2.engine.RequestURIBasedDispatcher">
                <order phase="Dispatch"/>
            </handler>

            <handler name="SOAPActionBasedDispatcher"
 
class="org.apache.axis2.engine.SOAPActionBasedDispatcher">
                <order phase="Dispatch"/>
            </handler>

            <handler name="AddressingBasedDispatcher"
 
class="org.apache.axis2.engine.AddressingBasedDispatcher">
                <order phase="Dispatch"/>
            </handler>

            <handler name="SOAPMessageBodyBasedDispatcher"
 
class="org.apache.axis2.engine.SOAPMessageBodyBasedDispatcher">
                <order phase="Dispatch"/>
            </handler>
            <handler name="InstanceDispatcher"
                     class="org.apache.axis2.engine.InstanceDispatcher">
                <order phase="Dispatch"/>
            </handler>
        </phase>
        <phase name="OperationInFaultPhase"/>
    </phaseOrder>
    <phaseOrder type="OutFaultFlow">
        <phase name="OperationOutFaultPhase"/>
        <phase name="PolicyDetermination"/>
        <phase name="MessageOut"/>
    </phaseOrder>
</axisconfig>


Thanks,
Amit Soni




-----Original Message-----
From: Paul Fremantle [mailto:[EMAIL PROTECTED] 
Sent: Thursday, December 28, 2006 4:17 PM
To: [email protected]
Subject: Re: soap header in axis2

Amit

You need to engage the addressing and rampart (security) modules.
These modules add in the correct headers.

The addressing module is shipped as part of the core axis2 distro. You
just need to add it into your classpath. The correct action and to
headers should be described in the WSDL and should appear
automatically.

Rampart (security headers) is a bit trickier. You can find the rampart
module here:

http://www.apache.org/dyn/mirrors/mirrors.cgi/ws/rampart/1_1/rampart-1.1
.zip

If you look in the samples the BASIC sample number 2,
(\samples\basic\sample02) shows how to enable username/token. You
should do sample01 as well first.

Paul


On 12/28/06, Amit G Soni <[EMAIL PROTECTED]> wrote:
>
>
>
>
> Hi list,
>
>
>
> I am generating axis2 client from Server WSDL. But server side they
require
> security and some soap header. The way I have implemented the client
is
>
>
>
> wsdl2java -uri c:\test\MyService.wsdl -p com.test -d xmlbeans
>
>
>
> After this I wrote my own test client class.
>
>
>
> package com.test;
>
>
>
> import
> com.xxx.services.my.v1.messages.HelloWorldRequestDocument;
>
> import
>
com.xxx.services.my.v1.messages.HelloWorldRequestDocument.HelloWorldRequ
est;
>
>
>
> public class TestClient {
>
>             public static void main(String args[]) {
>
>                         try {
>
>                                     MyServicePortStub stub = new
> MyServicePortStub();
>
>
>
>
> HelloWorldRequestDocument req =
> HelloWorldRequestDocument.Factory.newInstance();
>
>                                     HelloWorldRequest r =
> req.addNewHelloWorldRequest();
>
>
> r.setOptionalMessage("testmessage");
>
>                                     stub.helloWorld(req);
>
>                         }catch(Exception e) {
>
>                                     e.printStackTrace();
>
>                         }
>
>             }
>
> }
>
>
>
> Using this client I have monitored the soap request using tcpmonitor
and the
> soap request is like
>
>
>
> <?xml version='1.0' encoding='UTF-8'?>
>
>    <soapenv:Envelope
> xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/";>
>
>       <soapenv:Header />
>
>       <soapenv:Body>
>
>          <helloWorldRequest
> xmlns="http://services.bennycentral.com/my/v1/messages";>
>
>             <OptionalMessage>testmessage</OptionalMessage>
>
>          </helloWorldRequest>
>
>       </soapenv:Body>
>
>    </soapenv:Envelope>
>
>
>
> But I want to include following header elements in <soapenv:Header />
>
>
>
> <wsa:Action
> soapenv:actor="http://schemas.xmlsoap.org/soap/actor/next";
> soapenv:mustUnderstand="1"
>
xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/03/addressing";>http://serv
ices.xxx.com/xxx/v1:helloWorldIn</wsa:Action>
>
> <wsa:To>urn:EvolutionBenefits:Services:V1:xxxService</wsa:To>
>
>
>
> <wsse:Security soap:mustUnderstand = "1" xmlns:wsse =
>
"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-sece
xt-1.0.xsd">
>
> <wsse:UsernameToken xmlns:wsu =
>
"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-util
ity-1.0.xsd"
> wsu:Id =
> "SecurityToken-46eb6dc1-4792-4031-bc01-4692be8f1c2b">
>
> <wsse:Username>xxx</wsse:Username>
>
> <wsse:Password Type =
>
"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-
profile-1.0#PasswordText">xxx</wsse:Password>
>
> <wsse:Nonce>Ood0sa4w4gMvvA4MIK3Q7g==</wsse:Nonce>
>
> <wsu:Created>2005-12-08T23:46:20Z</wsu:Created>
>
> </wsse:UsernameToken>
>
> </wsse:Security>
>
>
>
> So any one of you has any idea of how to include above header elements
then
> please let me know.
>
>
>
> Thanks,
>
> Amit Soni


-- 
Paul Fremantle
VP/Technology, WSO2 and OASIS WS-RX TC Co-chair

http://bloglines.com/blog/paulfremantle
[EMAIL PROTECTED]

"Oxygenating the Web Service Platform", www.wso2.com

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


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

Reply via email to