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 Amit G Soni <Am...@mphasis.com> on 2006/12/28 09:00:24 UTC

soap header in axis2

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


Re: soap header in axis2

Posted by Paul Fremantle <pz...@gmail.com>.
Amit

By the way, it turns out you can force the WS-A headers to have
mustUnderstand='true':

Options.setProperty(AddressingConstants.ADD_MUST_UNDERSTAND_TO_ADDRESSING_HEADERS,
Boolean.TRUE);

Paul

On 1/2/07, Paul Fremantle <pz...@gmail.com> wrote:
> Amit
>
> .NET cannot REQUIRE these headers. They have very well defined meaning
> according to the SOAP specifications and they are not required
> attributes. If .NET were to require these then it would not be
> compliant with the WS-Addressing specification. In particular, Axis2
> has interoperated with .NET on WS-Addressing in the past.
>
> If its not working then its probably some other problem. Have you got
> an error log from .NET?
>
> Paul
>
> On 1/2/07, Amit G Soni <Am...@mphasis.com> wrote:
> > Hi Paul,
> >
> > Basically I am invoking third party webservices which is in .NET and
> > having these entire attributes requirement. So I think better to write
> > my own Addressing handler and include in axis2.xml?
> >
> > What you suggest?? And if it is true then can you help me out that what
> > are all things I have to do. Or any tutorial which you can aware of.
> >
> > Thanks,
> > Amit Soni
> >
> > -----Original Message-----
> > From: Paul Fremantle [mailto:pzfreo@gmail.com]
> > Sent: Tuesday, January 02, 2007 4:19 PM
> > To: axis-user@ws.apache.org
> > Subject: Re: soap header in axis2
> >
> > Amit
> >
> > I don't believe that you need the actor - next tag. That simply
> > indicates that whoever reads the header first must act upon it.
> > However, almost all soap systems will behave like that.
> >
> > Having a mustUnderstand tag is more important. Of course if you are
> > targeting a system that DOES understand WS-Addressing this will make
> > no difference. The difference will come if you send the message to a
> > system that doesn't understand WS-A. In that case it will not fail,
> > whereas with mustUnderstand='1' it should.
> >
> > By the way mustUnderstand='0' can be left off as that is the default.
> >
> > Unfortunately, I don't believe there is any way of forcing
> > mustUnderstand on in the current Axis2 Addressing module. I will raise
> > a JIRA.
> >
> > If the server you are using does support WS-Addressing then you can
> > safely leave off those attributes. Can I suggest you try it.
> >
> > If you really need a workaround, we can probably code up a handler
> > that will fix up the headers for you.
> >
> > Paul
> >
> >
> >
> >
> >
> > On 1/2/07, Amit G Soni <Am...@mphasis.com> wrote:
> > > Hi Paul,
> > >
> > > I am able to send a request with wsse and wsa header parameter. Within
> > > which wsse header tag is ok but in wsa:action and wsa:to tag I need to
> > > include namespace (xmlns) and some more attributes. So the original
> > > request of soap header is looks like:
> > >
> > > <wsa:To>urn:EvolutionBenefits:Services:V1:CardholderService</wsa:To>
> > >
> > > <wsa:Action>
> > >         http://services.bennycentral.com/Cardholder/v1:helloWorldIn
> > > </wsa:Action>
> > >
> > > But within wsa:To and wsa:Action I need to add some attribute. So
> > which
> > > is looks like:
> > >
> > > <wsa:To xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/03/addressing"
> > > soapenv:actor="http://schemas.xmlsoap.org/soap/actor/next"
> > > soapenv:mustUnderstand="1">
> > >           urn:EvolutionBenefits:Services:V1:CardholderService
> > > </wsa:To>
> > >
> > > <wsa:Action
> > xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/03/addressing"
> > >
> > >             soapenv:actor="http://schemas.xmlsoap.org/soap/actor/next"
> > >               soapenv:mustUnderstand="0">
> > >         http://services.bennycentral.com/Cardholder/v1:helloWorldIn
> > > </wsa:Action>
> > >
> > >
> > > So basically I want to include some of the attributes in wsa:Action
> > and
> > > wsa:To tags. So if you have some idea regarding this then please let
> > me
> > > know.
> > >
> > > Thanks,
> > > Amit Soni
> > >
> > > -----Original Message-----
> > > From: Paul Fremantle [mailto:pzfreo@gmail.com]
> > > Sent: Saturday, December 30, 2006 4:17 PM
> > > To: axis-user@ws.apache.org
> > > Subject: Re: soap header in axis2
> > >
> > > Amit
> > >
> > > I haven't figured out the problem yet! I don't see anything obvious
> > > with your axis2.xml.
> > >
> > > What happens if you try with the standard axis2.xml? Normally for a
> > > client, I would use the standard axis2.xml and then add
> > > ServiceClient.engageModule("rampart") in my code.
> > >
> > > Paul
> > >
> > > On 12/29/06, Amit G Soni <Am...@mphasis.com> wrote:
> > > > Hi Paul,
> > > >
> > > > I am trying rampart with version 1.0 but it gives me following error
> > > > along with the mail I am also attaching the client code and
> > axis2.xml
> > > >
> > > >      [java] org.apache.axis2.deployment.DeploymentException: Invalid
> > > > phases please recheck axis2.xml {0} for the handler {1}; nested
> > > > exception is:
> > > >      [java]     org.apache.axis2.deployment.DeploymentException:
> > > Invalid
> > > > phases please recheck axis2.xml {0} for the handler {1}
> > > >      [java]     at
> > > >
> > >
> > org.apache.axis2.deployment.DeploymentEngine.loadRepository(DeploymentEn
> > > > gine.java:117)
> > > >      [java]     at
> > > >
> > >
> > org.apache.axis2.deployment.FileSystemConfigurator.getAxisConfiguration(
> > > > FileSystemConfigurator.java:120)
> > > >      [java]     at
> > > >
> > >
> > org.apache.axis2.context.ConfigurationContextFactory.createConfiguration
> > > > Context(ConfigurationContextFactory.java:38)
> > > >      [java]     at
> > > >
> > >
> > org.apache.axis2.context.ConfigurationContextFactory.createConfiguration
> > > > ContextFromFileSystem(ConfigurationContextFactory.java:90)
> > > >      [java]     at com.test.TestClient.main(TestClient.java:18)
> > > >      [java]     at
> > sun.reflect.NativeMethodAccessorImpl.invoke0(Native
> > > > Method)
> > > >      [java]     at
> > > >
> > >
> > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
> > > > a:39)
> > > >      [java]     at
> > > >
> > >
> > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
> > > > Impl.java:25)
> > > >      [java]     at java.lang.reflect.Method.invoke(Method.java:324)
> > > >      [java]     at
> > > > org.apache.tools.ant.taskdefs.ExecuteJava.run(ExecuteJava.java:217)
> > > >      [java]     at
> > > >
> > >
> > org.apache.tools.ant.taskdefs.ExecuteJava.execute(ExecuteJava.java:152)
> > > >      [java]     at
> > > org.apache.tools.ant.taskdefs.Java.run(Java.java:745)
> > > >      [java]     at
> > > > org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:199)
> > > >      [java]     at
> > > > org.apache.tools.ant.taskdefs.Java.execute(Java.java:102)
> > > >      [java]     at
> > > > org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
> > > >      [java]     at
> > sun.reflect.NativeMethodAccessorImpl.invoke0(Native
> > > > Method)
> > > >      [java]     at
> > > >
> > >
> > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
> > > > a:39)
> > > >      [java]     at
> > > >
> > >
> > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
> > > > Impl.java:25)
> > > >      [java]     at java.lang.reflect.Method.invoke(Method.java:324)
> > > >      [java]     at
> > > >
> > >
> > org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:1
> > > > 05)
> > > >      [java]     at org.apache.tools.ant.Task.perform(Task.java:342)
> > > >      [java]     at
> > > org.apache.tools.ant.Target.execute(Target.java:357)
> > > >      [java]     at
> > > > org.apache.tools.ant.Target.performTasks(Target.java:385)
> > > >      [java]     at
> > > > org.apache.tools.ant.Project.executeSortedTargets(Project.java:1292)
> > > >      [java]     at
> > > > org.apache.tools.ant.Project.executeTarget(Project.java:1261)
> > > >      [java]     at
> > > >
> > >
> > org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecut
> > > > or.java:41)
> > > >      [java]     at
> > > > org.apache.tools.ant.Project.executeTargets(Project.java:1144)
> > > >      [java]     at org.apache.tools.ant.Main.runBuild(Main.java:698)
> > > >      [java]     at org.apache.tools.ant.Main.startAnt(Main.java:199)
> > > >      [java]     at
> > > > org.apache.tools.ant.launch.Launcher.run(Launcher.java:298)
> > > >      [java]     at
> > > > org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)
> > > >      [java] Caused by:
> > > org.apache.axis2.deployment.DeploymentException:
> > > > Invalid phases please recheck axis2.xml {0} for the handler {1}
> > > >      [java]     at
> > > >
> > >
> > org.apache.axis2.deployment.util.PhasesInfo.getGlobalInflow(PhasesInfo.j
> > > > ava:111)
> > > >      [java]     at
> > > >
> > >
> > org.apache.axis2.deployment.DeploymentEngine.validateSystemPredefinedPha
> > > > ses(DeploymentEngine.java:817)
> > > >      [java]     at
> > > >
> > >
> > org.apache.axis2.deployment.DeploymentEngine.loadRepository(DeploymentEn
> > > > gine.java:115)
> > > >      [java]     ... 30 more
> > > >      [java] __________________1
> > > >
> > > > Thanks,
> > > > Amit Soni
> > > >
> > > > -----Original Message-----
> > > > From: Paul Fremantle [mailto:pzfreo@gmail.com]
> > > > Sent: Thursday, December 28, 2006 8:45 PM
> > > > To: axis-user@ws.apache.org
> > > > Subject: Re: soap header in axis2
> > > >
> > > > Amit
> > > >
> > > > You seem to have cut out the phases from axis2.xml. The config needs
> > > > the phases defined. That is how it figures out how to interleave the
> > > > security handlers. If you take the standard axis2.xml and add those
> > > > lines:
> > > > <module ref="rampart" />
> > > >         <parameter name="OutflowSecurity">
> > > >         <action>
> > > >                 <items>UsernameToken Timestamp</items>
> > > >                 <user>wfws</user>
> > > >
> > > > <passwordCallbackClass>com.test.PWCallback</passwordCallbackClass>
> > > >         </action>
> > > >     </parameter>
> > > >
> > > > Paul
> > > >
> > > > On 12/28/06, Amit G Soni <Am...@mphasis.com> wrote:
> > > > > Hi Paul,
> > > > >
> > > > > Thanks a lot for all of your help.
> > > > >
> > > > > I have executed the same wsdl with axis-1.4 successfully but in
> > > axis2
> > > > it
> > > > > gives these error. I between I have downloaded the rampart-1.0.mar
> > > > file
> > > > > but when I am running following line of code it gives me
> > exception.
> > > > >
> > > > > ConfigurationContext context = ConfigurationContextFactory
> > > > > .createConfigurationContextFromFileSystem(
> > > > > "resources", "resources/axis2.xml");
> > > > >
> > > > >
> > > > > log4j:WARN No appenders could be found for logger
> > > > > (org.apache.axiom.om.impl.builder.StAXOMBuilder).
> > > > > log4j:WARN Please initialize the log4j system properly.
> > > > > org.apache.axis2.deployment.DeploymentException: Invalid phases
> > > please
> > > > > recheck axis2.xml {0} for the handler {1}; nested exception is:
> > > > >         org.apache.axis2.deployment.DeploymentException: Invalid
> > > > phases
> > > > > please recheck axis2.xml {0} for the handler {1}
> > > > >         at
> > > > >
> > > >
> > >
> > org.apache.axis2.deployment.DeploymentEngine.loadRepository(DeploymentEn
> > > > > gine.java:117)
> > > > >         at
> > > > >
> > > >
> > >
> > org.apache.axis2.deployment.FileSystemConfigurator.getAxisConfiguration(
> > > > > FileSystemConfigurator.java:120)
> > > > >         at
> > > > >
> > > >
> > >
> > org.apache.axis2.context.ConfigurationContextFactory.createConfiguration
> > > > > Context(ConfigurationContextFactory.java:38)
> > > > >         at
> > > > >
> > > >
> > >
> > org.apache.axis2.context.ConfigurationContextFactory.createConfiguration
> > > > > ContextFromFileSystem(ConfigurationContextFactory.java:90)
> > > > >         at com.test.TestClient.main(TestClient.java:15)
> > > > > Caused by: org.apache.axis2.deployment.DeploymentException:
> > Invalid
> > > > > phases please recheck axis2.xml {0} for the handler {1}
> > > > >         at
> > > > >
> > > >
> > >
> > org.apache.axis2.deployment.util.PhasesInfo.getGlobalInflow(PhasesInfo.j
> > > > > ava:111)
> > > > >         at
> > > > >
> > > >
> > >
> > org.apache.axis2.deployment.DeploymentEngine.validateSystemPredefinedPha
> > > > > ses(DeploymentEngine.java:817)
> > > > >         at
> > > > >
> > > >
> > >
> > org.apache.axis2.deployment.DeploymentEngine.loadRepository(DeploymentEn
> > > > > gine.java:115)
> > > > >         ... 4 more
> > > > > Exception in thread "main"
> > > > >
> > > > > I have attached the axis2.xml file along with this also.
> > > > >
> > > > > Thanks,
> > > > > Amit Soni
> > > > >
> > > > > -----Original Message-----
> > > > > From: Paul Fremantle [mailto:pzfreo@gmail.com]
> > > > > Sent: Thursday, December 28, 2006 8:01 PM
> > > > > To: axis-user@ws.apache.org
> > > > > Subject: Re: soap header in axis2
> > > > >
> > > > > Amit
> > > > >
> > > > > You seem to have found a bug in the WSDL2Java toolkit. I can't see
> > > > > anything obviously wrong with your WSDL, and it validates with
> > both
> > > > > Eclipse and Axis1.4. Can you please raise a JIRA including your
> > > > > WSDL/XSDs as an attachment?
> > > > >
> > > > > Here is the link to rampart1.0 in the meantime:
> > > > >
> > > http://apache.rmplc.co.uk/ws/axis2/modules/rampart/1_0/rampart-1.0.mar
> > > > >
> > > > > Paul
> > > > >
> > > > > On 12/28/06, Amit G Soni <Am...@mphasis.com> wrote:
> > > > > > Hi Paul,
> > > > > >
> > > > > > I am trying to find rampath-1.0 but I am not able to fine any
> > link
> > > > > from
> > > > > > which version 1.0 I can download.
> > > > > >
> > > > > > But after that I am trying the same with Axis2-1.1
> > > > > >
> > > > > > But in this case it gives me following exception.
> > > > > >
> > > > > > C:\axis211>wsdl2java -uri c:\test\CardholderService.wsdl -p
> > > com.test
> > > > > -d
> > > > > > none
> > > > > > Using AXIS2_HOME:   C:\Java\axis2-1.1
> > > > > > Using JAVA_HOME:    C:\Java\j2sdk1.4.2_13
> > > > > > Retrieving schema at 'CardholderData.xsd', relative to
> > > > > 'file:/c:/test/'.
> > > > > > Retrieving schema at 'CardholderMessages.xsd', relative to
> > > > > > 'file:/c:/test/'.
> > > > > > Retrieving schema at 'CardholderData.xsd', relative to
> > > > > > 'file:/c:/test/CardholderMessages.xsd'.
> > > > > > Retrieving schema at 'OperationResults.xsd', relative to
> > > > > > 'file:/c:/test/CardholderMessages.xsd'.
> > > > > > Retrieving schema at 'OperationResults.xsd', relative to
> > > > > > 'file:/c:/test/'.
> > > > > > Dec 28, 2006 7:10:25 PM
> > > > > > org.apache.axis2.description.WSDL11ToAxisServiceBuilder
> > > > > populateService
> > > > > > SEVERE: java.lang.NullPointerException
> > > > > > Exception in thread "main"
> > > > > > org.apache.axis2.wsdl.codegen.CodeGenerationException: Error
> > > parsing
> > > > > > WSDL
> > > > > >         at
> > > > > >
> > > > >
> > > >
> > >
> > org.apache.axis2.wsdl.codegen.CodeGenerationEngine.<init>(CodeGeneration
> > > > > > Engine.java:112)
> > > > > >         at
> > org.apache.axis2.wsdl.WSDL2Code.main(WSDL2Code.java:32)
> > > > > >         at
> > org.apache.axis2.wsdl.WSDL2Java.main(WSDL2Java.java:21)
> > > > > > Caused by: org.apache.axis2.AxisFault: null; nested exception
> > is:
> > > > > >         java.lang.NullPointerException
> > > > > >         at
> > > > > >
> > > > >
> > > >
> > >
> > org.apache.axis2.description.WSDL11ToAxisServiceBuilder.populateService(
> > > > > > WSDL11ToAxisServiceBuilder.java:250)
> > > > > >         at
> > > > > >
> > > > >
> > > >
> > >
> > org.apache.axis2.wsdl.codegen.CodeGenerationEngine.<init>(CodeGeneration
> > > > > > Engine.java:103)
> > > > > >         ... 2 more
> > > > > > Caused by: java.lang.NullPointerException
> > > > > >         at
> > > > > >
> > > > >
> > > >
> > >
> > org.apache.axis2.description.WSDL11ToAxisServiceBuilder.populateService(
> > > > > > WSDL11ToAxisServiceBuilder.java:235)
> > > > > >         ... 3 more
> > > > > >
> > > > > > Can you have any idea why it is happens.
> > > > > >
> > > > > > I am also attaching my wsdl file along with the mail.
> > > > > >
> > > > > > Thanks,
> > > > > > Amit Soni
> > > > > >
> > > > > >
> > > > > > -----Original Message-----
> > > > > > From: Paul Fremantle [mailto:pzfreo@gmail.com]
> > > > > > Sent: Thursday, December 28, 2006 6:30 PM
> > > > > > To: axis-user@ws.apache.org
> > > > > > Subject: Re: soap header in axis2
> > > > > >
> > > > > > Amit
> > > > > >
> > > > > > No, rampart 1.1 is expected to be used with Axis2 1.1.
> > > > > >
> > > > > > If you can move to 1.1 you should, because of the large number
> > of
> > > > bugs
> > > > > > fixed!
> > > > > >
> > > > > > Otherwise there is rampart1.0 available.
> > > > > >
> > > > > > Paul
> > > > > >
> > > > > > On 12/28/06, Amit G Soni <Am...@mphasis.com> wrote:
> > > > > > > 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:pzfreo@gmail.com]
> > > > > > > Sent: Thursday, December 28, 2006 4:17 PM
> > > > > > > To: axis-user@ws.apache.org
> > > > > > > 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 <Am...@mphasis.com> 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
> > > > > > > paul@wso2.com
> > > > > > >
> > > > > > > "Oxygenating the Web Service Platform", www.wso2.com
> > > > > > >
> > > > > > >
> > > > >
> > > ---------------------------------------------------------------------
> > > > > > > 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
> > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > > > --
> > > > > > Paul Fremantle
> > > > > > VP/Technology, WSO2 and OASIS WS-RX TC Co-chair
> > > > > >
> > > > > > http://bloglines.com/blog/paulfremantle
> > > > > > paul@wso2.com
> > > > > >
> > > > > > "Oxygenating the Web Service Platform", www.wso2.com
> > > > > >
> > > > > >
> > > >
> > ---------------------------------------------------------------------
> > > > > > 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
> > > > > >
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > > > --
> > > > > Paul Fremantle
> > > > > VP/Technology, WSO2 and OASIS WS-RX TC Co-chair
> > > > >
> > > > > http://bloglines.com/blog/paulfremantle
> > > > > paul@wso2.com
> > > > >
> > > > > "Oxygenating the Web Service Platform", www.wso2.com
> > > > >
> > > > >
> > > ---------------------------------------------------------------------
> > > > > 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
> > > > >
> > > > >
> > > > >
> > > >
> > > >
> > > > --
> > > > Paul Fremantle
> > > > VP/Technology, WSO2 and OASIS WS-RX TC Co-chair
> > > >
> > > > http://bloglines.com/blog/paulfremantle
> > > > paul@wso2.com
> > > >
> > > > "Oxygenating the Web Service Platform", www.wso2.com
> > > >
> > > >
> > ---------------------------------------------------------------------
> > > > 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
> > > >
> > > >
> > > >
> > >
> > >
> > > --
> > > Paul Fremantle
> > > VP/Technology, WSO2 and OASIS WS-RX TC Co-chair
> > >
> > > http://bloglines.com/blog/paulfremantle
> > > paul@wso2.com
> > >
> > > "Oxygenating the Web Service Platform", www.wso2.com
> > >
> > > ---------------------------------------------------------------------
> > > 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
> > >
> > >
> >
> >
> > --
> > Paul Fremantle
> > VP/Technology, WSO2 and OASIS WS-RX TC Co-chair
> >
> > http://bloglines.com/blog/paulfremantle
> > paul@wso2.com
> >
> > "Oxygenating the Web Service Platform", www.wso2.com
> >
> > ---------------------------------------------------------------------
> > 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
> >
> >
>
>
> --
> Paul Fremantle
> VP/Technology, WSO2 and OASIS WS-RX TC Co-chair
>
> http://bloglines.com/blog/paulfremantle
> paul@wso2.com
>
> "Oxygenating the Web Service Platform", www.wso2.com
>


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

http://bloglines.com/blog/paulfremantle
paul@wso2.com

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

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


Re: soap header in axis2

Posted by Paul Fremantle <pz...@gmail.com>.
Amit

.NET cannot REQUIRE these headers. They have very well defined meaning
according to the SOAP specifications and they are not required
attributes. If .NET were to require these then it would not be
compliant with the WS-Addressing specification. In particular, Axis2
has interoperated with .NET on WS-Addressing in the past.

If its not working then its probably some other problem. Have you got
an error log from .NET?

Paul

On 1/2/07, Amit G Soni <Am...@mphasis.com> wrote:
> Hi Paul,
>
> Basically I am invoking third party webservices which is in .NET and
> having these entire attributes requirement. So I think better to write
> my own Addressing handler and include in axis2.xml?
>
> What you suggest?? And if it is true then can you help me out that what
> are all things I have to do. Or any tutorial which you can aware of.
>
> Thanks,
> Amit Soni
>
> -----Original Message-----
> From: Paul Fremantle [mailto:pzfreo@gmail.com]
> Sent: Tuesday, January 02, 2007 4:19 PM
> To: axis-user@ws.apache.org
> Subject: Re: soap header in axis2
>
> Amit
>
> I don't believe that you need the actor - next tag. That simply
> indicates that whoever reads the header first must act upon it.
> However, almost all soap systems will behave like that.
>
> Having a mustUnderstand tag is more important. Of course if you are
> targeting a system that DOES understand WS-Addressing this will make
> no difference. The difference will come if you send the message to a
> system that doesn't understand WS-A. In that case it will not fail,
> whereas with mustUnderstand='1' it should.
>
> By the way mustUnderstand='0' can be left off as that is the default.
>
> Unfortunately, I don't believe there is any way of forcing
> mustUnderstand on in the current Axis2 Addressing module. I will raise
> a JIRA.
>
> If the server you are using does support WS-Addressing then you can
> safely leave off those attributes. Can I suggest you try it.
>
> If you really need a workaround, we can probably code up a handler
> that will fix up the headers for you.
>
> Paul
>
>
>
>
>
> On 1/2/07, Amit G Soni <Am...@mphasis.com> wrote:
> > Hi Paul,
> >
> > I am able to send a request with wsse and wsa header parameter. Within
> > which wsse header tag is ok but in wsa:action and wsa:to tag I need to
> > include namespace (xmlns) and some more attributes. So the original
> > request of soap header is looks like:
> >
> > <wsa:To>urn:EvolutionBenefits:Services:V1:CardholderService</wsa:To>
> >
> > <wsa:Action>
> >         http://services.bennycentral.com/Cardholder/v1:helloWorldIn
> > </wsa:Action>
> >
> > But within wsa:To and wsa:Action I need to add some attribute. So
> which
> > is looks like:
> >
> > <wsa:To xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/03/addressing"
> > soapenv:actor="http://schemas.xmlsoap.org/soap/actor/next"
> > soapenv:mustUnderstand="1">
> >           urn:EvolutionBenefits:Services:V1:CardholderService
> > </wsa:To>
> >
> > <wsa:Action
> xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/03/addressing"
> >
> >             soapenv:actor="http://schemas.xmlsoap.org/soap/actor/next"
> >               soapenv:mustUnderstand="0">
> >         http://services.bennycentral.com/Cardholder/v1:helloWorldIn
> > </wsa:Action>
> >
> >
> > So basically I want to include some of the attributes in wsa:Action
> and
> > wsa:To tags. So if you have some idea regarding this then please let
> me
> > know.
> >
> > Thanks,
> > Amit Soni
> >
> > -----Original Message-----
> > From: Paul Fremantle [mailto:pzfreo@gmail.com]
> > Sent: Saturday, December 30, 2006 4:17 PM
> > To: axis-user@ws.apache.org
> > Subject: Re: soap header in axis2
> >
> > Amit
> >
> > I haven't figured out the problem yet! I don't see anything obvious
> > with your axis2.xml.
> >
> > What happens if you try with the standard axis2.xml? Normally for a
> > client, I would use the standard axis2.xml and then add
> > ServiceClient.engageModule("rampart") in my code.
> >
> > Paul
> >
> > On 12/29/06, Amit G Soni <Am...@mphasis.com> wrote:
> > > Hi Paul,
> > >
> > > I am trying rampart with version 1.0 but it gives me following error
> > > along with the mail I am also attaching the client code and
> axis2.xml
> > >
> > >      [java] org.apache.axis2.deployment.DeploymentException: Invalid
> > > phases please recheck axis2.xml {0} for the handler {1}; nested
> > > exception is:
> > >      [java]     org.apache.axis2.deployment.DeploymentException:
> > Invalid
> > > phases please recheck axis2.xml {0} for the handler {1}
> > >      [java]     at
> > >
> >
> org.apache.axis2.deployment.DeploymentEngine.loadRepository(DeploymentEn
> > > gine.java:117)
> > >      [java]     at
> > >
> >
> org.apache.axis2.deployment.FileSystemConfigurator.getAxisConfiguration(
> > > FileSystemConfigurator.java:120)
> > >      [java]     at
> > >
> >
> org.apache.axis2.context.ConfigurationContextFactory.createConfiguration
> > > Context(ConfigurationContextFactory.java:38)
> > >      [java]     at
> > >
> >
> org.apache.axis2.context.ConfigurationContextFactory.createConfiguration
> > > ContextFromFileSystem(ConfigurationContextFactory.java:90)
> > >      [java]     at com.test.TestClient.main(TestClient.java:18)
> > >      [java]     at
> sun.reflect.NativeMethodAccessorImpl.invoke0(Native
> > > Method)
> > >      [java]     at
> > >
> >
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
> > > a:39)
> > >      [java]     at
> > >
> >
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
> > > Impl.java:25)
> > >      [java]     at java.lang.reflect.Method.invoke(Method.java:324)
> > >      [java]     at
> > > org.apache.tools.ant.taskdefs.ExecuteJava.run(ExecuteJava.java:217)
> > >      [java]     at
> > >
> >
> org.apache.tools.ant.taskdefs.ExecuteJava.execute(ExecuteJava.java:152)
> > >      [java]     at
> > org.apache.tools.ant.taskdefs.Java.run(Java.java:745)
> > >      [java]     at
> > > org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:199)
> > >      [java]     at
> > > org.apache.tools.ant.taskdefs.Java.execute(Java.java:102)
> > >      [java]     at
> > > org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
> > >      [java]     at
> sun.reflect.NativeMethodAccessorImpl.invoke0(Native
> > > Method)
> > >      [java]     at
> > >
> >
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
> > > a:39)
> > >      [java]     at
> > >
> >
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
> > > Impl.java:25)
> > >      [java]     at java.lang.reflect.Method.invoke(Method.java:324)
> > >      [java]     at
> > >
> >
> org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:1
> > > 05)
> > >      [java]     at org.apache.tools.ant.Task.perform(Task.java:342)
> > >      [java]     at
> > org.apache.tools.ant.Target.execute(Target.java:357)
> > >      [java]     at
> > > org.apache.tools.ant.Target.performTasks(Target.java:385)
> > >      [java]     at
> > > org.apache.tools.ant.Project.executeSortedTargets(Project.java:1292)
> > >      [java]     at
> > > org.apache.tools.ant.Project.executeTarget(Project.java:1261)
> > >      [java]     at
> > >
> >
> org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecut
> > > or.java:41)
> > >      [java]     at
> > > org.apache.tools.ant.Project.executeTargets(Project.java:1144)
> > >      [java]     at org.apache.tools.ant.Main.runBuild(Main.java:698)
> > >      [java]     at org.apache.tools.ant.Main.startAnt(Main.java:199)
> > >      [java]     at
> > > org.apache.tools.ant.launch.Launcher.run(Launcher.java:298)
> > >      [java]     at
> > > org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)
> > >      [java] Caused by:
> > org.apache.axis2.deployment.DeploymentException:
> > > Invalid phases please recheck axis2.xml {0} for the handler {1}
> > >      [java]     at
> > >
> >
> org.apache.axis2.deployment.util.PhasesInfo.getGlobalInflow(PhasesInfo.j
> > > ava:111)
> > >      [java]     at
> > >
> >
> org.apache.axis2.deployment.DeploymentEngine.validateSystemPredefinedPha
> > > ses(DeploymentEngine.java:817)
> > >      [java]     at
> > >
> >
> org.apache.axis2.deployment.DeploymentEngine.loadRepository(DeploymentEn
> > > gine.java:115)
> > >      [java]     ... 30 more
> > >      [java] __________________1
> > >
> > > Thanks,
> > > Amit Soni
> > >
> > > -----Original Message-----
> > > From: Paul Fremantle [mailto:pzfreo@gmail.com]
> > > Sent: Thursday, December 28, 2006 8:45 PM
> > > To: axis-user@ws.apache.org
> > > Subject: Re: soap header in axis2
> > >
> > > Amit
> > >
> > > You seem to have cut out the phases from axis2.xml. The config needs
> > > the phases defined. That is how it figures out how to interleave the
> > > security handlers. If you take the standard axis2.xml and add those
> > > lines:
> > > <module ref="rampart" />
> > >         <parameter name="OutflowSecurity">
> > >         <action>
> > >                 <items>UsernameToken Timestamp</items>
> > >                 <user>wfws</user>
> > >
> > > <passwordCallbackClass>com.test.PWCallback</passwordCallbackClass>
> > >         </action>
> > >     </parameter>
> > >
> > > Paul
> > >
> > > On 12/28/06, Amit G Soni <Am...@mphasis.com> wrote:
> > > > Hi Paul,
> > > >
> > > > Thanks a lot for all of your help.
> > > >
> > > > I have executed the same wsdl with axis-1.4 successfully but in
> > axis2
> > > it
> > > > gives these error. I between I have downloaded the rampart-1.0.mar
> > > file
> > > > but when I am running following line of code it gives me
> exception.
> > > >
> > > > ConfigurationContext context = ConfigurationContextFactory
> > > > .createConfigurationContextFromFileSystem(
> > > > "resources", "resources/axis2.xml");
> > > >
> > > >
> > > > log4j:WARN No appenders could be found for logger
> > > > (org.apache.axiom.om.impl.builder.StAXOMBuilder).
> > > > log4j:WARN Please initialize the log4j system properly.
> > > > org.apache.axis2.deployment.DeploymentException: Invalid phases
> > please
> > > > recheck axis2.xml {0} for the handler {1}; nested exception is:
> > > >         org.apache.axis2.deployment.DeploymentException: Invalid
> > > phases
> > > > please recheck axis2.xml {0} for the handler {1}
> > > >         at
> > > >
> > >
> >
> org.apache.axis2.deployment.DeploymentEngine.loadRepository(DeploymentEn
> > > > gine.java:117)
> > > >         at
> > > >
> > >
> >
> org.apache.axis2.deployment.FileSystemConfigurator.getAxisConfiguration(
> > > > FileSystemConfigurator.java:120)
> > > >         at
> > > >
> > >
> >
> org.apache.axis2.context.ConfigurationContextFactory.createConfiguration
> > > > Context(ConfigurationContextFactory.java:38)
> > > >         at
> > > >
> > >
> >
> org.apache.axis2.context.ConfigurationContextFactory.createConfiguration
> > > > ContextFromFileSystem(ConfigurationContextFactory.java:90)
> > > >         at com.test.TestClient.main(TestClient.java:15)
> > > > Caused by: org.apache.axis2.deployment.DeploymentException:
> Invalid
> > > > phases please recheck axis2.xml {0} for the handler {1}
> > > >         at
> > > >
> > >
> >
> org.apache.axis2.deployment.util.PhasesInfo.getGlobalInflow(PhasesInfo.j
> > > > ava:111)
> > > >         at
> > > >
> > >
> >
> org.apache.axis2.deployment.DeploymentEngine.validateSystemPredefinedPha
> > > > ses(DeploymentEngine.java:817)
> > > >         at
> > > >
> > >
> >
> org.apache.axis2.deployment.DeploymentEngine.loadRepository(DeploymentEn
> > > > gine.java:115)
> > > >         ... 4 more
> > > > Exception in thread "main"
> > > >
> > > > I have attached the axis2.xml file along with this also.
> > > >
> > > > Thanks,
> > > > Amit Soni
> > > >
> > > > -----Original Message-----
> > > > From: Paul Fremantle [mailto:pzfreo@gmail.com]
> > > > Sent: Thursday, December 28, 2006 8:01 PM
> > > > To: axis-user@ws.apache.org
> > > > Subject: Re: soap header in axis2
> > > >
> > > > Amit
> > > >
> > > > You seem to have found a bug in the WSDL2Java toolkit. I can't see
> > > > anything obviously wrong with your WSDL, and it validates with
> both
> > > > Eclipse and Axis1.4. Can you please raise a JIRA including your
> > > > WSDL/XSDs as an attachment?
> > > >
> > > > Here is the link to rampart1.0 in the meantime:
> > > >
> > http://apache.rmplc.co.uk/ws/axis2/modules/rampart/1_0/rampart-1.0.mar
> > > >
> > > > Paul
> > > >
> > > > On 12/28/06, Amit G Soni <Am...@mphasis.com> wrote:
> > > > > Hi Paul,
> > > > >
> > > > > I am trying to find rampath-1.0 but I am not able to fine any
> link
> > > > from
> > > > > which version 1.0 I can download.
> > > > >
> > > > > But after that I am trying the same with Axis2-1.1
> > > > >
> > > > > But in this case it gives me following exception.
> > > > >
> > > > > C:\axis211>wsdl2java -uri c:\test\CardholderService.wsdl -p
> > com.test
> > > > -d
> > > > > none
> > > > > Using AXIS2_HOME:   C:\Java\axis2-1.1
> > > > > Using JAVA_HOME:    C:\Java\j2sdk1.4.2_13
> > > > > Retrieving schema at 'CardholderData.xsd', relative to
> > > > 'file:/c:/test/'.
> > > > > Retrieving schema at 'CardholderMessages.xsd', relative to
> > > > > 'file:/c:/test/'.
> > > > > Retrieving schema at 'CardholderData.xsd', relative to
> > > > > 'file:/c:/test/CardholderMessages.xsd'.
> > > > > Retrieving schema at 'OperationResults.xsd', relative to
> > > > > 'file:/c:/test/CardholderMessages.xsd'.
> > > > > Retrieving schema at 'OperationResults.xsd', relative to
> > > > > 'file:/c:/test/'.
> > > > > Dec 28, 2006 7:10:25 PM
> > > > > org.apache.axis2.description.WSDL11ToAxisServiceBuilder
> > > > populateService
> > > > > SEVERE: java.lang.NullPointerException
> > > > > Exception in thread "main"
> > > > > org.apache.axis2.wsdl.codegen.CodeGenerationException: Error
> > parsing
> > > > > WSDL
> > > > >         at
> > > > >
> > > >
> > >
> >
> org.apache.axis2.wsdl.codegen.CodeGenerationEngine.<init>(CodeGeneration
> > > > > Engine.java:112)
> > > > >         at
> org.apache.axis2.wsdl.WSDL2Code.main(WSDL2Code.java:32)
> > > > >         at
> org.apache.axis2.wsdl.WSDL2Java.main(WSDL2Java.java:21)
> > > > > Caused by: org.apache.axis2.AxisFault: null; nested exception
> is:
> > > > >         java.lang.NullPointerException
> > > > >         at
> > > > >
> > > >
> > >
> >
> org.apache.axis2.description.WSDL11ToAxisServiceBuilder.populateService(
> > > > > WSDL11ToAxisServiceBuilder.java:250)
> > > > >         at
> > > > >
> > > >
> > >
> >
> org.apache.axis2.wsdl.codegen.CodeGenerationEngine.<init>(CodeGeneration
> > > > > Engine.java:103)
> > > > >         ... 2 more
> > > > > Caused by: java.lang.NullPointerException
> > > > >         at
> > > > >
> > > >
> > >
> >
> org.apache.axis2.description.WSDL11ToAxisServiceBuilder.populateService(
> > > > > WSDL11ToAxisServiceBuilder.java:235)
> > > > >         ... 3 more
> > > > >
> > > > > Can you have any idea why it is happens.
> > > > >
> > > > > I am also attaching my wsdl file along with the mail.
> > > > >
> > > > > Thanks,
> > > > > Amit Soni
> > > > >
> > > > >
> > > > > -----Original Message-----
> > > > > From: Paul Fremantle [mailto:pzfreo@gmail.com]
> > > > > Sent: Thursday, December 28, 2006 6:30 PM
> > > > > To: axis-user@ws.apache.org
> > > > > Subject: Re: soap header in axis2
> > > > >
> > > > > Amit
> > > > >
> > > > > No, rampart 1.1 is expected to be used with Axis2 1.1.
> > > > >
> > > > > If you can move to 1.1 you should, because of the large number
> of
> > > bugs
> > > > > fixed!
> > > > >
> > > > > Otherwise there is rampart1.0 available.
> > > > >
> > > > > Paul
> > > > >
> > > > > On 12/28/06, Amit G Soni <Am...@mphasis.com> wrote:
> > > > > > 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:pzfreo@gmail.com]
> > > > > > Sent: Thursday, December 28, 2006 4:17 PM
> > > > > > To: axis-user@ws.apache.org
> > > > > > 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 <Am...@mphasis.com> 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
> > > > > > paul@wso2.com
> > > > > >
> > > > > > "Oxygenating the Web Service Platform", www.wso2.com
> > > > > >
> > > > > >
> > > >
> > ---------------------------------------------------------------------
> > > > > > 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
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > > > --
> > > > > Paul Fremantle
> > > > > VP/Technology, WSO2 and OASIS WS-RX TC Co-chair
> > > > >
> > > > > http://bloglines.com/blog/paulfremantle
> > > > > paul@wso2.com
> > > > >
> > > > > "Oxygenating the Web Service Platform", www.wso2.com
> > > > >
> > > > >
> > >
> ---------------------------------------------------------------------
> > > > > 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
> > > > >
> > > > >
> > > > >
> > > >
> > > >
> > > > --
> > > > Paul Fremantle
> > > > VP/Technology, WSO2 and OASIS WS-RX TC Co-chair
> > > >
> > > > http://bloglines.com/blog/paulfremantle
> > > > paul@wso2.com
> > > >
> > > > "Oxygenating the Web Service Platform", www.wso2.com
> > > >
> > > >
> > ---------------------------------------------------------------------
> > > > 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
> > > >
> > > >
> > > >
> > >
> > >
> > > --
> > > Paul Fremantle
> > > VP/Technology, WSO2 and OASIS WS-RX TC Co-chair
> > >
> > > http://bloglines.com/blog/paulfremantle
> > > paul@wso2.com
> > >
> > > "Oxygenating the Web Service Platform", www.wso2.com
> > >
> > >
> ---------------------------------------------------------------------
> > > 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
> > >
> > >
> > >
> >
> >
> > --
> > Paul Fremantle
> > VP/Technology, WSO2 and OASIS WS-RX TC Co-chair
> >
> > http://bloglines.com/blog/paulfremantle
> > paul@wso2.com
> >
> > "Oxygenating the Web Service Platform", www.wso2.com
> >
> > ---------------------------------------------------------------------
> > 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
> >
> >
>
>
> --
> Paul Fremantle
> VP/Technology, WSO2 and OASIS WS-RX TC Co-chair
>
> http://bloglines.com/blog/paulfremantle
> paul@wso2.com
>
> "Oxygenating the Web Service Platform", www.wso2.com
>
> ---------------------------------------------------------------------
> 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
>
>


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

http://bloglines.com/blog/paulfremantle
paul@wso2.com

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

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


RE: soap header in axis2

Posted by Amit G Soni <Am...@mphasis.com>.
Hi Paul,

Basically I am invoking third party webservices which is in .NET and
having these entire attributes requirement. So I think better to write
my own Addressing handler and include in axis2.xml?

What you suggest?? And if it is true then can you help me out that what
are all things I have to do. Or any tutorial which you can aware of.

Thanks,
Amit Soni

-----Original Message-----
From: Paul Fremantle [mailto:pzfreo@gmail.com] 
Sent: Tuesday, January 02, 2007 4:19 PM
To: axis-user@ws.apache.org
Subject: Re: soap header in axis2

Amit

I don't believe that you need the actor - next tag. That simply
indicates that whoever reads the header first must act upon it.
However, almost all soap systems will behave like that.

Having a mustUnderstand tag is more important. Of course if you are
targeting a system that DOES understand WS-Addressing this will make
no difference. The difference will come if you send the message to a
system that doesn't understand WS-A. In that case it will not fail,
whereas with mustUnderstand='1' it should.

By the way mustUnderstand='0' can be left off as that is the default.

Unfortunately, I don't believe there is any way of forcing
mustUnderstand on in the current Axis2 Addressing module. I will raise
a JIRA.

If the server you are using does support WS-Addressing then you can
safely leave off those attributes. Can I suggest you try it.

If you really need a workaround, we can probably code up a handler
that will fix up the headers for you.

Paul





On 1/2/07, Amit G Soni <Am...@mphasis.com> wrote:
> Hi Paul,
>
> I am able to send a request with wsse and wsa header parameter. Within
> which wsse header tag is ok but in wsa:action and wsa:to tag I need to
> include namespace (xmlns) and some more attributes. So the original
> request of soap header is looks like:
>
> <wsa:To>urn:EvolutionBenefits:Services:V1:CardholderService</wsa:To>
>
> <wsa:Action>
>         http://services.bennycentral.com/Cardholder/v1:helloWorldIn
> </wsa:Action>
>
> But within wsa:To and wsa:Action I need to add some attribute. So
which
> is looks like:
>
> <wsa:To xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/03/addressing"
> soapenv:actor="http://schemas.xmlsoap.org/soap/actor/next"
> soapenv:mustUnderstand="1">
>           urn:EvolutionBenefits:Services:V1:CardholderService
> </wsa:To>
>
> <wsa:Action
xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/03/addressing"
>
>             soapenv:actor="http://schemas.xmlsoap.org/soap/actor/next"
>               soapenv:mustUnderstand="0">
>         http://services.bennycentral.com/Cardholder/v1:helloWorldIn
> </wsa:Action>
>
>
> So basically I want to include some of the attributes in wsa:Action
and
> wsa:To tags. So if you have some idea regarding this then please let
me
> know.
>
> Thanks,
> Amit Soni
>
> -----Original Message-----
> From: Paul Fremantle [mailto:pzfreo@gmail.com]
> Sent: Saturday, December 30, 2006 4:17 PM
> To: axis-user@ws.apache.org
> Subject: Re: soap header in axis2
>
> Amit
>
> I haven't figured out the problem yet! I don't see anything obvious
> with your axis2.xml.
>
> What happens if you try with the standard axis2.xml? Normally for a
> client, I would use the standard axis2.xml and then add
> ServiceClient.engageModule("rampart") in my code.
>
> Paul
>
> On 12/29/06, Amit G Soni <Am...@mphasis.com> wrote:
> > Hi Paul,
> >
> > I am trying rampart with version 1.0 but it gives me following error
> > along with the mail I am also attaching the client code and
axis2.xml
> >
> >      [java] org.apache.axis2.deployment.DeploymentException: Invalid
> > phases please recheck axis2.xml {0} for the handler {1}; nested
> > exception is:
> >      [java]     org.apache.axis2.deployment.DeploymentException:
> Invalid
> > phases please recheck axis2.xml {0} for the handler {1}
> >      [java]     at
> >
>
org.apache.axis2.deployment.DeploymentEngine.loadRepository(DeploymentEn
> > gine.java:117)
> >      [java]     at
> >
>
org.apache.axis2.deployment.FileSystemConfigurator.getAxisConfiguration(
> > FileSystemConfigurator.java:120)
> >      [java]     at
> >
>
org.apache.axis2.context.ConfigurationContextFactory.createConfiguration
> > Context(ConfigurationContextFactory.java:38)
> >      [java]     at
> >
>
org.apache.axis2.context.ConfigurationContextFactory.createConfiguration
> > ContextFromFileSystem(ConfigurationContextFactory.java:90)
> >      [java]     at com.test.TestClient.main(TestClient.java:18)
> >      [java]     at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native
> > Method)
> >      [java]     at
> >
>
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
> > a:39)
> >      [java]     at
> >
>
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
> > Impl.java:25)
> >      [java]     at java.lang.reflect.Method.invoke(Method.java:324)
> >      [java]     at
> > org.apache.tools.ant.taskdefs.ExecuteJava.run(ExecuteJava.java:217)
> >      [java]     at
> >
>
org.apache.tools.ant.taskdefs.ExecuteJava.execute(ExecuteJava.java:152)
> >      [java]     at
> org.apache.tools.ant.taskdefs.Java.run(Java.java:745)
> >      [java]     at
> > org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:199)
> >      [java]     at
> > org.apache.tools.ant.taskdefs.Java.execute(Java.java:102)
> >      [java]     at
> > org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
> >      [java]     at
sun.reflect.NativeMethodAccessorImpl.invoke0(Native
> > Method)
> >      [java]     at
> >
>
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
> > a:39)
> >      [java]     at
> >
>
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
> > Impl.java:25)
> >      [java]     at java.lang.reflect.Method.invoke(Method.java:324)
> >      [java]     at
> >
>
org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:1
> > 05)
> >      [java]     at org.apache.tools.ant.Task.perform(Task.java:342)
> >      [java]     at
> org.apache.tools.ant.Target.execute(Target.java:357)
> >      [java]     at
> > org.apache.tools.ant.Target.performTasks(Target.java:385)
> >      [java]     at
> > org.apache.tools.ant.Project.executeSortedTargets(Project.java:1292)
> >      [java]     at
> > org.apache.tools.ant.Project.executeTarget(Project.java:1261)
> >      [java]     at
> >
>
org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecut
> > or.java:41)
> >      [java]     at
> > org.apache.tools.ant.Project.executeTargets(Project.java:1144)
> >      [java]     at org.apache.tools.ant.Main.runBuild(Main.java:698)
> >      [java]     at org.apache.tools.ant.Main.startAnt(Main.java:199)
> >      [java]     at
> > org.apache.tools.ant.launch.Launcher.run(Launcher.java:298)
> >      [java]     at
> > org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)
> >      [java] Caused by:
> org.apache.axis2.deployment.DeploymentException:
> > Invalid phases please recheck axis2.xml {0} for the handler {1}
> >      [java]     at
> >
>
org.apache.axis2.deployment.util.PhasesInfo.getGlobalInflow(PhasesInfo.j
> > ava:111)
> >      [java]     at
> >
>
org.apache.axis2.deployment.DeploymentEngine.validateSystemPredefinedPha
> > ses(DeploymentEngine.java:817)
> >      [java]     at
> >
>
org.apache.axis2.deployment.DeploymentEngine.loadRepository(DeploymentEn
> > gine.java:115)
> >      [java]     ... 30 more
> >      [java] __________________1
> >
> > Thanks,
> > Amit Soni
> >
> > -----Original Message-----
> > From: Paul Fremantle [mailto:pzfreo@gmail.com]
> > Sent: Thursday, December 28, 2006 8:45 PM
> > To: axis-user@ws.apache.org
> > Subject: Re: soap header in axis2
> >
> > Amit
> >
> > You seem to have cut out the phases from axis2.xml. The config needs
> > the phases defined. That is how it figures out how to interleave the
> > security handlers. If you take the standard axis2.xml and add those
> > lines:
> > <module ref="rampart" />
> >         <parameter name="OutflowSecurity">
> >         <action>
> >                 <items>UsernameToken Timestamp</items>
> >                 <user>wfws</user>
> >
> > <passwordCallbackClass>com.test.PWCallback</passwordCallbackClass>
> >         </action>
> >     </parameter>
> >
> > Paul
> >
> > On 12/28/06, Amit G Soni <Am...@mphasis.com> wrote:
> > > Hi Paul,
> > >
> > > Thanks a lot for all of your help.
> > >
> > > I have executed the same wsdl with axis-1.4 successfully but in
> axis2
> > it
> > > gives these error. I between I have downloaded the rampart-1.0.mar
> > file
> > > but when I am running following line of code it gives me
exception.
> > >
> > > ConfigurationContext context = ConfigurationContextFactory
> > > .createConfigurationContextFromFileSystem(
> > > "resources", "resources/axis2.xml");
> > >
> > >
> > > log4j:WARN No appenders could be found for logger
> > > (org.apache.axiom.om.impl.builder.StAXOMBuilder).
> > > log4j:WARN Please initialize the log4j system properly.
> > > org.apache.axis2.deployment.DeploymentException: Invalid phases
> please
> > > recheck axis2.xml {0} for the handler {1}; nested exception is:
> > >         org.apache.axis2.deployment.DeploymentException: Invalid
> > phases
> > > please recheck axis2.xml {0} for the handler {1}
> > >         at
> > >
> >
>
org.apache.axis2.deployment.DeploymentEngine.loadRepository(DeploymentEn
> > > gine.java:117)
> > >         at
> > >
> >
>
org.apache.axis2.deployment.FileSystemConfigurator.getAxisConfiguration(
> > > FileSystemConfigurator.java:120)
> > >         at
> > >
> >
>
org.apache.axis2.context.ConfigurationContextFactory.createConfiguration
> > > Context(ConfigurationContextFactory.java:38)
> > >         at
> > >
> >
>
org.apache.axis2.context.ConfigurationContextFactory.createConfiguration
> > > ContextFromFileSystem(ConfigurationContextFactory.java:90)
> > >         at com.test.TestClient.main(TestClient.java:15)
> > > Caused by: org.apache.axis2.deployment.DeploymentException:
Invalid
> > > phases please recheck axis2.xml {0} for the handler {1}
> > >         at
> > >
> >
>
org.apache.axis2.deployment.util.PhasesInfo.getGlobalInflow(PhasesInfo.j
> > > ava:111)
> > >         at
> > >
> >
>
org.apache.axis2.deployment.DeploymentEngine.validateSystemPredefinedPha
> > > ses(DeploymentEngine.java:817)
> > >         at
> > >
> >
>
org.apache.axis2.deployment.DeploymentEngine.loadRepository(DeploymentEn
> > > gine.java:115)
> > >         ... 4 more
> > > Exception in thread "main"
> > >
> > > I have attached the axis2.xml file along with this also.
> > >
> > > Thanks,
> > > Amit Soni
> > >
> > > -----Original Message-----
> > > From: Paul Fremantle [mailto:pzfreo@gmail.com]
> > > Sent: Thursday, December 28, 2006 8:01 PM
> > > To: axis-user@ws.apache.org
> > > Subject: Re: soap header in axis2
> > >
> > > Amit
> > >
> > > You seem to have found a bug in the WSDL2Java toolkit. I can't see
> > > anything obviously wrong with your WSDL, and it validates with
both
> > > Eclipse and Axis1.4. Can you please raise a JIRA including your
> > > WSDL/XSDs as an attachment?
> > >
> > > Here is the link to rampart1.0 in the meantime:
> > >
> http://apache.rmplc.co.uk/ws/axis2/modules/rampart/1_0/rampart-1.0.mar
> > >
> > > Paul
> > >
> > > On 12/28/06, Amit G Soni <Am...@mphasis.com> wrote:
> > > > Hi Paul,
> > > >
> > > > I am trying to find rampath-1.0 but I am not able to fine any
link
> > > from
> > > > which version 1.0 I can download.
> > > >
> > > > But after that I am trying the same with Axis2-1.1
> > > >
> > > > But in this case it gives me following exception.
> > > >
> > > > C:\axis211>wsdl2java -uri c:\test\CardholderService.wsdl -p
> com.test
> > > -d
> > > > none
> > > > Using AXIS2_HOME:   C:\Java\axis2-1.1
> > > > Using JAVA_HOME:    C:\Java\j2sdk1.4.2_13
> > > > Retrieving schema at 'CardholderData.xsd', relative to
> > > 'file:/c:/test/'.
> > > > Retrieving schema at 'CardholderMessages.xsd', relative to
> > > > 'file:/c:/test/'.
> > > > Retrieving schema at 'CardholderData.xsd', relative to
> > > > 'file:/c:/test/CardholderMessages.xsd'.
> > > > Retrieving schema at 'OperationResults.xsd', relative to
> > > > 'file:/c:/test/CardholderMessages.xsd'.
> > > > Retrieving schema at 'OperationResults.xsd', relative to
> > > > 'file:/c:/test/'.
> > > > Dec 28, 2006 7:10:25 PM
> > > > org.apache.axis2.description.WSDL11ToAxisServiceBuilder
> > > populateService
> > > > SEVERE: java.lang.NullPointerException
> > > > Exception in thread "main"
> > > > org.apache.axis2.wsdl.codegen.CodeGenerationException: Error
> parsing
> > > > WSDL
> > > >         at
> > > >
> > >
> >
>
org.apache.axis2.wsdl.codegen.CodeGenerationEngine.<init>(CodeGeneration
> > > > Engine.java:112)
> > > >         at
org.apache.axis2.wsdl.WSDL2Code.main(WSDL2Code.java:32)
> > > >         at
org.apache.axis2.wsdl.WSDL2Java.main(WSDL2Java.java:21)
> > > > Caused by: org.apache.axis2.AxisFault: null; nested exception
is:
> > > >         java.lang.NullPointerException
> > > >         at
> > > >
> > >
> >
>
org.apache.axis2.description.WSDL11ToAxisServiceBuilder.populateService(
> > > > WSDL11ToAxisServiceBuilder.java:250)
> > > >         at
> > > >
> > >
> >
>
org.apache.axis2.wsdl.codegen.CodeGenerationEngine.<init>(CodeGeneration
> > > > Engine.java:103)
> > > >         ... 2 more
> > > > Caused by: java.lang.NullPointerException
> > > >         at
> > > >
> > >
> >
>
org.apache.axis2.description.WSDL11ToAxisServiceBuilder.populateService(
> > > > WSDL11ToAxisServiceBuilder.java:235)
> > > >         ... 3 more
> > > >
> > > > Can you have any idea why it is happens.
> > > >
> > > > I am also attaching my wsdl file along with the mail.
> > > >
> > > > Thanks,
> > > > Amit Soni
> > > >
> > > >
> > > > -----Original Message-----
> > > > From: Paul Fremantle [mailto:pzfreo@gmail.com]
> > > > Sent: Thursday, December 28, 2006 6:30 PM
> > > > To: axis-user@ws.apache.org
> > > > Subject: Re: soap header in axis2
> > > >
> > > > Amit
> > > >
> > > > No, rampart 1.1 is expected to be used with Axis2 1.1.
> > > >
> > > > If you can move to 1.1 you should, because of the large number
of
> > bugs
> > > > fixed!
> > > >
> > > > Otherwise there is rampart1.0 available.
> > > >
> > > > Paul
> > > >
> > > > On 12/28/06, Amit G Soni <Am...@mphasis.com> wrote:
> > > > > 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:pzfreo@gmail.com]
> > > > > Sent: Thursday, December 28, 2006 4:17 PM
> > > > > To: axis-user@ws.apache.org
> > > > > 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 <Am...@mphasis.com> 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
> > > > > paul@wso2.com
> > > > >
> > > > > "Oxygenating the Web Service Platform", www.wso2.com
> > > > >
> > > > >
> > >
> ---------------------------------------------------------------------
> > > > > 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
> > > > >
> > > > >
> > > >
> > > >
> > > > --
> > > > Paul Fremantle
> > > > VP/Technology, WSO2 and OASIS WS-RX TC Co-chair
> > > >
> > > > http://bloglines.com/blog/paulfremantle
> > > > paul@wso2.com
> > > >
> > > > "Oxygenating the Web Service Platform", www.wso2.com
> > > >
> > > >
> >
---------------------------------------------------------------------
> > > > 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
> > > >
> > > >
> > > >
> > >
> > >
> > > --
> > > Paul Fremantle
> > > VP/Technology, WSO2 and OASIS WS-RX TC Co-chair
> > >
> > > http://bloglines.com/blog/paulfremantle
> > > paul@wso2.com
> > >
> > > "Oxygenating the Web Service Platform", www.wso2.com
> > >
> > >
> ---------------------------------------------------------------------
> > > 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
> > >
> > >
> > >
> >
> >
> > --
> > Paul Fremantle
> > VP/Technology, WSO2 and OASIS WS-RX TC Co-chair
> >
> > http://bloglines.com/blog/paulfremantle
> > paul@wso2.com
> >
> > "Oxygenating the Web Service Platform", www.wso2.com
> >
> >
---------------------------------------------------------------------
> > 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
> >
> >
> >
>
>
> --
> Paul Fremantle
> VP/Technology, WSO2 and OASIS WS-RX TC Co-chair
>
> http://bloglines.com/blog/paulfremantle
> paul@wso2.com
>
> "Oxygenating the Web Service Platform", www.wso2.com
>
> ---------------------------------------------------------------------
> 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
>
>


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

http://bloglines.com/blog/paulfremantle
paul@wso2.com

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

---------------------------------------------------------------------
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: soap header in axis2

Posted by Paul Fremantle <pz...@gmail.com>.
Amit

I don't believe that you need the actor - next tag. That simply
indicates that whoever reads the header first must act upon it.
However, almost all soap systems will behave like that.

Having a mustUnderstand tag is more important. Of course if you are
targeting a system that DOES understand WS-Addressing this will make
no difference. The difference will come if you send the message to a
system that doesn't understand WS-A. In that case it will not fail,
whereas with mustUnderstand='1' it should.

By the way mustUnderstand='0' can be left off as that is the default.

Unfortunately, I don't believe there is any way of forcing
mustUnderstand on in the current Axis2 Addressing module. I will raise
a JIRA.

If the server you are using does support WS-Addressing then you can
safely leave off those attributes. Can I suggest you try it.

If you really need a workaround, we can probably code up a handler
that will fix up the headers for you.

Paul





On 1/2/07, Amit G Soni <Am...@mphasis.com> wrote:
> Hi Paul,
>
> I am able to send a request with wsse and wsa header parameter. Within
> which wsse header tag is ok but in wsa:action and wsa:to tag I need to
> include namespace (xmlns) and some more attributes. So the original
> request of soap header is looks like:
>
> <wsa:To>urn:EvolutionBenefits:Services:V1:CardholderService</wsa:To>
>
> <wsa:Action>
>         http://services.bennycentral.com/Cardholder/v1:helloWorldIn
> </wsa:Action>
>
> But within wsa:To and wsa:Action I need to add some attribute. So which
> is looks like:
>
> <wsa:To xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/03/addressing"
> soapenv:actor="http://schemas.xmlsoap.org/soap/actor/next"
> soapenv:mustUnderstand="1">
>           urn:EvolutionBenefits:Services:V1:CardholderService
> </wsa:To>
>
> <wsa:Action xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/03/addressing"
>
>             soapenv:actor="http://schemas.xmlsoap.org/soap/actor/next"
>               soapenv:mustUnderstand="0">
>         http://services.bennycentral.com/Cardholder/v1:helloWorldIn
> </wsa:Action>
>
>
> So basically I want to include some of the attributes in wsa:Action and
> wsa:To tags. So if you have some idea regarding this then please let me
> know.
>
> Thanks,
> Amit Soni
>
> -----Original Message-----
> From: Paul Fremantle [mailto:pzfreo@gmail.com]
> Sent: Saturday, December 30, 2006 4:17 PM
> To: axis-user@ws.apache.org
> Subject: Re: soap header in axis2
>
> Amit
>
> I haven't figured out the problem yet! I don't see anything obvious
> with your axis2.xml.
>
> What happens if you try with the standard axis2.xml? Normally for a
> client, I would use the standard axis2.xml and then add
> ServiceClient.engageModule("rampart") in my code.
>
> Paul
>
> On 12/29/06, Amit G Soni <Am...@mphasis.com> wrote:
> > Hi Paul,
> >
> > I am trying rampart with version 1.0 but it gives me following error
> > along with the mail I am also attaching the client code and axis2.xml
> >
> >      [java] org.apache.axis2.deployment.DeploymentException: Invalid
> > phases please recheck axis2.xml {0} for the handler {1}; nested
> > exception is:
> >      [java]     org.apache.axis2.deployment.DeploymentException:
> Invalid
> > phases please recheck axis2.xml {0} for the handler {1}
> >      [java]     at
> >
> org.apache.axis2.deployment.DeploymentEngine.loadRepository(DeploymentEn
> > gine.java:117)
> >      [java]     at
> >
> org.apache.axis2.deployment.FileSystemConfigurator.getAxisConfiguration(
> > FileSystemConfigurator.java:120)
> >      [java]     at
> >
> org.apache.axis2.context.ConfigurationContextFactory.createConfiguration
> > Context(ConfigurationContextFactory.java:38)
> >      [java]     at
> >
> org.apache.axis2.context.ConfigurationContextFactory.createConfiguration
> > ContextFromFileSystem(ConfigurationContextFactory.java:90)
> >      [java]     at com.test.TestClient.main(TestClient.java:18)
> >      [java]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
> > Method)
> >      [java]     at
> >
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
> > a:39)
> >      [java]     at
> >
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
> > Impl.java:25)
> >      [java]     at java.lang.reflect.Method.invoke(Method.java:324)
> >      [java]     at
> > org.apache.tools.ant.taskdefs.ExecuteJava.run(ExecuteJava.java:217)
> >      [java]     at
> >
> org.apache.tools.ant.taskdefs.ExecuteJava.execute(ExecuteJava.java:152)
> >      [java]     at
> org.apache.tools.ant.taskdefs.Java.run(Java.java:745)
> >      [java]     at
> > org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:199)
> >      [java]     at
> > org.apache.tools.ant.taskdefs.Java.execute(Java.java:102)
> >      [java]     at
> > org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
> >      [java]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
> > Method)
> >      [java]     at
> >
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
> > a:39)
> >      [java]     at
> >
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
> > Impl.java:25)
> >      [java]     at java.lang.reflect.Method.invoke(Method.java:324)
> >      [java]     at
> >
> org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:1
> > 05)
> >      [java]     at org.apache.tools.ant.Task.perform(Task.java:342)
> >      [java]     at
> org.apache.tools.ant.Target.execute(Target.java:357)
> >      [java]     at
> > org.apache.tools.ant.Target.performTasks(Target.java:385)
> >      [java]     at
> > org.apache.tools.ant.Project.executeSortedTargets(Project.java:1292)
> >      [java]     at
> > org.apache.tools.ant.Project.executeTarget(Project.java:1261)
> >      [java]     at
> >
> org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecut
> > or.java:41)
> >      [java]     at
> > org.apache.tools.ant.Project.executeTargets(Project.java:1144)
> >      [java]     at org.apache.tools.ant.Main.runBuild(Main.java:698)
> >      [java]     at org.apache.tools.ant.Main.startAnt(Main.java:199)
> >      [java]     at
> > org.apache.tools.ant.launch.Launcher.run(Launcher.java:298)
> >      [java]     at
> > org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)
> >      [java] Caused by:
> org.apache.axis2.deployment.DeploymentException:
> > Invalid phases please recheck axis2.xml {0} for the handler {1}
> >      [java]     at
> >
> org.apache.axis2.deployment.util.PhasesInfo.getGlobalInflow(PhasesInfo.j
> > ava:111)
> >      [java]     at
> >
> org.apache.axis2.deployment.DeploymentEngine.validateSystemPredefinedPha
> > ses(DeploymentEngine.java:817)
> >      [java]     at
> >
> org.apache.axis2.deployment.DeploymentEngine.loadRepository(DeploymentEn
> > gine.java:115)
> >      [java]     ... 30 more
> >      [java] __________________1
> >
> > Thanks,
> > Amit Soni
> >
> > -----Original Message-----
> > From: Paul Fremantle [mailto:pzfreo@gmail.com]
> > Sent: Thursday, December 28, 2006 8:45 PM
> > To: axis-user@ws.apache.org
> > Subject: Re: soap header in axis2
> >
> > Amit
> >
> > You seem to have cut out the phases from axis2.xml. The config needs
> > the phases defined. That is how it figures out how to interleave the
> > security handlers. If you take the standard axis2.xml and add those
> > lines:
> > <module ref="rampart" />
> >         <parameter name="OutflowSecurity">
> >         <action>
> >                 <items>UsernameToken Timestamp</items>
> >                 <user>wfws</user>
> >
> > <passwordCallbackClass>com.test.PWCallback</passwordCallbackClass>
> >         </action>
> >     </parameter>
> >
> > Paul
> >
> > On 12/28/06, Amit G Soni <Am...@mphasis.com> wrote:
> > > Hi Paul,
> > >
> > > Thanks a lot for all of your help.
> > >
> > > I have executed the same wsdl with axis-1.4 successfully but in
> axis2
> > it
> > > gives these error. I between I have downloaded the rampart-1.0.mar
> > file
> > > but when I am running following line of code it gives me exception.
> > >
> > > ConfigurationContext context = ConfigurationContextFactory
> > > .createConfigurationContextFromFileSystem(
> > > "resources", "resources/axis2.xml");
> > >
> > >
> > > log4j:WARN No appenders could be found for logger
> > > (org.apache.axiom.om.impl.builder.StAXOMBuilder).
> > > log4j:WARN Please initialize the log4j system properly.
> > > org.apache.axis2.deployment.DeploymentException: Invalid phases
> please
> > > recheck axis2.xml {0} for the handler {1}; nested exception is:
> > >         org.apache.axis2.deployment.DeploymentException: Invalid
> > phases
> > > please recheck axis2.xml {0} for the handler {1}
> > >         at
> > >
> >
> org.apache.axis2.deployment.DeploymentEngine.loadRepository(DeploymentEn
> > > gine.java:117)
> > >         at
> > >
> >
> org.apache.axis2.deployment.FileSystemConfigurator.getAxisConfiguration(
> > > FileSystemConfigurator.java:120)
> > >         at
> > >
> >
> org.apache.axis2.context.ConfigurationContextFactory.createConfiguration
> > > Context(ConfigurationContextFactory.java:38)
> > >         at
> > >
> >
> org.apache.axis2.context.ConfigurationContextFactory.createConfiguration
> > > ContextFromFileSystem(ConfigurationContextFactory.java:90)
> > >         at com.test.TestClient.main(TestClient.java:15)
> > > Caused by: org.apache.axis2.deployment.DeploymentException: Invalid
> > > phases please recheck axis2.xml {0} for the handler {1}
> > >         at
> > >
> >
> org.apache.axis2.deployment.util.PhasesInfo.getGlobalInflow(PhasesInfo.j
> > > ava:111)
> > >         at
> > >
> >
> org.apache.axis2.deployment.DeploymentEngine.validateSystemPredefinedPha
> > > ses(DeploymentEngine.java:817)
> > >         at
> > >
> >
> org.apache.axis2.deployment.DeploymentEngine.loadRepository(DeploymentEn
> > > gine.java:115)
> > >         ... 4 more
> > > Exception in thread "main"
> > >
> > > I have attached the axis2.xml file along with this also.
> > >
> > > Thanks,
> > > Amit Soni
> > >
> > > -----Original Message-----
> > > From: Paul Fremantle [mailto:pzfreo@gmail.com]
> > > Sent: Thursday, December 28, 2006 8:01 PM
> > > To: axis-user@ws.apache.org
> > > Subject: Re: soap header in axis2
> > >
> > > Amit
> > >
> > > You seem to have found a bug in the WSDL2Java toolkit. I can't see
> > > anything obviously wrong with your WSDL, and it validates with both
> > > Eclipse and Axis1.4. Can you please raise a JIRA including your
> > > WSDL/XSDs as an attachment?
> > >
> > > Here is the link to rampart1.0 in the meantime:
> > >
> http://apache.rmplc.co.uk/ws/axis2/modules/rampart/1_0/rampart-1.0.mar
> > >
> > > Paul
> > >
> > > On 12/28/06, Amit G Soni <Am...@mphasis.com> wrote:
> > > > Hi Paul,
> > > >
> > > > I am trying to find rampath-1.0 but I am not able to fine any link
> > > from
> > > > which version 1.0 I can download.
> > > >
> > > > But after that I am trying the same with Axis2-1.1
> > > >
> > > > But in this case it gives me following exception.
> > > >
> > > > C:\axis211>wsdl2java -uri c:\test\CardholderService.wsdl -p
> com.test
> > > -d
> > > > none
> > > > Using AXIS2_HOME:   C:\Java\axis2-1.1
> > > > Using JAVA_HOME:    C:\Java\j2sdk1.4.2_13
> > > > Retrieving schema at 'CardholderData.xsd', relative to
> > > 'file:/c:/test/'.
> > > > Retrieving schema at 'CardholderMessages.xsd', relative to
> > > > 'file:/c:/test/'.
> > > > Retrieving schema at 'CardholderData.xsd', relative to
> > > > 'file:/c:/test/CardholderMessages.xsd'.
> > > > Retrieving schema at 'OperationResults.xsd', relative to
> > > > 'file:/c:/test/CardholderMessages.xsd'.
> > > > Retrieving schema at 'OperationResults.xsd', relative to
> > > > 'file:/c:/test/'.
> > > > Dec 28, 2006 7:10:25 PM
> > > > org.apache.axis2.description.WSDL11ToAxisServiceBuilder
> > > populateService
> > > > SEVERE: java.lang.NullPointerException
> > > > Exception in thread "main"
> > > > org.apache.axis2.wsdl.codegen.CodeGenerationException: Error
> parsing
> > > > WSDL
> > > >         at
> > > >
> > >
> >
> org.apache.axis2.wsdl.codegen.CodeGenerationEngine.<init>(CodeGeneration
> > > > Engine.java:112)
> > > >         at org.apache.axis2.wsdl.WSDL2Code.main(WSDL2Code.java:32)
> > > >         at org.apache.axis2.wsdl.WSDL2Java.main(WSDL2Java.java:21)
> > > > Caused by: org.apache.axis2.AxisFault: null; nested exception is:
> > > >         java.lang.NullPointerException
> > > >         at
> > > >
> > >
> >
> org.apache.axis2.description.WSDL11ToAxisServiceBuilder.populateService(
> > > > WSDL11ToAxisServiceBuilder.java:250)
> > > >         at
> > > >
> > >
> >
> org.apache.axis2.wsdl.codegen.CodeGenerationEngine.<init>(CodeGeneration
> > > > Engine.java:103)
> > > >         ... 2 more
> > > > Caused by: java.lang.NullPointerException
> > > >         at
> > > >
> > >
> >
> org.apache.axis2.description.WSDL11ToAxisServiceBuilder.populateService(
> > > > WSDL11ToAxisServiceBuilder.java:235)
> > > >         ... 3 more
> > > >
> > > > Can you have any idea why it is happens.
> > > >
> > > > I am also attaching my wsdl file along with the mail.
> > > >
> > > > Thanks,
> > > > Amit Soni
> > > >
> > > >
> > > > -----Original Message-----
> > > > From: Paul Fremantle [mailto:pzfreo@gmail.com]
> > > > Sent: Thursday, December 28, 2006 6:30 PM
> > > > To: axis-user@ws.apache.org
> > > > Subject: Re: soap header in axis2
> > > >
> > > > Amit
> > > >
> > > > No, rampart 1.1 is expected to be used with Axis2 1.1.
> > > >
> > > > If you can move to 1.1 you should, because of the large number of
> > bugs
> > > > fixed!
> > > >
> > > > Otherwise there is rampart1.0 available.
> > > >
> > > > Paul
> > > >
> > > > On 12/28/06, Amit G Soni <Am...@mphasis.com> wrote:
> > > > > 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:pzfreo@gmail.com]
> > > > > Sent: Thursday, December 28, 2006 4:17 PM
> > > > > To: axis-user@ws.apache.org
> > > > > 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 <Am...@mphasis.com> 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
> > > > > paul@wso2.com
> > > > >
> > > > > "Oxygenating the Web Service Platform", www.wso2.com
> > > > >
> > > > >
> > >
> ---------------------------------------------------------------------
> > > > > 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
> > > > >
> > > > >
> > > >
> > > >
> > > > --
> > > > Paul Fremantle
> > > > VP/Technology, WSO2 and OASIS WS-RX TC Co-chair
> > > >
> > > > http://bloglines.com/blog/paulfremantle
> > > > paul@wso2.com
> > > >
> > > > "Oxygenating the Web Service Platform", www.wso2.com
> > > >
> > > >
> > ---------------------------------------------------------------------
> > > > 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
> > > >
> > > >
> > > >
> > >
> > >
> > > --
> > > Paul Fremantle
> > > VP/Technology, WSO2 and OASIS WS-RX TC Co-chair
> > >
> > > http://bloglines.com/blog/paulfremantle
> > > paul@wso2.com
> > >
> > > "Oxygenating the Web Service Platform", www.wso2.com
> > >
> > >
> ---------------------------------------------------------------------
> > > 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
> > >
> > >
> > >
> >
> >
> > --
> > Paul Fremantle
> > VP/Technology, WSO2 and OASIS WS-RX TC Co-chair
> >
> > http://bloglines.com/blog/paulfremantle
> > paul@wso2.com
> >
> > "Oxygenating the Web Service Platform", www.wso2.com
> >
> > ---------------------------------------------------------------------
> > 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
> >
> >
> >
>
>
> --
> Paul Fremantle
> VP/Technology, WSO2 and OASIS WS-RX TC Co-chair
>
> http://bloglines.com/blog/paulfremantle
> paul@wso2.com
>
> "Oxygenating the Web Service Platform", www.wso2.com
>
> ---------------------------------------------------------------------
> 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
>
>


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

http://bloglines.com/blog/paulfremantle
paul@wso2.com

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

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


Re: soap header in axis2

Posted by Martin Gainty <mg...@hotmail.com>.
I looked at the source and this is what I see in org.apache.axis2.deployment.PhasesInfo.java

    public ArrayList getOperationInPhases() throws DeploymentException 
    {
        ArrayList operationINPhases = new ArrayList();
        
        boolean foundDispathPhase = false; //WARNING this is FALSE!!!
        
        for (int i = 0; i < INPhases.size(); i++) 
        {
            Phase phase = (Phase) INPhases.get(i);
            
            String phaseName = phase.getPhaseName();

//Premature Test???            
            if (foundDispathPhase) {
                operationINPhases.add(copyPhase(phase));
            }
//Now we set this to true why not before when we needed to add it??
            if (PhaseMetadata.PHASE_DISPATCH.equals(phaseName)) {
                foundDispathPhase = true;
            }
        }
        return operationINPhases;
    }

Should'nt we TEST the phaseName for Dispatch and IF this was true ADD the copyPhase of the INPhases.get(i) right there and then

M-
--------------------------------------------------------------------------- 
This e-mail message (including attachments, if any) is intended for the use of the individual or entity to which it is addressed and may contain information that is privileged, proprietary , confidential and exempt from disclosure. If you are not the intended recipient, you are notified that any dissemination, distribution or copying of this communication is strictly prohibited.
--------------------------------------------------------------------------- 
Le présent message électronique (y compris les pièces qui y sont annexées, le cas échéant) s'adresse au destinataire indiqué et peut contenir des renseignements de caractère privé ou confidentiel. Si vous n'êtes pas le destinataire de ce document, nous vous signalons qu'il est strictement interdit de le diffuser, de le distribuer ou de le reproduire.
----- Original Message ----- 
From: "Martin Gainty" <mg...@hotmail.com>
To: <ax...@ws.apache.org>
Sent: Saturday, December 30, 2006 10:25 AM
Subject: Re: soap header in axis2


> Paul-
> 
> Im getting that same error with Axis2 v1.1
> I need to determine if bug fix 
> AXIS2-1290 
> was rolled into the distros..
> 
> M-
> --------------------------------------------------------------------------- 
> This e-mail message (including attachments, if any) is intended for the use of the individual or entity to which it is addressed and may contain information that is privileged, proprietary , confidential and exempt from disclosure. If you are not the intended recipient, you are notified that any dissemination, distribution or copying of this communication is strictly prohibited.
> --------------------------------------------------------------------------- 
> Le présent message électronique (y compris les pièces qui y sont annexées, le cas échéant) s'adresse au destinataire indiqué et peut contenir des renseignements de caractère privé ou confidentiel. Si vous n'êtes pas le destinataire de ce document, nous vous signalons qu'il est strictement interdit de le diffuser, de le distribuer ou de le reproduire.
> ----- Original Message ----- 
> From: "Paul Fremantle" <pz...@gmail.com>
> To: <ax...@ws.apache.org>
> Sent: Saturday, December 30, 2006 5:47 AM
> Subject: Re: soap header in axis2
> 
> 
>> Amit
>> 
>> I haven't figured out the problem yet! I don't see anything obvious
>> with your axis2.xml.
>> 
>> What happens if you try with the standard axis2.xml? Normally for a
>> client, I would use the standard axis2.xml and then add
>> ServiceClient.engageModule("rampart") in my code.
>> 
>> Paul
>> 
>> On 12/29/06, Amit G Soni <Am...@mphasis.com> wrote:
>>> Hi Paul,
>>>
>>> I am trying rampart with version 1.0 but it gives me following error
>>> along with the mail I am also attaching the client code and axis2.xml
>>>
>>>      [java] org.apache.axis2.deployment.DeploymentException: Invalid
>>> phases please recheck axis2.xml {0} for the handler {1}; nested
>>> exception is:
>>>      [java]     org.apache.axis2.deployment.DeploymentException: Invalid
>>> phases please recheck axis2.xml {0} for the handler {1}
>>>      [java]     at
>>> org.apache.axis2.deployment.DeploymentEngine.loadRepository(DeploymentEn
>>> gine.java:117)
>>>      [java]     at
>>> org.apache.axis2.deployment.FileSystemConfigurator.getAxisConfiguration(
>>> FileSystemConfigurator.java:120)
>>>      [java]     at
>>> org.apache.axis2.context.ConfigurationContextFactory.createConfiguration
>>> Context(ConfigurationContextFactory.java:38)
>>>      [java]     at
>>> org.apache.axis2.context.ConfigurationContextFactory.createConfiguration
>>> ContextFromFileSystem(ConfigurationContextFactory.java:90)
>>>      [java]     at com.test.TestClient.main(TestClient.java:18)
>>>      [java]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
>>> Method)
>>>      [java]     at
>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
>>> a:39)
>>>      [java]     at
>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
>>> Impl.java:25)
>>>      [java]     at java.lang.reflect.Method.invoke(Method.java:324)
>>>      [java]     at
>>> org.apache.tools.ant.taskdefs.ExecuteJava.run(ExecuteJava.java:217)
>>>      [java]     at
>>> org.apache.tools.ant.taskdefs.ExecuteJava.execute(ExecuteJava.java:152)
>>>      [java]     at org.apache.tools.ant.taskdefs.Java.run(Java.java:745)
>>>      [java]     at
>>> org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:199)
>>>      [java]     at
>>> org.apache.tools.ant.taskdefs.Java.execute(Java.java:102)
>>>      [java]     at
>>> org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
>>>      [java]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
>>> Method)
>>>      [java]     at
>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
>>> a:39)
>>>      [java]     at
>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
>>> Impl.java:25)
>>>      [java]     at java.lang.reflect.Method.invoke(Method.java:324)
>>>      [java]     at
>>> org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:1
>>> 05)
>>>      [java]     at org.apache.tools.ant.Task.perform(Task.java:342)
>>>      [java]     at org.apache.tools.ant.Target.execute(Target.java:357)
>>>      [java]     at
>>> org.apache.tools.ant.Target.performTasks(Target.java:385)
>>>      [java]     at
>>> org.apache.tools.ant.Project.executeSortedTargets(Project.java:1292)
>>>      [java]     at
>>> org.apache.tools.ant.Project.executeTarget(Project.java:1261)
>>>      [java]     at
>>> org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecut
>>> or.java:41)
>>>      [java]     at
>>> org.apache.tools.ant.Project.executeTargets(Project.java:1144)
>>>      [java]     at org.apache.tools.ant.Main.runBuild(Main.java:698)
>>>      [java]     at org.apache.tools.ant.Main.startAnt(Main.java:199)
>>>      [java]     at
>>> org.apache.tools.ant.launch.Launcher.run(Launcher.java:298)
>>>      [java]     at
>>> org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)
>>>      [java] Caused by: org.apache.axis2.deployment.DeploymentException:
>>> Invalid phases please recheck axis2.xml {0} for the handler {1}
>>>      [java]     at
>>> org.apache.axis2.deployment.util.PhasesInfo.getGlobalInflow(PhasesInfo.j
>>> ava:111)
>>>      [java]     at
>>> org.apache.axis2.deployment.DeploymentEngine.validateSystemPredefinedPha
>>> ses(DeploymentEngine.java:817)
>>>      [java]     at
>>> org.apache.axis2.deployment.DeploymentEngine.loadRepository(DeploymentEn
>>> gine.java:115)
>>>      [java]     ... 30 more
>>>      [java] __________________1
>>>
>>> Thanks,
>>> Amit Soni
>>>
>>> -----Original Message-----
>>> From: Paul Fremantle [mailto:pzfreo@gmail.com]
>>> Sent: Thursday, December 28, 2006 8:45 PM
>>> To: axis-user@ws.apache.org
>>> Subject: Re: soap header in axis2
>>>
>>> Amit
>>>
>>> You seem to have cut out the phases from axis2.xml. The config needs
>>> the phases defined. That is how it figures out how to interleave the
>>> security handlers. If you take the standard axis2.xml and add those
>>> lines:
>>> <module ref="rampart" />
>>>         <parameter name="OutflowSecurity">
>>>         <action>
>>>                 <items>UsernameToken Timestamp</items>
>>>                 <user>wfws</user>
>>>
>>> <passwordCallbackClass>com.test.PWCallback</passwordCallbackClass>
>>>         </action>
>>>     </parameter>
>>>
>>> Paul
>>>
>>> On 12/28/06, Amit G Soni <Am...@mphasis.com> wrote:
>>> > Hi Paul,
>>> >
>>> > Thanks a lot for all of your help.
>>> >
>>> > I have executed the same wsdl with axis-1.4 successfully but in axis2
>>> it
>>> > gives these error. I between I have downloaded the rampart-1.0.mar
>>> file
>>> > but when I am running following line of code it gives me exception.
>>> >
>>> > ConfigurationContext context = ConfigurationContextFactory
>>> > .createConfigurationContextFromFileSystem(
>>> > "resources", "resources/axis2.xml");
>>> >
>>> >
>>> > log4j:WARN No appenders could be found for logger
>>> > (org.apache.axiom.om.impl.builder.StAXOMBuilder).
>>> > log4j:WARN Please initialize the log4j system properly.
>>> > org.apache.axis2.deployment.DeploymentException: Invalid phases please
>>> > recheck axis2.xml {0} for the handler {1}; nested exception is:
>>> >         org.apache.axis2.deployment.DeploymentException: Invalid
>>> phases
>>> > please recheck axis2.xml {0} for the handler {1}
>>> >         at
>>> >
>>> org.apache.axis2.deployment.DeploymentEngine.loadRepository(DeploymentEn
>>> > gine.java:117)
>>> >         at
>>> >
>>> org.apache.axis2.deployment.FileSystemConfigurator.getAxisConfiguration(
>>> > FileSystemConfigurator.java:120)
>>> >         at
>>> >
>>> org.apache.axis2.context.ConfigurationContextFactory.createConfiguration
>>> > Context(ConfigurationContextFactory.java:38)
>>> >         at
>>> >
>>> org.apache.axis2.context.ConfigurationContextFactory.createConfiguration
>>> > ContextFromFileSystem(ConfigurationContextFactory.java:90)
>>> >         at com.test.TestClient.main(TestClient.java:15)
>>> > Caused by: org.apache.axis2.deployment.DeploymentException: Invalid
>>> > phases please recheck axis2.xml {0} for the handler {1}
>>> >         at
>>> >
>>> org.apache.axis2.deployment.util.PhasesInfo.getGlobalInflow(PhasesInfo.j
>>> > ava:111)
>>> >         at
>>> >
>>> org.apache.axis2.deployment.DeploymentEngine.validateSystemPredefinedPha
>>> > ses(DeploymentEngine.java:817)
>>> >         at
>>> >
>>> org.apache.axis2.deployment.DeploymentEngine.loadRepository(DeploymentEn
>>> > gine.java:115)
>>> >         ... 4 more
>>> > Exception in thread "main"
>>> >
>>> > I have attached the axis2.xml file along with this also.
>>> >
>>> > Thanks,
>>> > Amit Soni
>>> >
>>> > -----Original Message-----
>>> > From: Paul Fremantle [mailto:pzfreo@gmail.com]
>>> > Sent: Thursday, December 28, 2006 8:01 PM
>>> > To: axis-user@ws.apache.org
>>> > Subject: Re: soap header in axis2
>>> >
>>> > Amit
>>> >
>>> > You seem to have found a bug in the WSDL2Java toolkit. I can't see
>>> > anything obviously wrong with your WSDL, and it validates with both
>>> > Eclipse and Axis1.4. Can you please raise a JIRA including your
>>> > WSDL/XSDs as an attachment?
>>> >
>>> > Here is the link to rampart1.0 in the meantime:
>>> > http://apache.rmplc.co.uk/ws/axis2/modules/rampart/1_0/rampart-1.0.mar
>>> >
>>> > Paul
>>> >
>>> > On 12/28/06, Amit G Soni <Am...@mphasis.com> wrote:
>>> > > Hi Paul,
>>> > >
>>> > > I am trying to find rampath-1.0 but I am not able to fine any link
>>> > from
>>> > > which version 1.0 I can download.
>>> > >
>>> > > But after that I am trying the same with Axis2-1.1
>>> > >
>>> > > But in this case it gives me following exception.
>>> > >
>>> > > C:\axis211>wsdl2java -uri c:\test\CardholderService.wsdl -p com.test
>>> > -d
>>> > > none
>>> > > Using AXIS2_HOME:   C:\Java\axis2-1.1
>>> > > Using JAVA_HOME:    C:\Java\j2sdk1.4.2_13
>>> > > Retrieving schema at 'CardholderData.xsd', relative to
>>> > 'file:/c:/test/'.
>>> > > Retrieving schema at 'CardholderMessages.xsd', relative to
>>> > > 'file:/c:/test/'.
>>> > > Retrieving schema at 'CardholderData.xsd', relative to
>>> > > 'file:/c:/test/CardholderMessages.xsd'.
>>> > > Retrieving schema at 'OperationResults.xsd', relative to
>>> > > 'file:/c:/test/CardholderMessages.xsd'.
>>> > > Retrieving schema at 'OperationResults.xsd', relative to
>>> > > 'file:/c:/test/'.
>>> > > Dec 28, 2006 7:10:25 PM
>>> > > org.apache.axis2.description.WSDL11ToAxisServiceBuilder
>>> > populateService
>>> > > SEVERE: java.lang.NullPointerException
>>> > > Exception in thread "main"
>>> > > org.apache.axis2.wsdl.codegen.CodeGenerationException: Error parsing
>>> > > WSDL
>>> > >         at
>>> > >
>>> >
>>> org.apache.axis2.wsdl.codegen.CodeGenerationEngine.<init>(CodeGeneration
>>> > > Engine.java:112)
>>> > >         at org.apache.axis2.wsdl.WSDL2Code.main(WSDL2Code.java:32)
>>> > >         at org.apache.axis2.wsdl.WSDL2Java.main(WSDL2Java.java:21)
>>> > > Caused by: org.apache.axis2.AxisFault: null; nested exception is:
>>> > >         java.lang.NullPointerException
>>> > >         at
>>> > >
>>> >
>>> org.apache.axis2.description.WSDL11ToAxisServiceBuilder.populateService(
>>> > > WSDL11ToAxisServiceBuilder.java:250)
>>> > >         at
>>> > >
>>> >
>>> org.apache.axis2.wsdl.codegen.CodeGenerationEngine.<init>(CodeGeneration
>>> > > Engine.java:103)
>>> > >         ... 2 more
>>> > > Caused by: java.lang.NullPointerException
>>> > >         at
>>> > >
>>> >
>>> org.apache.axis2.description.WSDL11ToAxisServiceBuilder.populateService(
>>> > > WSDL11ToAxisServiceBuilder.java:235)
>>> > >         ... 3 more
>>> > >
>>> > > Can you have any idea why it is happens.
>>> > >
>>> > > I am also attaching my wsdl file along with the mail.
>>> > >
>>> > > Thanks,
>>> > > Amit Soni
>>> > >
>>> > >
>>> > > -----Original Message-----
>>> > > From: Paul Fremantle [mailto:pzfreo@gmail.com]
>>> > > Sent: Thursday, December 28, 2006 6:30 PM
>>> > > To: axis-user@ws.apache.org
>>> > > Subject: Re: soap header in axis2
>>> > >
>>> > > Amit
>>> > >
>>> > > No, rampart 1.1 is expected to be used with Axis2 1.1.
>>> > >
>>> > > If you can move to 1.1 you should, because of the large number of
>>> bugs
>>> > > fixed!
>>> > >
>>> > > Otherwise there is rampart1.0 available.
>>> > >
>>> > > Paul
>>> > >
>>> > > On 12/28/06, Amit G Soni <Am...@mphasis.com> wrote:
>>> > > > 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:pzfreo@gmail.com]
>>> > > > Sent: Thursday, December 28, 2006 4:17 PM
>>> > > > To: axis-user@ws.apache.org
>>> > > > 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 <Am...@mphasis.com> 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
>>> > > > paul@wso2.com
>>> > > >
>>> > > > "Oxygenating the Web Service Platform", www.wso2.com
>>> > > >
>>> > > >
>>> > ---------------------------------------------------------------------
>>> > > > 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
>>> > > >
>>> > > >
>>> > >
>>> > >
>>> > > --
>>> > > Paul Fremantle
>>> > > VP/Technology, WSO2 and OASIS WS-RX TC Co-chair
>>> > >
>>> > > http://bloglines.com/blog/paulfremantle
>>> > > paul@wso2.com
>>> > >
>>> > > "Oxygenating the Web Service Platform", www.wso2.com
>>> > >
>>> > >
>>> ---------------------------------------------------------------------
>>> > > 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
>>> > >
>>> > >
>>> > >
>>> >
>>> >
>>> > --
>>> > Paul Fremantle
>>> > VP/Technology, WSO2 and OASIS WS-RX TC Co-chair
>>> >
>>> > http://bloglines.com/blog/paulfremantle
>>> > paul@wso2.com
>>> >
>>> > "Oxygenating the Web Service Platform", www.wso2.com
>>> >
>>> > ---------------------------------------------------------------------
>>> > 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
>>> >
>>> >
>>> >
>>>
>>>
>>> --
>>> Paul Fremantle
>>> VP/Technology, WSO2 and OASIS WS-RX TC Co-chair
>>>
>>> http://bloglines.com/blog/paulfremantle
>>> paul@wso2.com
>>>
>>> "Oxygenating the Web Service Platform", www.wso2.com
>>>
>>> ---------------------------------------------------------------------
>>> 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
>>>
>>>
>>>
>> 
>> 
>> -- 
>> Paul Fremantle
>> VP/Technology, WSO2 and OASIS WS-RX TC Co-chair
>> 
>> http://bloglines.com/blog/paulfremantle
>> paul@wso2.com
>> 
>> "Oxygenating the Web Service Platform", www.wso2.com
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
>> For additional commands, e-mail: axis-user-help@ws.apache.org
>> 
>>

Re: soap header in axis2

Posted by Martin Gainty <mg...@hotmail.com>.
Paul-

Im getting that same error with Axis2 v1.1
I need to determine if bug fix 
AXIS2-1290 
was rolled into the distros..

M-
--------------------------------------------------------------------------- 
This e-mail message (including attachments, if any) is intended for the use of the individual or entity to which it is addressed and may contain information that is privileged, proprietary , confidential and exempt from disclosure. If you are not the intended recipient, you are notified that any dissemination, distribution or copying of this communication is strictly prohibited.
--------------------------------------------------------------------------- 
Le présent message électronique (y compris les pièces qui y sont annexées, le cas échéant) s'adresse au destinataire indiqué et peut contenir des renseignements de caractère privé ou confidentiel. Si vous n'êtes pas le destinataire de ce document, nous vous signalons qu'il est strictement interdit de le diffuser, de le distribuer ou de le reproduire.
----- Original Message ----- 
From: "Paul Fremantle" <pz...@gmail.com>
To: <ax...@ws.apache.org>
Sent: Saturday, December 30, 2006 5:47 AM
Subject: Re: soap header in axis2


> Amit
> 
> I haven't figured out the problem yet! I don't see anything obvious
> with your axis2.xml.
> 
> What happens if you try with the standard axis2.xml? Normally for a
> client, I would use the standard axis2.xml and then add
> ServiceClient.engageModule("rampart") in my code.
> 
> Paul
> 
> On 12/29/06, Amit G Soni <Am...@mphasis.com> wrote:
>> Hi Paul,
>>
>> I am trying rampart with version 1.0 but it gives me following error
>> along with the mail I am also attaching the client code and axis2.xml
>>
>>      [java] org.apache.axis2.deployment.DeploymentException: Invalid
>> phases please recheck axis2.xml {0} for the handler {1}; nested
>> exception is:
>>      [java]     org.apache.axis2.deployment.DeploymentException: Invalid
>> phases please recheck axis2.xml {0} for the handler {1}
>>      [java]     at
>> org.apache.axis2.deployment.DeploymentEngine.loadRepository(DeploymentEn
>> gine.java:117)
>>      [java]     at
>> org.apache.axis2.deployment.FileSystemConfigurator.getAxisConfiguration(
>> FileSystemConfigurator.java:120)
>>      [java]     at
>> org.apache.axis2.context.ConfigurationContextFactory.createConfiguration
>> Context(ConfigurationContextFactory.java:38)
>>      [java]     at
>> org.apache.axis2.context.ConfigurationContextFactory.createConfiguration
>> ContextFromFileSystem(ConfigurationContextFactory.java:90)
>>      [java]     at com.test.TestClient.main(TestClient.java:18)
>>      [java]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
>> Method)
>>      [java]     at
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
>> a:39)
>>      [java]     at
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
>> Impl.java:25)
>>      [java]     at java.lang.reflect.Method.invoke(Method.java:324)
>>      [java]     at
>> org.apache.tools.ant.taskdefs.ExecuteJava.run(ExecuteJava.java:217)
>>      [java]     at
>> org.apache.tools.ant.taskdefs.ExecuteJava.execute(ExecuteJava.java:152)
>>      [java]     at org.apache.tools.ant.taskdefs.Java.run(Java.java:745)
>>      [java]     at
>> org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:199)
>>      [java]     at
>> org.apache.tools.ant.taskdefs.Java.execute(Java.java:102)
>>      [java]     at
>> org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
>>      [java]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
>> Method)
>>      [java]     at
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
>> a:39)
>>      [java]     at
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
>> Impl.java:25)
>>      [java]     at java.lang.reflect.Method.invoke(Method.java:324)
>>      [java]     at
>> org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:1
>> 05)
>>      [java]     at org.apache.tools.ant.Task.perform(Task.java:342)
>>      [java]     at org.apache.tools.ant.Target.execute(Target.java:357)
>>      [java]     at
>> org.apache.tools.ant.Target.performTasks(Target.java:385)
>>      [java]     at
>> org.apache.tools.ant.Project.executeSortedTargets(Project.java:1292)
>>      [java]     at
>> org.apache.tools.ant.Project.executeTarget(Project.java:1261)
>>      [java]     at
>> org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecut
>> or.java:41)
>>      [java]     at
>> org.apache.tools.ant.Project.executeTargets(Project.java:1144)
>>      [java]     at org.apache.tools.ant.Main.runBuild(Main.java:698)
>>      [java]     at org.apache.tools.ant.Main.startAnt(Main.java:199)
>>      [java]     at
>> org.apache.tools.ant.launch.Launcher.run(Launcher.java:298)
>>      [java]     at
>> org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)
>>      [java] Caused by: org.apache.axis2.deployment.DeploymentException:
>> Invalid phases please recheck axis2.xml {0} for the handler {1}
>>      [java]     at
>> org.apache.axis2.deployment.util.PhasesInfo.getGlobalInflow(PhasesInfo.j
>> ava:111)
>>      [java]     at
>> org.apache.axis2.deployment.DeploymentEngine.validateSystemPredefinedPha
>> ses(DeploymentEngine.java:817)
>>      [java]     at
>> org.apache.axis2.deployment.DeploymentEngine.loadRepository(DeploymentEn
>> gine.java:115)
>>      [java]     ... 30 more
>>      [java] __________________1
>>
>> Thanks,
>> Amit Soni
>>
>> -----Original Message-----
>> From: Paul Fremantle [mailto:pzfreo@gmail.com]
>> Sent: Thursday, December 28, 2006 8:45 PM
>> To: axis-user@ws.apache.org
>> Subject: Re: soap header in axis2
>>
>> Amit
>>
>> You seem to have cut out the phases from axis2.xml. The config needs
>> the phases defined. That is how it figures out how to interleave the
>> security handlers. If you take the standard axis2.xml and add those
>> lines:
>> <module ref="rampart" />
>>         <parameter name="OutflowSecurity">
>>         <action>
>>                 <items>UsernameToken Timestamp</items>
>>                 <user>wfws</user>
>>
>> <passwordCallbackClass>com.test.PWCallback</passwordCallbackClass>
>>         </action>
>>     </parameter>
>>
>> Paul
>>
>> On 12/28/06, Amit G Soni <Am...@mphasis.com> wrote:
>> > Hi Paul,
>> >
>> > Thanks a lot for all of your help.
>> >
>> > I have executed the same wsdl with axis-1.4 successfully but in axis2
>> it
>> > gives these error. I between I have downloaded the rampart-1.0.mar
>> file
>> > but when I am running following line of code it gives me exception.
>> >
>> > ConfigurationContext context = ConfigurationContextFactory
>> > .createConfigurationContextFromFileSystem(
>> > "resources", "resources/axis2.xml");
>> >
>> >
>> > log4j:WARN No appenders could be found for logger
>> > (org.apache.axiom.om.impl.builder.StAXOMBuilder).
>> > log4j:WARN Please initialize the log4j system properly.
>> > org.apache.axis2.deployment.DeploymentException: Invalid phases please
>> > recheck axis2.xml {0} for the handler {1}; nested exception is:
>> >         org.apache.axis2.deployment.DeploymentException: Invalid
>> phases
>> > please recheck axis2.xml {0} for the handler {1}
>> >         at
>> >
>> org.apache.axis2.deployment.DeploymentEngine.loadRepository(DeploymentEn
>> > gine.java:117)
>> >         at
>> >
>> org.apache.axis2.deployment.FileSystemConfigurator.getAxisConfiguration(
>> > FileSystemConfigurator.java:120)
>> >         at
>> >
>> org.apache.axis2.context.ConfigurationContextFactory.createConfiguration
>> > Context(ConfigurationContextFactory.java:38)
>> >         at
>> >
>> org.apache.axis2.context.ConfigurationContextFactory.createConfiguration
>> > ContextFromFileSystem(ConfigurationContextFactory.java:90)
>> >         at com.test.TestClient.main(TestClient.java:15)
>> > Caused by: org.apache.axis2.deployment.DeploymentException: Invalid
>> > phases please recheck axis2.xml {0} for the handler {1}
>> >         at
>> >
>> org.apache.axis2.deployment.util.PhasesInfo.getGlobalInflow(PhasesInfo.j
>> > ava:111)
>> >         at
>> >
>> org.apache.axis2.deployment.DeploymentEngine.validateSystemPredefinedPha
>> > ses(DeploymentEngine.java:817)
>> >         at
>> >
>> org.apache.axis2.deployment.DeploymentEngine.loadRepository(DeploymentEn
>> > gine.java:115)
>> >         ... 4 more
>> > Exception in thread "main"
>> >
>> > I have attached the axis2.xml file along with this also.
>> >
>> > Thanks,
>> > Amit Soni
>> >
>> > -----Original Message-----
>> > From: Paul Fremantle [mailto:pzfreo@gmail.com]
>> > Sent: Thursday, December 28, 2006 8:01 PM
>> > To: axis-user@ws.apache.org
>> > Subject: Re: soap header in axis2
>> >
>> > Amit
>> >
>> > You seem to have found a bug in the WSDL2Java toolkit. I can't see
>> > anything obviously wrong with your WSDL, and it validates with both
>> > Eclipse and Axis1.4. Can you please raise a JIRA including your
>> > WSDL/XSDs as an attachment?
>> >
>> > Here is the link to rampart1.0 in the meantime:
>> > http://apache.rmplc.co.uk/ws/axis2/modules/rampart/1_0/rampart-1.0.mar
>> >
>> > Paul
>> >
>> > On 12/28/06, Amit G Soni <Am...@mphasis.com> wrote:
>> > > Hi Paul,
>> > >
>> > > I am trying to find rampath-1.0 but I am not able to fine any link
>> > from
>> > > which version 1.0 I can download.
>> > >
>> > > But after that I am trying the same with Axis2-1.1
>> > >
>> > > But in this case it gives me following exception.
>> > >
>> > > C:\axis211>wsdl2java -uri c:\test\CardholderService.wsdl -p com.test
>> > -d
>> > > none
>> > > Using AXIS2_HOME:   C:\Java\axis2-1.1
>> > > Using JAVA_HOME:    C:\Java\j2sdk1.4.2_13
>> > > Retrieving schema at 'CardholderData.xsd', relative to
>> > 'file:/c:/test/'.
>> > > Retrieving schema at 'CardholderMessages.xsd', relative to
>> > > 'file:/c:/test/'.
>> > > Retrieving schema at 'CardholderData.xsd', relative to
>> > > 'file:/c:/test/CardholderMessages.xsd'.
>> > > Retrieving schema at 'OperationResults.xsd', relative to
>> > > 'file:/c:/test/CardholderMessages.xsd'.
>> > > Retrieving schema at 'OperationResults.xsd', relative to
>> > > 'file:/c:/test/'.
>> > > Dec 28, 2006 7:10:25 PM
>> > > org.apache.axis2.description.WSDL11ToAxisServiceBuilder
>> > populateService
>> > > SEVERE: java.lang.NullPointerException
>> > > Exception in thread "main"
>> > > org.apache.axis2.wsdl.codegen.CodeGenerationException: Error parsing
>> > > WSDL
>> > >         at
>> > >
>> >
>> org.apache.axis2.wsdl.codegen.CodeGenerationEngine.<init>(CodeGeneration
>> > > Engine.java:112)
>> > >         at org.apache.axis2.wsdl.WSDL2Code.main(WSDL2Code.java:32)
>> > >         at org.apache.axis2.wsdl.WSDL2Java.main(WSDL2Java.java:21)
>> > > Caused by: org.apache.axis2.AxisFault: null; nested exception is:
>> > >         java.lang.NullPointerException
>> > >         at
>> > >
>> >
>> org.apache.axis2.description.WSDL11ToAxisServiceBuilder.populateService(
>> > > WSDL11ToAxisServiceBuilder.java:250)
>> > >         at
>> > >
>> >
>> org.apache.axis2.wsdl.codegen.CodeGenerationEngine.<init>(CodeGeneration
>> > > Engine.java:103)
>> > >         ... 2 more
>> > > Caused by: java.lang.NullPointerException
>> > >         at
>> > >
>> >
>> org.apache.axis2.description.WSDL11ToAxisServiceBuilder.populateService(
>> > > WSDL11ToAxisServiceBuilder.java:235)
>> > >         ... 3 more
>> > >
>> > > Can you have any idea why it is happens.
>> > >
>> > > I am also attaching my wsdl file along with the mail.
>> > >
>> > > Thanks,
>> > > Amit Soni
>> > >
>> > >
>> > > -----Original Message-----
>> > > From: Paul Fremantle [mailto:pzfreo@gmail.com]
>> > > Sent: Thursday, December 28, 2006 6:30 PM
>> > > To: axis-user@ws.apache.org
>> > > Subject: Re: soap header in axis2
>> > >
>> > > Amit
>> > >
>> > > No, rampart 1.1 is expected to be used with Axis2 1.1.
>> > >
>> > > If you can move to 1.1 you should, because of the large number of
>> bugs
>> > > fixed!
>> > >
>> > > Otherwise there is rampart1.0 available.
>> > >
>> > > Paul
>> > >
>> > > On 12/28/06, Amit G Soni <Am...@mphasis.com> wrote:
>> > > > 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:pzfreo@gmail.com]
>> > > > Sent: Thursday, December 28, 2006 4:17 PM
>> > > > To: axis-user@ws.apache.org
>> > > > 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 <Am...@mphasis.com> 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
>> > > > paul@wso2.com
>> > > >
>> > > > "Oxygenating the Web Service Platform", www.wso2.com
>> > > >
>> > > >
>> > ---------------------------------------------------------------------
>> > > > 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
>> > > >
>> > > >
>> > >
>> > >
>> > > --
>> > > Paul Fremantle
>> > > VP/Technology, WSO2 and OASIS WS-RX TC Co-chair
>> > >
>> > > http://bloglines.com/blog/paulfremantle
>> > > paul@wso2.com
>> > >
>> > > "Oxygenating the Web Service Platform", www.wso2.com
>> > >
>> > >
>> ---------------------------------------------------------------------
>> > > 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
>> > >
>> > >
>> > >
>> >
>> >
>> > --
>> > Paul Fremantle
>> > VP/Technology, WSO2 and OASIS WS-RX TC Co-chair
>> >
>> > http://bloglines.com/blog/paulfremantle
>> > paul@wso2.com
>> >
>> > "Oxygenating the Web Service Platform", www.wso2.com
>> >
>> > ---------------------------------------------------------------------
>> > 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
>> >
>> >
>> >
>>
>>
>> --
>> Paul Fremantle
>> VP/Technology, WSO2 and OASIS WS-RX TC Co-chair
>>
>> http://bloglines.com/blog/paulfremantle
>> paul@wso2.com
>>
>> "Oxygenating the Web Service Platform", www.wso2.com
>>
>> ---------------------------------------------------------------------
>> 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
>>
>>
>>
> 
> 
> -- 
> Paul Fremantle
> VP/Technology, WSO2 and OASIS WS-RX TC Co-chair
> 
> http://bloglines.com/blog/paulfremantle
> paul@wso2.com
> 
> "Oxygenating the Web Service Platform", www.wso2.com
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
> 
>

RE: soap header in axis2

Posted by Amit G Soni <Am...@mphasis.com>.
Hi Paul,

I am able to send a request with wsse and wsa header parameter. Within
which wsse header tag is ok but in wsa:action and wsa:to tag I need to
include namespace (xmlns) and some more attributes. So the original
request of soap header is looks like:

<wsa:To>urn:EvolutionBenefits:Services:V1:CardholderService</wsa:To>

<wsa:Action>
	http://services.bennycentral.com/Cardholder/v1:helloWorldIn
</wsa:Action>

But within wsa:To and wsa:Action I need to add some attribute. So which
is looks like:

<wsa:To xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/03/addressing"
soapenv:actor="http://schemas.xmlsoap.org/soap/actor/next"
soapenv:mustUnderstand="1">
	  urn:EvolutionBenefits:Services:V1:CardholderService
</wsa:To>

<wsa:Action xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/03/addressing"

            soapenv:actor="http://schemas.xmlsoap.org/soap/actor/next" 
	      soapenv:mustUnderstand="0">
	http://services.bennycentral.com/Cardholder/v1:helloWorldIn
</wsa:Action>


So basically I want to include some of the attributes in wsa:Action and
wsa:To tags. So if you have some idea regarding this then please let me
know.

Thanks,
Amit Soni

-----Original Message-----
From: Paul Fremantle [mailto:pzfreo@gmail.com] 
Sent: Saturday, December 30, 2006 4:17 PM
To: axis-user@ws.apache.org
Subject: Re: soap header in axis2

Amit

I haven't figured out the problem yet! I don't see anything obvious
with your axis2.xml.

What happens if you try with the standard axis2.xml? Normally for a
client, I would use the standard axis2.xml and then add
ServiceClient.engageModule("rampart") in my code.

Paul

On 12/29/06, Amit G Soni <Am...@mphasis.com> wrote:
> Hi Paul,
>
> I am trying rampart with version 1.0 but it gives me following error
> along with the mail I am also attaching the client code and axis2.xml
>
>      [java] org.apache.axis2.deployment.DeploymentException: Invalid
> phases please recheck axis2.xml {0} for the handler {1}; nested
> exception is:
>      [java]     org.apache.axis2.deployment.DeploymentException:
Invalid
> phases please recheck axis2.xml {0} for the handler {1}
>      [java]     at
>
org.apache.axis2.deployment.DeploymentEngine.loadRepository(DeploymentEn
> gine.java:117)
>      [java]     at
>
org.apache.axis2.deployment.FileSystemConfigurator.getAxisConfiguration(
> FileSystemConfigurator.java:120)
>      [java]     at
>
org.apache.axis2.context.ConfigurationContextFactory.createConfiguration
> Context(ConfigurationContextFactory.java:38)
>      [java]     at
>
org.apache.axis2.context.ConfigurationContextFactory.createConfiguration
> ContextFromFileSystem(ConfigurationContextFactory.java:90)
>      [java]     at com.test.TestClient.main(TestClient.java:18)
>      [java]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
> Method)
>      [java]     at
>
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
> a:39)
>      [java]     at
>
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
> Impl.java:25)
>      [java]     at java.lang.reflect.Method.invoke(Method.java:324)
>      [java]     at
> org.apache.tools.ant.taskdefs.ExecuteJava.run(ExecuteJava.java:217)
>      [java]     at
>
org.apache.tools.ant.taskdefs.ExecuteJava.execute(ExecuteJava.java:152)
>      [java]     at
org.apache.tools.ant.taskdefs.Java.run(Java.java:745)
>      [java]     at
> org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:199)
>      [java]     at
> org.apache.tools.ant.taskdefs.Java.execute(Java.java:102)
>      [java]     at
> org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
>      [java]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
> Method)
>      [java]     at
>
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
> a:39)
>      [java]     at
>
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
> Impl.java:25)
>      [java]     at java.lang.reflect.Method.invoke(Method.java:324)
>      [java]     at
>
org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:1
> 05)
>      [java]     at org.apache.tools.ant.Task.perform(Task.java:342)
>      [java]     at
org.apache.tools.ant.Target.execute(Target.java:357)
>      [java]     at
> org.apache.tools.ant.Target.performTasks(Target.java:385)
>      [java]     at
> org.apache.tools.ant.Project.executeSortedTargets(Project.java:1292)
>      [java]     at
> org.apache.tools.ant.Project.executeTarget(Project.java:1261)
>      [java]     at
>
org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecut
> or.java:41)
>      [java]     at
> org.apache.tools.ant.Project.executeTargets(Project.java:1144)
>      [java]     at org.apache.tools.ant.Main.runBuild(Main.java:698)
>      [java]     at org.apache.tools.ant.Main.startAnt(Main.java:199)
>      [java]     at
> org.apache.tools.ant.launch.Launcher.run(Launcher.java:298)
>      [java]     at
> org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)
>      [java] Caused by:
org.apache.axis2.deployment.DeploymentException:
> Invalid phases please recheck axis2.xml {0} for the handler {1}
>      [java]     at
>
org.apache.axis2.deployment.util.PhasesInfo.getGlobalInflow(PhasesInfo.j
> ava:111)
>      [java]     at
>
org.apache.axis2.deployment.DeploymentEngine.validateSystemPredefinedPha
> ses(DeploymentEngine.java:817)
>      [java]     at
>
org.apache.axis2.deployment.DeploymentEngine.loadRepository(DeploymentEn
> gine.java:115)
>      [java]     ... 30 more
>      [java] __________________1
>
> Thanks,
> Amit Soni
>
> -----Original Message-----
> From: Paul Fremantle [mailto:pzfreo@gmail.com]
> Sent: Thursday, December 28, 2006 8:45 PM
> To: axis-user@ws.apache.org
> Subject: Re: soap header in axis2
>
> Amit
>
> You seem to have cut out the phases from axis2.xml. The config needs
> the phases defined. That is how it figures out how to interleave the
> security handlers. If you take the standard axis2.xml and add those
> lines:
> <module ref="rampart" />
>         <parameter name="OutflowSecurity">
>         <action>
>                 <items>UsernameToken Timestamp</items>
>                 <user>wfws</user>
>
> <passwordCallbackClass>com.test.PWCallback</passwordCallbackClass>
>         </action>
>     </parameter>
>
> Paul
>
> On 12/28/06, Amit G Soni <Am...@mphasis.com> wrote:
> > Hi Paul,
> >
> > Thanks a lot for all of your help.
> >
> > I have executed the same wsdl with axis-1.4 successfully but in
axis2
> it
> > gives these error. I between I have downloaded the rampart-1.0.mar
> file
> > but when I am running following line of code it gives me exception.
> >
> > ConfigurationContext context = ConfigurationContextFactory
> > .createConfigurationContextFromFileSystem(
> > "resources", "resources/axis2.xml");
> >
> >
> > log4j:WARN No appenders could be found for logger
> > (org.apache.axiom.om.impl.builder.StAXOMBuilder).
> > log4j:WARN Please initialize the log4j system properly.
> > org.apache.axis2.deployment.DeploymentException: Invalid phases
please
> > recheck axis2.xml {0} for the handler {1}; nested exception is:
> >         org.apache.axis2.deployment.DeploymentException: Invalid
> phases
> > please recheck axis2.xml {0} for the handler {1}
> >         at
> >
>
org.apache.axis2.deployment.DeploymentEngine.loadRepository(DeploymentEn
> > gine.java:117)
> >         at
> >
>
org.apache.axis2.deployment.FileSystemConfigurator.getAxisConfiguration(
> > FileSystemConfigurator.java:120)
> >         at
> >
>
org.apache.axis2.context.ConfigurationContextFactory.createConfiguration
> > Context(ConfigurationContextFactory.java:38)
> >         at
> >
>
org.apache.axis2.context.ConfigurationContextFactory.createConfiguration
> > ContextFromFileSystem(ConfigurationContextFactory.java:90)
> >         at com.test.TestClient.main(TestClient.java:15)
> > Caused by: org.apache.axis2.deployment.DeploymentException: Invalid
> > phases please recheck axis2.xml {0} for the handler {1}
> >         at
> >
>
org.apache.axis2.deployment.util.PhasesInfo.getGlobalInflow(PhasesInfo.j
> > ava:111)
> >         at
> >
>
org.apache.axis2.deployment.DeploymentEngine.validateSystemPredefinedPha
> > ses(DeploymentEngine.java:817)
> >         at
> >
>
org.apache.axis2.deployment.DeploymentEngine.loadRepository(DeploymentEn
> > gine.java:115)
> >         ... 4 more
> > Exception in thread "main"
> >
> > I have attached the axis2.xml file along with this also.
> >
> > Thanks,
> > Amit Soni
> >
> > -----Original Message-----
> > From: Paul Fremantle [mailto:pzfreo@gmail.com]
> > Sent: Thursday, December 28, 2006 8:01 PM
> > To: axis-user@ws.apache.org
> > Subject: Re: soap header in axis2
> >
> > Amit
> >
> > You seem to have found a bug in the WSDL2Java toolkit. I can't see
> > anything obviously wrong with your WSDL, and it validates with both
> > Eclipse and Axis1.4. Can you please raise a JIRA including your
> > WSDL/XSDs as an attachment?
> >
> > Here is the link to rampart1.0 in the meantime:
> >
http://apache.rmplc.co.uk/ws/axis2/modules/rampart/1_0/rampart-1.0.mar
> >
> > Paul
> >
> > On 12/28/06, Amit G Soni <Am...@mphasis.com> wrote:
> > > Hi Paul,
> > >
> > > I am trying to find rampath-1.0 but I am not able to fine any link
> > from
> > > which version 1.0 I can download.
> > >
> > > But after that I am trying the same with Axis2-1.1
> > >
> > > But in this case it gives me following exception.
> > >
> > > C:\axis211>wsdl2java -uri c:\test\CardholderService.wsdl -p
com.test
> > -d
> > > none
> > > Using AXIS2_HOME:   C:\Java\axis2-1.1
> > > Using JAVA_HOME:    C:\Java\j2sdk1.4.2_13
> > > Retrieving schema at 'CardholderData.xsd', relative to
> > 'file:/c:/test/'.
> > > Retrieving schema at 'CardholderMessages.xsd', relative to
> > > 'file:/c:/test/'.
> > > Retrieving schema at 'CardholderData.xsd', relative to
> > > 'file:/c:/test/CardholderMessages.xsd'.
> > > Retrieving schema at 'OperationResults.xsd', relative to
> > > 'file:/c:/test/CardholderMessages.xsd'.
> > > Retrieving schema at 'OperationResults.xsd', relative to
> > > 'file:/c:/test/'.
> > > Dec 28, 2006 7:10:25 PM
> > > org.apache.axis2.description.WSDL11ToAxisServiceBuilder
> > populateService
> > > SEVERE: java.lang.NullPointerException
> > > Exception in thread "main"
> > > org.apache.axis2.wsdl.codegen.CodeGenerationException: Error
parsing
> > > WSDL
> > >         at
> > >
> >
>
org.apache.axis2.wsdl.codegen.CodeGenerationEngine.<init>(CodeGeneration
> > > Engine.java:112)
> > >         at org.apache.axis2.wsdl.WSDL2Code.main(WSDL2Code.java:32)
> > >         at org.apache.axis2.wsdl.WSDL2Java.main(WSDL2Java.java:21)
> > > Caused by: org.apache.axis2.AxisFault: null; nested exception is:
> > >         java.lang.NullPointerException
> > >         at
> > >
> >
>
org.apache.axis2.description.WSDL11ToAxisServiceBuilder.populateService(
> > > WSDL11ToAxisServiceBuilder.java:250)
> > >         at
> > >
> >
>
org.apache.axis2.wsdl.codegen.CodeGenerationEngine.<init>(CodeGeneration
> > > Engine.java:103)
> > >         ... 2 more
> > > Caused by: java.lang.NullPointerException
> > >         at
> > >
> >
>
org.apache.axis2.description.WSDL11ToAxisServiceBuilder.populateService(
> > > WSDL11ToAxisServiceBuilder.java:235)
> > >         ... 3 more
> > >
> > > Can you have any idea why it is happens.
> > >
> > > I am also attaching my wsdl file along with the mail.
> > >
> > > Thanks,
> > > Amit Soni
> > >
> > >
> > > -----Original Message-----
> > > From: Paul Fremantle [mailto:pzfreo@gmail.com]
> > > Sent: Thursday, December 28, 2006 6:30 PM
> > > To: axis-user@ws.apache.org
> > > Subject: Re: soap header in axis2
> > >
> > > Amit
> > >
> > > No, rampart 1.1 is expected to be used with Axis2 1.1.
> > >
> > > If you can move to 1.1 you should, because of the large number of
> bugs
> > > fixed!
> > >
> > > Otherwise there is rampart1.0 available.
> > >
> > > Paul
> > >
> > > On 12/28/06, Amit G Soni <Am...@mphasis.com> wrote:
> > > > 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:pzfreo@gmail.com]
> > > > Sent: Thursday, December 28, 2006 4:17 PM
> > > > To: axis-user@ws.apache.org
> > > > 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 <Am...@mphasis.com> 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
> > > > paul@wso2.com
> > > >
> > > > "Oxygenating the Web Service Platform", www.wso2.com
> > > >
> > > >
> >
---------------------------------------------------------------------
> > > > 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
> > > >
> > > >
> > >
> > >
> > > --
> > > Paul Fremantle
> > > VP/Technology, WSO2 and OASIS WS-RX TC Co-chair
> > >
> > > http://bloglines.com/blog/paulfremantle
> > > paul@wso2.com
> > >
> > > "Oxygenating the Web Service Platform", www.wso2.com
> > >
> > >
> ---------------------------------------------------------------------
> > > 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
> > >
> > >
> > >
> >
> >
> > --
> > Paul Fremantle
> > VP/Technology, WSO2 and OASIS WS-RX TC Co-chair
> >
> > http://bloglines.com/blog/paulfremantle
> > paul@wso2.com
> >
> > "Oxygenating the Web Service Platform", www.wso2.com
> >
> >
---------------------------------------------------------------------
> > 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
> >
> >
> >
>
>
> --
> Paul Fremantle
> VP/Technology, WSO2 and OASIS WS-RX TC Co-chair
>
> http://bloglines.com/blog/paulfremantle
> paul@wso2.com
>
> "Oxygenating the Web Service Platform", www.wso2.com
>
> ---------------------------------------------------------------------
> 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
>
>
>


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

http://bloglines.com/blog/paulfremantle
paul@wso2.com

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

---------------------------------------------------------------------
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: soap header in axis2

Posted by Paul Fremantle <pz...@gmail.com>.
Amit

I haven't figured out the problem yet! I don't see anything obvious
with your axis2.xml.

What happens if you try with the standard axis2.xml? Normally for a
client, I would use the standard axis2.xml and then add
ServiceClient.engageModule("rampart") in my code.

Paul

On 12/29/06, Amit G Soni <Am...@mphasis.com> wrote:
> Hi Paul,
>
> I am trying rampart with version 1.0 but it gives me following error
> along with the mail I am also attaching the client code and axis2.xml
>
>      [java] org.apache.axis2.deployment.DeploymentException: Invalid
> phases please recheck axis2.xml {0} for the handler {1}; nested
> exception is:
>      [java]     org.apache.axis2.deployment.DeploymentException: Invalid
> phases please recheck axis2.xml {0} for the handler {1}
>      [java]     at
> org.apache.axis2.deployment.DeploymentEngine.loadRepository(DeploymentEn
> gine.java:117)
>      [java]     at
> org.apache.axis2.deployment.FileSystemConfigurator.getAxisConfiguration(
> FileSystemConfigurator.java:120)
>      [java]     at
> org.apache.axis2.context.ConfigurationContextFactory.createConfiguration
> Context(ConfigurationContextFactory.java:38)
>      [java]     at
> org.apache.axis2.context.ConfigurationContextFactory.createConfiguration
> ContextFromFileSystem(ConfigurationContextFactory.java:90)
>      [java]     at com.test.TestClient.main(TestClient.java:18)
>      [java]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
> Method)
>      [java]     at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
> a:39)
>      [java]     at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
> Impl.java:25)
>      [java]     at java.lang.reflect.Method.invoke(Method.java:324)
>      [java]     at
> org.apache.tools.ant.taskdefs.ExecuteJava.run(ExecuteJava.java:217)
>      [java]     at
> org.apache.tools.ant.taskdefs.ExecuteJava.execute(ExecuteJava.java:152)
>      [java]     at org.apache.tools.ant.taskdefs.Java.run(Java.java:745)
>      [java]     at
> org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:199)
>      [java]     at
> org.apache.tools.ant.taskdefs.Java.execute(Java.java:102)
>      [java]     at
> org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
>      [java]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
> Method)
>      [java]     at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
> a:39)
>      [java]     at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
> Impl.java:25)
>      [java]     at java.lang.reflect.Method.invoke(Method.java:324)
>      [java]     at
> org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:1
> 05)
>      [java]     at org.apache.tools.ant.Task.perform(Task.java:342)
>      [java]     at org.apache.tools.ant.Target.execute(Target.java:357)
>      [java]     at
> org.apache.tools.ant.Target.performTasks(Target.java:385)
>      [java]     at
> org.apache.tools.ant.Project.executeSortedTargets(Project.java:1292)
>      [java]     at
> org.apache.tools.ant.Project.executeTarget(Project.java:1261)
>      [java]     at
> org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecut
> or.java:41)
>      [java]     at
> org.apache.tools.ant.Project.executeTargets(Project.java:1144)
>      [java]     at org.apache.tools.ant.Main.runBuild(Main.java:698)
>      [java]     at org.apache.tools.ant.Main.startAnt(Main.java:199)
>      [java]     at
> org.apache.tools.ant.launch.Launcher.run(Launcher.java:298)
>      [java]     at
> org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)
>      [java] Caused by: org.apache.axis2.deployment.DeploymentException:
> Invalid phases please recheck axis2.xml {0} for the handler {1}
>      [java]     at
> org.apache.axis2.deployment.util.PhasesInfo.getGlobalInflow(PhasesInfo.j
> ava:111)
>      [java]     at
> org.apache.axis2.deployment.DeploymentEngine.validateSystemPredefinedPha
> ses(DeploymentEngine.java:817)
>      [java]     at
> org.apache.axis2.deployment.DeploymentEngine.loadRepository(DeploymentEn
> gine.java:115)
>      [java]     ... 30 more
>      [java] __________________1
>
> Thanks,
> Amit Soni
>
> -----Original Message-----
> From: Paul Fremantle [mailto:pzfreo@gmail.com]
> Sent: Thursday, December 28, 2006 8:45 PM
> To: axis-user@ws.apache.org
> Subject: Re: soap header in axis2
>
> Amit
>
> You seem to have cut out the phases from axis2.xml. The config needs
> the phases defined. That is how it figures out how to interleave the
> security handlers. If you take the standard axis2.xml and add those
> lines:
> <module ref="rampart" />
>         <parameter name="OutflowSecurity">
>         <action>
>                 <items>UsernameToken Timestamp</items>
>                 <user>wfws</user>
>
> <passwordCallbackClass>com.test.PWCallback</passwordCallbackClass>
>         </action>
>     </parameter>
>
> Paul
>
> On 12/28/06, Amit G Soni <Am...@mphasis.com> wrote:
> > Hi Paul,
> >
> > Thanks a lot for all of your help.
> >
> > I have executed the same wsdl with axis-1.4 successfully but in axis2
> it
> > gives these error. I between I have downloaded the rampart-1.0.mar
> file
> > but when I am running following line of code it gives me exception.
> >
> > ConfigurationContext context = ConfigurationContextFactory
> > .createConfigurationContextFromFileSystem(
> > "resources", "resources/axis2.xml");
> >
> >
> > log4j:WARN No appenders could be found for logger
> > (org.apache.axiom.om.impl.builder.StAXOMBuilder).
> > log4j:WARN Please initialize the log4j system properly.
> > org.apache.axis2.deployment.DeploymentException: Invalid phases please
> > recheck axis2.xml {0} for the handler {1}; nested exception is:
> >         org.apache.axis2.deployment.DeploymentException: Invalid
> phases
> > please recheck axis2.xml {0} for the handler {1}
> >         at
> >
> org.apache.axis2.deployment.DeploymentEngine.loadRepository(DeploymentEn
> > gine.java:117)
> >         at
> >
> org.apache.axis2.deployment.FileSystemConfigurator.getAxisConfiguration(
> > FileSystemConfigurator.java:120)
> >         at
> >
> org.apache.axis2.context.ConfigurationContextFactory.createConfiguration
> > Context(ConfigurationContextFactory.java:38)
> >         at
> >
> org.apache.axis2.context.ConfigurationContextFactory.createConfiguration
> > ContextFromFileSystem(ConfigurationContextFactory.java:90)
> >         at com.test.TestClient.main(TestClient.java:15)
> > Caused by: org.apache.axis2.deployment.DeploymentException: Invalid
> > phases please recheck axis2.xml {0} for the handler {1}
> >         at
> >
> org.apache.axis2.deployment.util.PhasesInfo.getGlobalInflow(PhasesInfo.j
> > ava:111)
> >         at
> >
> org.apache.axis2.deployment.DeploymentEngine.validateSystemPredefinedPha
> > ses(DeploymentEngine.java:817)
> >         at
> >
> org.apache.axis2.deployment.DeploymentEngine.loadRepository(DeploymentEn
> > gine.java:115)
> >         ... 4 more
> > Exception in thread "main"
> >
> > I have attached the axis2.xml file along with this also.
> >
> > Thanks,
> > Amit Soni
> >
> > -----Original Message-----
> > From: Paul Fremantle [mailto:pzfreo@gmail.com]
> > Sent: Thursday, December 28, 2006 8:01 PM
> > To: axis-user@ws.apache.org
> > Subject: Re: soap header in axis2
> >
> > Amit
> >
> > You seem to have found a bug in the WSDL2Java toolkit. I can't see
> > anything obviously wrong with your WSDL, and it validates with both
> > Eclipse and Axis1.4. Can you please raise a JIRA including your
> > WSDL/XSDs as an attachment?
> >
> > Here is the link to rampart1.0 in the meantime:
> > http://apache.rmplc.co.uk/ws/axis2/modules/rampart/1_0/rampart-1.0.mar
> >
> > Paul
> >
> > On 12/28/06, Amit G Soni <Am...@mphasis.com> wrote:
> > > Hi Paul,
> > >
> > > I am trying to find rampath-1.0 but I am not able to fine any link
> > from
> > > which version 1.0 I can download.
> > >
> > > But after that I am trying the same with Axis2-1.1
> > >
> > > But in this case it gives me following exception.
> > >
> > > C:\axis211>wsdl2java -uri c:\test\CardholderService.wsdl -p com.test
> > -d
> > > none
> > > Using AXIS2_HOME:   C:\Java\axis2-1.1
> > > Using JAVA_HOME:    C:\Java\j2sdk1.4.2_13
> > > Retrieving schema at 'CardholderData.xsd', relative to
> > 'file:/c:/test/'.
> > > Retrieving schema at 'CardholderMessages.xsd', relative to
> > > 'file:/c:/test/'.
> > > Retrieving schema at 'CardholderData.xsd', relative to
> > > 'file:/c:/test/CardholderMessages.xsd'.
> > > Retrieving schema at 'OperationResults.xsd', relative to
> > > 'file:/c:/test/CardholderMessages.xsd'.
> > > Retrieving schema at 'OperationResults.xsd', relative to
> > > 'file:/c:/test/'.
> > > Dec 28, 2006 7:10:25 PM
> > > org.apache.axis2.description.WSDL11ToAxisServiceBuilder
> > populateService
> > > SEVERE: java.lang.NullPointerException
> > > Exception in thread "main"
> > > org.apache.axis2.wsdl.codegen.CodeGenerationException: Error parsing
> > > WSDL
> > >         at
> > >
> >
> org.apache.axis2.wsdl.codegen.CodeGenerationEngine.<init>(CodeGeneration
> > > Engine.java:112)
> > >         at org.apache.axis2.wsdl.WSDL2Code.main(WSDL2Code.java:32)
> > >         at org.apache.axis2.wsdl.WSDL2Java.main(WSDL2Java.java:21)
> > > Caused by: org.apache.axis2.AxisFault: null; nested exception is:
> > >         java.lang.NullPointerException
> > >         at
> > >
> >
> org.apache.axis2.description.WSDL11ToAxisServiceBuilder.populateService(
> > > WSDL11ToAxisServiceBuilder.java:250)
> > >         at
> > >
> >
> org.apache.axis2.wsdl.codegen.CodeGenerationEngine.<init>(CodeGeneration
> > > Engine.java:103)
> > >         ... 2 more
> > > Caused by: java.lang.NullPointerException
> > >         at
> > >
> >
> org.apache.axis2.description.WSDL11ToAxisServiceBuilder.populateService(
> > > WSDL11ToAxisServiceBuilder.java:235)
> > >         ... 3 more
> > >
> > > Can you have any idea why it is happens.
> > >
> > > I am also attaching my wsdl file along with the mail.
> > >
> > > Thanks,
> > > Amit Soni
> > >
> > >
> > > -----Original Message-----
> > > From: Paul Fremantle [mailto:pzfreo@gmail.com]
> > > Sent: Thursday, December 28, 2006 6:30 PM
> > > To: axis-user@ws.apache.org
> > > Subject: Re: soap header in axis2
> > >
> > > Amit
> > >
> > > No, rampart 1.1 is expected to be used with Axis2 1.1.
> > >
> > > If you can move to 1.1 you should, because of the large number of
> bugs
> > > fixed!
> > >
> > > Otherwise there is rampart1.0 available.
> > >
> > > Paul
> > >
> > > On 12/28/06, Amit G Soni <Am...@mphasis.com> wrote:
> > > > 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:pzfreo@gmail.com]
> > > > Sent: Thursday, December 28, 2006 4:17 PM
> > > > To: axis-user@ws.apache.org
> > > > 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 <Am...@mphasis.com> 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
> > > > paul@wso2.com
> > > >
> > > > "Oxygenating the Web Service Platform", www.wso2.com
> > > >
> > > >
> > ---------------------------------------------------------------------
> > > > 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
> > > >
> > > >
> > >
> > >
> > > --
> > > Paul Fremantle
> > > VP/Technology, WSO2 and OASIS WS-RX TC Co-chair
> > >
> > > http://bloglines.com/blog/paulfremantle
> > > paul@wso2.com
> > >
> > > "Oxygenating the Web Service Platform", www.wso2.com
> > >
> > >
> ---------------------------------------------------------------------
> > > 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
> > >
> > >
> > >
> >
> >
> > --
> > Paul Fremantle
> > VP/Technology, WSO2 and OASIS WS-RX TC Co-chair
> >
> > http://bloglines.com/blog/paulfremantle
> > paul@wso2.com
> >
> > "Oxygenating the Web Service Platform", www.wso2.com
> >
> > ---------------------------------------------------------------------
> > 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
> >
> >
> >
>
>
> --
> Paul Fremantle
> VP/Technology, WSO2 and OASIS WS-RX TC Co-chair
>
> http://bloglines.com/blog/paulfremantle
> paul@wso2.com
>
> "Oxygenating the Web Service Platform", www.wso2.com
>
> ---------------------------------------------------------------------
> 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
>
>
>


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

http://bloglines.com/blog/paulfremantle
paul@wso2.com

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

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


RE: soap header in axis2

Posted by Amit G Soni <Am...@mphasis.com>.
Hi Paul,

I am trying rampart with version 1.0 but it gives me following error
along with the mail I am also attaching the client code and axis2.xml

     [java] org.apache.axis2.deployment.DeploymentException: Invalid
phases please recheck axis2.xml {0} for the handler {1}; nested
exception is: 
     [java] 	org.apache.axis2.deployment.DeploymentException: Invalid
phases please recheck axis2.xml {0} for the handler {1}
     [java] 	at
org.apache.axis2.deployment.DeploymentEngine.loadRepository(DeploymentEn
gine.java:117)
     [java] 	at
org.apache.axis2.deployment.FileSystemConfigurator.getAxisConfiguration(
FileSystemConfigurator.java:120)
     [java] 	at
org.apache.axis2.context.ConfigurationContextFactory.createConfiguration
Context(ConfigurationContextFactory.java:38)
     [java] 	at
org.apache.axis2.context.ConfigurationContextFactory.createConfiguration
ContextFromFileSystem(ConfigurationContextFactory.java:90)
     [java] 	at com.test.TestClient.main(TestClient.java:18)
     [java] 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
     [java] 	at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
a:39)
     [java] 	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
Impl.java:25)
     [java] 	at java.lang.reflect.Method.invoke(Method.java:324)
     [java] 	at
org.apache.tools.ant.taskdefs.ExecuteJava.run(ExecuteJava.java:217)
     [java] 	at
org.apache.tools.ant.taskdefs.ExecuteJava.execute(ExecuteJava.java:152)
     [java] 	at org.apache.tools.ant.taskdefs.Java.run(Java.java:745)
     [java] 	at
org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:199)
     [java] 	at
org.apache.tools.ant.taskdefs.Java.execute(Java.java:102)
     [java] 	at
org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
     [java] 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
     [java] 	at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
a:39)
     [java] 	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
Impl.java:25)
     [java] 	at java.lang.reflect.Method.invoke(Method.java:324)
     [java] 	at
org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:1
05)
     [java] 	at org.apache.tools.ant.Task.perform(Task.java:342)
     [java] 	at org.apache.tools.ant.Target.execute(Target.java:357)
     [java] 	at
org.apache.tools.ant.Target.performTasks(Target.java:385)
     [java] 	at
org.apache.tools.ant.Project.executeSortedTargets(Project.java:1292)
     [java] 	at
org.apache.tools.ant.Project.executeTarget(Project.java:1261)
     [java] 	at
org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecut
or.java:41)
     [java] 	at
org.apache.tools.ant.Project.executeTargets(Project.java:1144)
     [java] 	at org.apache.tools.ant.Main.runBuild(Main.java:698)
     [java] 	at org.apache.tools.ant.Main.startAnt(Main.java:199)
     [java] 	at
org.apache.tools.ant.launch.Launcher.run(Launcher.java:298)
     [java] 	at
org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)
     [java] Caused by: org.apache.axis2.deployment.DeploymentException:
Invalid phases please recheck axis2.xml {0} for the handler {1}
     [java] 	at
org.apache.axis2.deployment.util.PhasesInfo.getGlobalInflow(PhasesInfo.j
ava:111)
     [java] 	at
org.apache.axis2.deployment.DeploymentEngine.validateSystemPredefinedPha
ses(DeploymentEngine.java:817)
     [java] 	at
org.apache.axis2.deployment.DeploymentEngine.loadRepository(DeploymentEn
gine.java:115)
     [java] 	... 30 more
     [java] __________________1

Thanks,
Amit Soni

-----Original Message-----
From: Paul Fremantle [mailto:pzfreo@gmail.com] 
Sent: Thursday, December 28, 2006 8:45 PM
To: axis-user@ws.apache.org
Subject: Re: soap header in axis2

Amit

You seem to have cut out the phases from axis2.xml. The config needs
the phases defined. That is how it figures out how to interleave the
security handlers. If you take the standard axis2.xml and add those
lines:
<module ref="rampart" />
	<parameter name="OutflowSecurity">
    	<action>
        	<items>UsernameToken Timestamp</items>
        	<user>wfws</user>
 
<passwordCallbackClass>com.test.PWCallback</passwordCallbackClass>
      	</action>
    </parameter>

Paul

On 12/28/06, Amit G Soni <Am...@mphasis.com> wrote:
> Hi Paul,
>
> Thanks a lot for all of your help.
>
> I have executed the same wsdl with axis-1.4 successfully but in axis2
it
> gives these error. I between I have downloaded the rampart-1.0.mar
file
> but when I am running following line of code it gives me exception.
>
> ConfigurationContext context = ConfigurationContextFactory
> .createConfigurationContextFromFileSystem(
> "resources", "resources/axis2.xml");
>
>
> log4j:WARN No appenders could be found for logger
> (org.apache.axiom.om.impl.builder.StAXOMBuilder).
> log4j:WARN Please initialize the log4j system properly.
> org.apache.axis2.deployment.DeploymentException: Invalid phases please
> recheck axis2.xml {0} for the handler {1}; nested exception is:
>         org.apache.axis2.deployment.DeploymentException: Invalid
phases
> please recheck axis2.xml {0} for the handler {1}
>         at
>
org.apache.axis2.deployment.DeploymentEngine.loadRepository(DeploymentEn
> gine.java:117)
>         at
>
org.apache.axis2.deployment.FileSystemConfigurator.getAxisConfiguration(
> FileSystemConfigurator.java:120)
>         at
>
org.apache.axis2.context.ConfigurationContextFactory.createConfiguration
> Context(ConfigurationContextFactory.java:38)
>         at
>
org.apache.axis2.context.ConfigurationContextFactory.createConfiguration
> ContextFromFileSystem(ConfigurationContextFactory.java:90)
>         at com.test.TestClient.main(TestClient.java:15)
> Caused by: org.apache.axis2.deployment.DeploymentException: Invalid
> phases please recheck axis2.xml {0} for the handler {1}
>         at
>
org.apache.axis2.deployment.util.PhasesInfo.getGlobalInflow(PhasesInfo.j
> ava:111)
>         at
>
org.apache.axis2.deployment.DeploymentEngine.validateSystemPredefinedPha
> ses(DeploymentEngine.java:817)
>         at
>
org.apache.axis2.deployment.DeploymentEngine.loadRepository(DeploymentEn
> gine.java:115)
>         ... 4 more
> Exception in thread "main"
>
> I have attached the axis2.xml file along with this also.
>
> Thanks,
> Amit Soni
>
> -----Original Message-----
> From: Paul Fremantle [mailto:pzfreo@gmail.com]
> Sent: Thursday, December 28, 2006 8:01 PM
> To: axis-user@ws.apache.org
> Subject: Re: soap header in axis2
>
> Amit
>
> You seem to have found a bug in the WSDL2Java toolkit. I can't see
> anything obviously wrong with your WSDL, and it validates with both
> Eclipse and Axis1.4. Can you please raise a JIRA including your
> WSDL/XSDs as an attachment?
>
> Here is the link to rampart1.0 in the meantime:
> http://apache.rmplc.co.uk/ws/axis2/modules/rampart/1_0/rampart-1.0.mar
>
> Paul
>
> On 12/28/06, Amit G Soni <Am...@mphasis.com> wrote:
> > Hi Paul,
> >
> > I am trying to find rampath-1.0 but I am not able to fine any link
> from
> > which version 1.0 I can download.
> >
> > But after that I am trying the same with Axis2-1.1
> >
> > But in this case it gives me following exception.
> >
> > C:\axis211>wsdl2java -uri c:\test\CardholderService.wsdl -p com.test
> -d
> > none
> > Using AXIS2_HOME:   C:\Java\axis2-1.1
> > Using JAVA_HOME:    C:\Java\j2sdk1.4.2_13
> > Retrieving schema at 'CardholderData.xsd', relative to
> 'file:/c:/test/'.
> > Retrieving schema at 'CardholderMessages.xsd', relative to
> > 'file:/c:/test/'.
> > Retrieving schema at 'CardholderData.xsd', relative to
> > 'file:/c:/test/CardholderMessages.xsd'.
> > Retrieving schema at 'OperationResults.xsd', relative to
> > 'file:/c:/test/CardholderMessages.xsd'.
> > Retrieving schema at 'OperationResults.xsd', relative to
> > 'file:/c:/test/'.
> > Dec 28, 2006 7:10:25 PM
> > org.apache.axis2.description.WSDL11ToAxisServiceBuilder
> populateService
> > SEVERE: java.lang.NullPointerException
> > Exception in thread "main"
> > org.apache.axis2.wsdl.codegen.CodeGenerationException: Error parsing
> > WSDL
> >         at
> >
>
org.apache.axis2.wsdl.codegen.CodeGenerationEngine.<init>(CodeGeneration
> > Engine.java:112)
> >         at org.apache.axis2.wsdl.WSDL2Code.main(WSDL2Code.java:32)
> >         at org.apache.axis2.wsdl.WSDL2Java.main(WSDL2Java.java:21)
> > Caused by: org.apache.axis2.AxisFault: null; nested exception is:
> >         java.lang.NullPointerException
> >         at
> >
>
org.apache.axis2.description.WSDL11ToAxisServiceBuilder.populateService(
> > WSDL11ToAxisServiceBuilder.java:250)
> >         at
> >
>
org.apache.axis2.wsdl.codegen.CodeGenerationEngine.<init>(CodeGeneration
> > Engine.java:103)
> >         ... 2 more
> > Caused by: java.lang.NullPointerException
> >         at
> >
>
org.apache.axis2.description.WSDL11ToAxisServiceBuilder.populateService(
> > WSDL11ToAxisServiceBuilder.java:235)
> >         ... 3 more
> >
> > Can you have any idea why it is happens.
> >
> > I am also attaching my wsdl file along with the mail.
> >
> > Thanks,
> > Amit Soni
> >
> >
> > -----Original Message-----
> > From: Paul Fremantle [mailto:pzfreo@gmail.com]
> > Sent: Thursday, December 28, 2006 6:30 PM
> > To: axis-user@ws.apache.org
> > Subject: Re: soap header in axis2
> >
> > Amit
> >
> > No, rampart 1.1 is expected to be used with Axis2 1.1.
> >
> > If you can move to 1.1 you should, because of the large number of
bugs
> > fixed!
> >
> > Otherwise there is rampart1.0 available.
> >
> > Paul
> >
> > On 12/28/06, Amit G Soni <Am...@mphasis.com> wrote:
> > > 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:pzfreo@gmail.com]
> > > Sent: Thursday, December 28, 2006 4:17 PM
> > > To: axis-user@ws.apache.org
> > > 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 <Am...@mphasis.com> 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
> > > paul@wso2.com
> > >
> > > "Oxygenating the Web Service Platform", www.wso2.com
> > >
> > >
> ---------------------------------------------------------------------
> > > 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
> > >
> > >
> >
> >
> > --
> > Paul Fremantle
> > VP/Technology, WSO2 and OASIS WS-RX TC Co-chair
> >
> > http://bloglines.com/blog/paulfremantle
> > paul@wso2.com
> >
> > "Oxygenating the Web Service Platform", www.wso2.com
> >
> >
---------------------------------------------------------------------
> > 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
> >
> >
> >
>
>
> --
> Paul Fremantle
> VP/Technology, WSO2 and OASIS WS-RX TC Co-chair
>
> http://bloglines.com/blog/paulfremantle
> paul@wso2.com
>
> "Oxygenating the Web Service Platform", www.wso2.com
>
> ---------------------------------------------------------------------
> 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
>
>
>


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

http://bloglines.com/blog/paulfremantle
paul@wso2.com

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

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


Re: soap header in axis2

Posted by Paul Fremantle <pz...@gmail.com>.
Amit

You seem to have cut out the phases from axis2.xml. The config needs
the phases defined. That is how it figures out how to interleave the
security handlers. If you take the standard axis2.xml and add those
lines:
<module ref="rampart" />
	<parameter name="OutflowSecurity">
    	<action>
        	<items>UsernameToken Timestamp</items>
        	<user>wfws</user>
        	<passwordCallbackClass>com.test.PWCallback</passwordCallbackClass>
      	</action>
    </parameter>

Paul

On 12/28/06, Amit G Soni <Am...@mphasis.com> wrote:
> Hi Paul,
>
> Thanks a lot for all of your help.
>
> I have executed the same wsdl with axis-1.4 successfully but in axis2 it
> gives these error. I between I have downloaded the rampart-1.0.mar file
> but when I am running following line of code it gives me exception.
>
> ConfigurationContext context = ConfigurationContextFactory
> .createConfigurationContextFromFileSystem(
> "resources", "resources/axis2.xml");
>
>
> log4j:WARN No appenders could be found for logger
> (org.apache.axiom.om.impl.builder.StAXOMBuilder).
> log4j:WARN Please initialize the log4j system properly.
> org.apache.axis2.deployment.DeploymentException: Invalid phases please
> recheck axis2.xml {0} for the handler {1}; nested exception is:
>         org.apache.axis2.deployment.DeploymentException: Invalid phases
> please recheck axis2.xml {0} for the handler {1}
>         at
> org.apache.axis2.deployment.DeploymentEngine.loadRepository(DeploymentEn
> gine.java:117)
>         at
> org.apache.axis2.deployment.FileSystemConfigurator.getAxisConfiguration(
> FileSystemConfigurator.java:120)
>         at
> org.apache.axis2.context.ConfigurationContextFactory.createConfiguration
> Context(ConfigurationContextFactory.java:38)
>         at
> org.apache.axis2.context.ConfigurationContextFactory.createConfiguration
> ContextFromFileSystem(ConfigurationContextFactory.java:90)
>         at com.test.TestClient.main(TestClient.java:15)
> Caused by: org.apache.axis2.deployment.DeploymentException: Invalid
> phases please recheck axis2.xml {0} for the handler {1}
>         at
> org.apache.axis2.deployment.util.PhasesInfo.getGlobalInflow(PhasesInfo.j
> ava:111)
>         at
> org.apache.axis2.deployment.DeploymentEngine.validateSystemPredefinedPha
> ses(DeploymentEngine.java:817)
>         at
> org.apache.axis2.deployment.DeploymentEngine.loadRepository(DeploymentEn
> gine.java:115)
>         ... 4 more
> Exception in thread "main"
>
> I have attached the axis2.xml file along with this also.
>
> Thanks,
> Amit Soni
>
> -----Original Message-----
> From: Paul Fremantle [mailto:pzfreo@gmail.com]
> Sent: Thursday, December 28, 2006 8:01 PM
> To: axis-user@ws.apache.org
> Subject: Re: soap header in axis2
>
> Amit
>
> You seem to have found a bug in the WSDL2Java toolkit. I can't see
> anything obviously wrong with your WSDL, and it validates with both
> Eclipse and Axis1.4. Can you please raise a JIRA including your
> WSDL/XSDs as an attachment?
>
> Here is the link to rampart1.0 in the meantime:
> http://apache.rmplc.co.uk/ws/axis2/modules/rampart/1_0/rampart-1.0.mar
>
> Paul
>
> On 12/28/06, Amit G Soni <Am...@mphasis.com> wrote:
> > Hi Paul,
> >
> > I am trying to find rampath-1.0 but I am not able to fine any link
> from
> > which version 1.0 I can download.
> >
> > But after that I am trying the same with Axis2-1.1
> >
> > But in this case it gives me following exception.
> >
> > C:\axis211>wsdl2java -uri c:\test\CardholderService.wsdl -p com.test
> -d
> > none
> > Using AXIS2_HOME:   C:\Java\axis2-1.1
> > Using JAVA_HOME:    C:\Java\j2sdk1.4.2_13
> > Retrieving schema at 'CardholderData.xsd', relative to
> 'file:/c:/test/'.
> > Retrieving schema at 'CardholderMessages.xsd', relative to
> > 'file:/c:/test/'.
> > Retrieving schema at 'CardholderData.xsd', relative to
> > 'file:/c:/test/CardholderMessages.xsd'.
> > Retrieving schema at 'OperationResults.xsd', relative to
> > 'file:/c:/test/CardholderMessages.xsd'.
> > Retrieving schema at 'OperationResults.xsd', relative to
> > 'file:/c:/test/'.
> > Dec 28, 2006 7:10:25 PM
> > org.apache.axis2.description.WSDL11ToAxisServiceBuilder
> populateService
> > SEVERE: java.lang.NullPointerException
> > Exception in thread "main"
> > org.apache.axis2.wsdl.codegen.CodeGenerationException: Error parsing
> > WSDL
> >         at
> >
> org.apache.axis2.wsdl.codegen.CodeGenerationEngine.<init>(CodeGeneration
> > Engine.java:112)
> >         at org.apache.axis2.wsdl.WSDL2Code.main(WSDL2Code.java:32)
> >         at org.apache.axis2.wsdl.WSDL2Java.main(WSDL2Java.java:21)
> > Caused by: org.apache.axis2.AxisFault: null; nested exception is:
> >         java.lang.NullPointerException
> >         at
> >
> org.apache.axis2.description.WSDL11ToAxisServiceBuilder.populateService(
> > WSDL11ToAxisServiceBuilder.java:250)
> >         at
> >
> org.apache.axis2.wsdl.codegen.CodeGenerationEngine.<init>(CodeGeneration
> > Engine.java:103)
> >         ... 2 more
> > Caused by: java.lang.NullPointerException
> >         at
> >
> org.apache.axis2.description.WSDL11ToAxisServiceBuilder.populateService(
> > WSDL11ToAxisServiceBuilder.java:235)
> >         ... 3 more
> >
> > Can you have any idea why it is happens.
> >
> > I am also attaching my wsdl file along with the mail.
> >
> > Thanks,
> > Amit Soni
> >
> >
> > -----Original Message-----
> > From: Paul Fremantle [mailto:pzfreo@gmail.com]
> > Sent: Thursday, December 28, 2006 6:30 PM
> > To: axis-user@ws.apache.org
> > Subject: Re: soap header in axis2
> >
> > Amit
> >
> > No, rampart 1.1 is expected to be used with Axis2 1.1.
> >
> > If you can move to 1.1 you should, because of the large number of bugs
> > fixed!
> >
> > Otherwise there is rampart1.0 available.
> >
> > Paul
> >
> > On 12/28/06, Amit G Soni <Am...@mphasis.com> wrote:
> > > 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:pzfreo@gmail.com]
> > > Sent: Thursday, December 28, 2006 4:17 PM
> > > To: axis-user@ws.apache.org
> > > 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 <Am...@mphasis.com> 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
> > > paul@wso2.com
> > >
> > > "Oxygenating the Web Service Platform", www.wso2.com
> > >
> > >
> ---------------------------------------------------------------------
> > > 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
> > >
> > >
> >
> >
> > --
> > Paul Fremantle
> > VP/Technology, WSO2 and OASIS WS-RX TC Co-chair
> >
> > http://bloglines.com/blog/paulfremantle
> > paul@wso2.com
> >
> > "Oxygenating the Web Service Platform", www.wso2.com
> >
> > ---------------------------------------------------------------------
> > 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
> >
> >
> >
>
>
> --
> Paul Fremantle
> VP/Technology, WSO2 and OASIS WS-RX TC Co-chair
>
> http://bloglines.com/blog/paulfremantle
> paul@wso2.com
>
> "Oxygenating the Web Service Platform", www.wso2.com
>
> ---------------------------------------------------------------------
> 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
>
>
>


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

http://bloglines.com/blog/paulfremantle
paul@wso2.com

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

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


RE: soap header in axis2

Posted by Amit G Soni <Am...@mphasis.com>.
Hi Paul,

Thanks a lot for all of your help.

I have executed the same wsdl with axis-1.4 successfully but in axis2 it
gives these error. I between I have downloaded the rampart-1.0.mar file
but when I am running following line of code it gives me exception.

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


log4j:WARN No appenders could be found for logger
(org.apache.axiom.om.impl.builder.StAXOMBuilder).
log4j:WARN Please initialize the log4j system properly.
org.apache.axis2.deployment.DeploymentException: Invalid phases please
recheck axis2.xml {0} for the handler {1}; nested exception is: 
	org.apache.axis2.deployment.DeploymentException: Invalid phases
please recheck axis2.xml {0} for the handler {1}
	at
org.apache.axis2.deployment.DeploymentEngine.loadRepository(DeploymentEn
gine.java:117)
	at
org.apache.axis2.deployment.FileSystemConfigurator.getAxisConfiguration(
FileSystemConfigurator.java:120)
	at
org.apache.axis2.context.ConfigurationContextFactory.createConfiguration
Context(ConfigurationContextFactory.java:38)
	at
org.apache.axis2.context.ConfigurationContextFactory.createConfiguration
ContextFromFileSystem(ConfigurationContextFactory.java:90)
	at com.test.TestClient.main(TestClient.java:15)
Caused by: org.apache.axis2.deployment.DeploymentException: Invalid
phases please recheck axis2.xml {0} for the handler {1}
	at
org.apache.axis2.deployment.util.PhasesInfo.getGlobalInflow(PhasesInfo.j
ava:111)
	at
org.apache.axis2.deployment.DeploymentEngine.validateSystemPredefinedPha
ses(DeploymentEngine.java:817)
	at
org.apache.axis2.deployment.DeploymentEngine.loadRepository(DeploymentEn
gine.java:115)
	... 4 more
Exception in thread "main"

I have attached the axis2.xml file along with this also.

Thanks,
Amit Soni

-----Original Message-----
From: Paul Fremantle [mailto:pzfreo@gmail.com] 
Sent: Thursday, December 28, 2006 8:01 PM
To: axis-user@ws.apache.org
Subject: Re: soap header in axis2

Amit

You seem to have found a bug in the WSDL2Java toolkit. I can't see
anything obviously wrong with your WSDL, and it validates with both
Eclipse and Axis1.4. Can you please raise a JIRA including your
WSDL/XSDs as an attachment?

Here is the link to rampart1.0 in the meantime:
http://apache.rmplc.co.uk/ws/axis2/modules/rampart/1_0/rampart-1.0.mar

Paul

On 12/28/06, Amit G Soni <Am...@mphasis.com> wrote:
> Hi Paul,
>
> I am trying to find rampath-1.0 but I am not able to fine any link
from
> which version 1.0 I can download.
>
> But after that I am trying the same with Axis2-1.1
>
> But in this case it gives me following exception.
>
> C:\axis211>wsdl2java -uri c:\test\CardholderService.wsdl -p com.test
-d
> none
> Using AXIS2_HOME:   C:\Java\axis2-1.1
> Using JAVA_HOME:    C:\Java\j2sdk1.4.2_13
> Retrieving schema at 'CardholderData.xsd', relative to
'file:/c:/test/'.
> Retrieving schema at 'CardholderMessages.xsd', relative to
> 'file:/c:/test/'.
> Retrieving schema at 'CardholderData.xsd', relative to
> 'file:/c:/test/CardholderMessages.xsd'.
> Retrieving schema at 'OperationResults.xsd', relative to
> 'file:/c:/test/CardholderMessages.xsd'.
> Retrieving schema at 'OperationResults.xsd', relative to
> 'file:/c:/test/'.
> Dec 28, 2006 7:10:25 PM
> org.apache.axis2.description.WSDL11ToAxisServiceBuilder
populateService
> SEVERE: java.lang.NullPointerException
> Exception in thread "main"
> org.apache.axis2.wsdl.codegen.CodeGenerationException: Error parsing
> WSDL
>         at
>
org.apache.axis2.wsdl.codegen.CodeGenerationEngine.<init>(CodeGeneration
> Engine.java:112)
>         at org.apache.axis2.wsdl.WSDL2Code.main(WSDL2Code.java:32)
>         at org.apache.axis2.wsdl.WSDL2Java.main(WSDL2Java.java:21)
> Caused by: org.apache.axis2.AxisFault: null; nested exception is:
>         java.lang.NullPointerException
>         at
>
org.apache.axis2.description.WSDL11ToAxisServiceBuilder.populateService(
> WSDL11ToAxisServiceBuilder.java:250)
>         at
>
org.apache.axis2.wsdl.codegen.CodeGenerationEngine.<init>(CodeGeneration
> Engine.java:103)
>         ... 2 more
> Caused by: java.lang.NullPointerException
>         at
>
org.apache.axis2.description.WSDL11ToAxisServiceBuilder.populateService(
> WSDL11ToAxisServiceBuilder.java:235)
>         ... 3 more
>
> Can you have any idea why it is happens.
>
> I am also attaching my wsdl file along with the mail.
>
> Thanks,
> Amit Soni
>
>
> -----Original Message-----
> From: Paul Fremantle [mailto:pzfreo@gmail.com]
> Sent: Thursday, December 28, 2006 6:30 PM
> To: axis-user@ws.apache.org
> Subject: Re: soap header in axis2
>
> Amit
>
> No, rampart 1.1 is expected to be used with Axis2 1.1.
>
> If you can move to 1.1 you should, because of the large number of bugs
> fixed!
>
> Otherwise there is rampart1.0 available.
>
> Paul
>
> On 12/28/06, Amit G Soni <Am...@mphasis.com> wrote:
> > 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:pzfreo@gmail.com]
> > Sent: Thursday, December 28, 2006 4:17 PM
> > To: axis-user@ws.apache.org
> > 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 <Am...@mphasis.com> 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
> > paul@wso2.com
> >
> > "Oxygenating the Web Service Platform", www.wso2.com
> >
> >
---------------------------------------------------------------------
> > 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
> >
> >
>
>
> --
> Paul Fremantle
> VP/Technology, WSO2 and OASIS WS-RX TC Co-chair
>
> http://bloglines.com/blog/paulfremantle
> paul@wso2.com
>
> "Oxygenating the Web Service Platform", www.wso2.com
>
> ---------------------------------------------------------------------
> 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
>
>
>


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

http://bloglines.com/blog/paulfremantle
paul@wso2.com

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

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


Re: soap header in axis2

Posted by Paul Fremantle <pz...@gmail.com>.
Amit

You seem to have found a bug in the WSDL2Java toolkit. I can't see
anything obviously wrong with your WSDL, and it validates with both
Eclipse and Axis1.4. Can you please raise a JIRA including your
WSDL/XSDs as an attachment?

Here is the link to rampart1.0 in the meantime:
http://apache.rmplc.co.uk/ws/axis2/modules/rampart/1_0/rampart-1.0.mar

Paul

On 12/28/06, Amit G Soni <Am...@mphasis.com> wrote:
> Hi Paul,
>
> I am trying to find rampath-1.0 but I am not able to fine any link from
> which version 1.0 I can download.
>
> But after that I am trying the same with Axis2-1.1
>
> But in this case it gives me following exception.
>
> C:\axis211>wsdl2java -uri c:\test\CardholderService.wsdl -p com.test -d
> none
> Using AXIS2_HOME:   C:\Java\axis2-1.1
> Using JAVA_HOME:    C:\Java\j2sdk1.4.2_13
> Retrieving schema at 'CardholderData.xsd', relative to 'file:/c:/test/'.
> Retrieving schema at 'CardholderMessages.xsd', relative to
> 'file:/c:/test/'.
> Retrieving schema at 'CardholderData.xsd', relative to
> 'file:/c:/test/CardholderMessages.xsd'.
> Retrieving schema at 'OperationResults.xsd', relative to
> 'file:/c:/test/CardholderMessages.xsd'.
> Retrieving schema at 'OperationResults.xsd', relative to
> 'file:/c:/test/'.
> Dec 28, 2006 7:10:25 PM
> org.apache.axis2.description.WSDL11ToAxisServiceBuilder populateService
> SEVERE: java.lang.NullPointerException
> Exception in thread "main"
> org.apache.axis2.wsdl.codegen.CodeGenerationException: Error parsing
> WSDL
>         at
> org.apache.axis2.wsdl.codegen.CodeGenerationEngine.<init>(CodeGeneration
> Engine.java:112)
>         at org.apache.axis2.wsdl.WSDL2Code.main(WSDL2Code.java:32)
>         at org.apache.axis2.wsdl.WSDL2Java.main(WSDL2Java.java:21)
> Caused by: org.apache.axis2.AxisFault: null; nested exception is:
>         java.lang.NullPointerException
>         at
> org.apache.axis2.description.WSDL11ToAxisServiceBuilder.populateService(
> WSDL11ToAxisServiceBuilder.java:250)
>         at
> org.apache.axis2.wsdl.codegen.CodeGenerationEngine.<init>(CodeGeneration
> Engine.java:103)
>         ... 2 more
> Caused by: java.lang.NullPointerException
>         at
> org.apache.axis2.description.WSDL11ToAxisServiceBuilder.populateService(
> WSDL11ToAxisServiceBuilder.java:235)
>         ... 3 more
>
> Can you have any idea why it is happens.
>
> I am also attaching my wsdl file along with the mail.
>
> Thanks,
> Amit Soni
>
>
> -----Original Message-----
> From: Paul Fremantle [mailto:pzfreo@gmail.com]
> Sent: Thursday, December 28, 2006 6:30 PM
> To: axis-user@ws.apache.org
> Subject: Re: soap header in axis2
>
> Amit
>
> No, rampart 1.1 is expected to be used with Axis2 1.1.
>
> If you can move to 1.1 you should, because of the large number of bugs
> fixed!
>
> Otherwise there is rampart1.0 available.
>
> Paul
>
> On 12/28/06, Amit G Soni <Am...@mphasis.com> wrote:
> > 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:pzfreo@gmail.com]
> > Sent: Thursday, December 28, 2006 4:17 PM
> > To: axis-user@ws.apache.org
> > 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 <Am...@mphasis.com> 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
> > paul@wso2.com
> >
> > "Oxygenating the Web Service Platform", www.wso2.com
> >
> > ---------------------------------------------------------------------
> > 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
> >
> >
>
>
> --
> Paul Fremantle
> VP/Technology, WSO2 and OASIS WS-RX TC Co-chair
>
> http://bloglines.com/blog/paulfremantle
> paul@wso2.com
>
> "Oxygenating the Web Service Platform", www.wso2.com
>
> ---------------------------------------------------------------------
> 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
>
>
>


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

http://bloglines.com/blog/paulfremantle
paul@wso2.com

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

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


RE: soap header in axis2

Posted by Amit G Soni <Am...@mphasis.com>.
Hi Paul,

I am trying to find rampath-1.0 but I am not able to fine any link from
which version 1.0 I can download. 

But after that I am trying the same with Axis2-1.1

But in this case it gives me following exception.

C:\axis211>wsdl2java -uri c:\test\CardholderService.wsdl -p com.test -d
none 
Using AXIS2_HOME:   C:\Java\axis2-1.1
Using JAVA_HOME:    C:\Java\j2sdk1.4.2_13
Retrieving schema at 'CardholderData.xsd', relative to 'file:/c:/test/'.
Retrieving schema at 'CardholderMessages.xsd', relative to
'file:/c:/test/'.
Retrieving schema at 'CardholderData.xsd', relative to
'file:/c:/test/CardholderMessages.xsd'.
Retrieving schema at 'OperationResults.xsd', relative to
'file:/c:/test/CardholderMessages.xsd'.
Retrieving schema at 'OperationResults.xsd', relative to
'file:/c:/test/'.
Dec 28, 2006 7:10:25 PM
org.apache.axis2.description.WSDL11ToAxisServiceBuilder populateService
SEVERE: java.lang.NullPointerException
Exception in thread "main"
org.apache.axis2.wsdl.codegen.CodeGenerationException: Error parsing
WSDL
        at
org.apache.axis2.wsdl.codegen.CodeGenerationEngine.<init>(CodeGeneration
Engine.java:112)
        at org.apache.axis2.wsdl.WSDL2Code.main(WSDL2Code.java:32)
        at org.apache.axis2.wsdl.WSDL2Java.main(WSDL2Java.java:21)
Caused by: org.apache.axis2.AxisFault: null; nested exception is:
        java.lang.NullPointerException
        at
org.apache.axis2.description.WSDL11ToAxisServiceBuilder.populateService(
WSDL11ToAxisServiceBuilder.java:250)
        at
org.apache.axis2.wsdl.codegen.CodeGenerationEngine.<init>(CodeGeneration
Engine.java:103)
        ... 2 more
Caused by: java.lang.NullPointerException
        at
org.apache.axis2.description.WSDL11ToAxisServiceBuilder.populateService(
WSDL11ToAxisServiceBuilder.java:235)
        ... 3 more

Can you have any idea why it is happens.

I am also attaching my wsdl file along with the mail.

Thanks,
Amit Soni


-----Original Message-----
From: Paul Fremantle [mailto:pzfreo@gmail.com] 
Sent: Thursday, December 28, 2006 6:30 PM
To: axis-user@ws.apache.org
Subject: Re: soap header in axis2

Amit

No, rampart 1.1 is expected to be used with Axis2 1.1.

If you can move to 1.1 you should, because of the large number of bugs
fixed!

Otherwise there is rampart1.0 available.

Paul

On 12/28/06, Amit G Soni <Am...@mphasis.com> wrote:
> 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:pzfreo@gmail.com]
> Sent: Thursday, December 28, 2006 4:17 PM
> To: axis-user@ws.apache.org
> 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 <Am...@mphasis.com> 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
> paul@wso2.com
>
> "Oxygenating the Web Service Platform", www.wso2.com
>
> ---------------------------------------------------------------------
> 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
>
>


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

http://bloglines.com/blog/paulfremantle
paul@wso2.com

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

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


Re: soap header in axis2

Posted by Paul Fremantle <pz...@gmail.com>.
Amit

No, rampart 1.1 is expected to be used with Axis2 1.1.

If you can move to 1.1 you should, because of the large number of bugs fixed!

Otherwise there is rampart1.0 available.

Paul

On 12/28/06, Amit G Soni <Am...@mphasis.com> wrote:
> 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:pzfreo@gmail.com]
> Sent: Thursday, December 28, 2006 4:17 PM
> To: axis-user@ws.apache.org
> 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 <Am...@mphasis.com> 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
> paul@wso2.com
>
> "Oxygenating the Web Service Platform", www.wso2.com
>
> ---------------------------------------------------------------------
> 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
>
>


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

http://bloglines.com/blog/paulfremantle
paul@wso2.com

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

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


RE: soap header in axis2

Posted by Amit G Soni <Am...@mphasis.com>.
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.

Thanks,
Amit Soni

-----Original Message-----
From: Paul Fremantle [mailto:pzfreo@gmail.com] 
Sent: Thursday, December 28, 2006 4:17 PM
To: axis-user@ws.apache.org
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 <Am...@mphasis.com> 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
paul@wso2.com

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

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


RE: soap header in axis2

Posted by Amit G Soni <Am...@mphasis.com>.
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:pzfreo@gmail.com] 
Sent: Thursday, December 28, 2006 4:17 PM
To: axis-user@ws.apache.org
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 <Am...@mphasis.com> 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
paul@wso2.com

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

---------------------------------------------------------------------
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: soap header in axis2

Posted by Paul Fremantle <pz...@gmail.com>.
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 <Am...@mphasis.com> 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.HelloWorldRequest;
>
>
>
> 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://services.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-secext-1.0.xsd">
>
> <wsse:UsernameToken xmlns:wsu =
> "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-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
paul@wso2.com

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

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