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 Travis Tabbal <tr...@tabbal.net> on 2006/12/18 17:40:34 UTC

[Axis2] Can I get the raw XML?

I have a service I generated with WSDL2Java. Now some developers want
the ability to run things like XSLT on the raw XML packet. How do I go
about getting the XML message from the web service call and keep
databinding for those that want it?

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


Re: [Axis2 1.1] FileSystemConfigurator

Posted by Deepal Jayasinghe <de...@opensource.lk>.
Hi Daniel ;

I just checked that and it work for me .

Thanks
Deepal

> Hi,
>
> I having some troubles with the FileSystemConfigurator.
> If I set both the repository dir and the axis configuration file,
> (like in the code sample) it seams like the config File is ignored.
> The modules are loaded, but not used in the send message.
>
> If I set null for the repository dir it works. But eclipse can't
> handle *.mar files in the class path :-(
>
> so what can I do?
>
>
> Thank you
> -- Daniel Wehrle
>
> ----------------------------------------------------------------------------------------------------------------------
>
> public ConfigurationContext getConfigContext() throws
> MalformedURLException, AxisFault{
>        File f = new File("iJCli.axis2.xml");
>        URL axis2URL = f.toURL();
>        System.out.println(axis2URL.getPath());
>        File dir1 = new File (".");
>        // Create the Configuration including Repository and
> Configuration file
>        FileSystemConfigurator cfg8r = new
> FileSystemConfigurator(dir1.getAbsolutePath(),
> axis2URL.getPath());              AxisConfiguration cfg =
> cfg8r.getAxisConfiguration();
>        //HashMap map = cfg.getModules();
>        return new ConfigurationContext(cfg);
>    }// -- getConfigContext
> ----------------------------------------------------------------------------------------------------------------------
>
> Dec 19, 2006 10:50:28 AM org.apache.axis2.deployment.DeploymentEngine
> prepareRepository
> INFO: no services directory found under Y:\workspace-1.1\axisNightly
> Dec 19, 2006 10:50:28 AM org.apache.axis2.deployment.DeploymentEngine
> doDeploy
> INFO: Deploying module : addressing-1.1
> Dec 19, 2006 10:50:28 AM org.apache.axis2.deployment.DeploymentEngine
> doDeploy
> INFO: Deploying module : rahas-1.1
> Dec 19, 2006 10:50:28 AM org.apache.axis2.deployment.DeploymentEngine
> doDeploy
> INFO: Deploying module : rampart-1.1
> Exception in thread "main" org.apache.axis2.AxisFault:
> Microsoft.Web.Services3.Security.SecurityFault: Header
> http://schemas.xmlsoap.org/ws/2004/08/addressing:Action for ultimate
> recipient is required but not present in the message.
>   at
> Microsoft.Web.Services3.Design.RequireSoapHeaderAssertion.RequireSoapHeaderFilter.ProcessMessage(SoapEnvelope
> envelope)
>   at Microsoft.Web.Services3.Pipeline.ProcessInputMessage(SoapEnvelope
> envelope)
>   at Microsoft.Web.Services3.WseProtocol.FilterRequest(SoapEnvelope
> requestEnvelope)
>   at
> Microsoft.Web.Services3.WseProtocol.RouteRequest(SoapServerMessage
> message)
>   at System.Web.Services.Protocols.SoapServerProtocol.Initialize()
>   at System.Web.Services.Protocols.ServerProtocolFactory.Create(Type
> type, HttpContext context, HttpRequest request, HttpResponse response,
> Boolean& abortProcessing)
>    at
> org.apache.axis2.description.OutInAxisOperationClient.execute(OutInAxisOperation.java:308)
>
>    at com.iternity.www.WormRaidStub.GetSystemInfo(WormRaidStub.java:663)
>    at start.iTernityHelper.GetSytemInfo(iTernityHelper.java:349)
>    at start.iTernityHelper.switchCommand(iTernityHelper.java:106)
>    at start.iTernityHelper.main(iTernityHelper.java:97)
> ----------------------------------------------------------------------------------------------------------------------
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>
>

-- 
Thanks,
Deepal
................................................................
"The highest tower is built one brick at a time"



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


[Axis2 1.1] FileSystemConfigurator

Posted by Daniel Wehrle <we...@daniel-wehrle.de>.
Hi,

I having some troubles with the FileSystemConfigurator.
If I set both the repository dir and the axis configuration file, (like 
in the code sample) it seams like the config File is ignored.
The modules are loaded, but not used in the send message.

If I set null for the repository dir it works. But eclipse can't handle 
*.mar files in the class path :-(

so what can I do?


Thank you
-- Daniel Wehrle

----------------------------------------------------------------------------------------------------------------------
public ConfigurationContext getConfigContext() throws 
MalformedURLException, AxisFault{
        File f = new File("iJCli.axis2.xml");
        URL axis2URL = f.toURL();
        System.out.println(axis2URL.getPath());
        File dir1 = new File (".");
        // Create the Configuration including Repository and 
Configuration file
        FileSystemConfigurator cfg8r = new 
FileSystemConfigurator(dir1.getAbsolutePath(), axis2URL.getPath());       
        AxisConfiguration cfg = cfg8r.getAxisConfiguration();
        //HashMap map = cfg.getModules();
        return new ConfigurationContext(cfg);
    }// -- getConfigContext
----------------------------------------------------------------------------------------------------------------------
Dec 19, 2006 10:50:28 AM org.apache.axis2.deployment.DeploymentEngine 
prepareRepository
INFO: no services directory found under Y:\workspace-1.1\axisNightly
Dec 19, 2006 10:50:28 AM org.apache.axis2.deployment.DeploymentEngine 
doDeploy
INFO: Deploying module : addressing-1.1
Dec 19, 2006 10:50:28 AM org.apache.axis2.deployment.DeploymentEngine 
doDeploy
INFO: Deploying module : rahas-1.1
Dec 19, 2006 10:50:28 AM org.apache.axis2.deployment.DeploymentEngine 
doDeploy
INFO: Deploying module : rampart-1.1
Exception in thread "main" org.apache.axis2.AxisFault: 
Microsoft.Web.Services3.Security.SecurityFault: Header 
http://schemas.xmlsoap.org/ws/2004/08/addressing:Action for ultimate 
recipient is required but not present in the message.
   at 
Microsoft.Web.Services3.Design.RequireSoapHeaderAssertion.RequireSoapHeaderFilter.ProcessMessage(SoapEnvelope 
envelope)
   at Microsoft.Web.Services3.Pipeline.ProcessInputMessage(SoapEnvelope 
envelope)
   at Microsoft.Web.Services3.WseProtocol.FilterRequest(SoapEnvelope 
requestEnvelope)
   at Microsoft.Web.Services3.WseProtocol.RouteRequest(SoapServerMessage 
message)
   at System.Web.Services.Protocols.SoapServerProtocol.Initialize()
   at System.Web.Services.Protocols.ServerProtocolFactory.Create(Type 
type, HttpContext context, HttpRequest request, HttpResponse response, 
Boolean& abortProcessing)
    at 
org.apache.axis2.description.OutInAxisOperationClient.execute(OutInAxisOperation.java:308)
    at com.iternity.www.WormRaidStub.GetSystemInfo(WormRaidStub.java:663)
    at start.iTernityHelper.GetSytemInfo(iTernityHelper.java:349)
    at start.iTernityHelper.switchCommand(iTernityHelper.java:106)
    at start.iTernityHelper.main(iTernityHelper.java:97)
----------------------------------------------------------------------------------------------------------------------



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


Re: [Axis2] Can I get the raw XML?

Posted by Travis Tabbal <tr...@tabbal.net>.
I don't mind modding the message receivers. I want to generate with
databinding as that seems to be the simplest way to get that feature
to work. I didn't see anywhere I could get the actuall received XML in
the message receiver code though. I was looking in there for it.

I was thinking that the XML should be available to Axis2 somewhere, so
it might have an API to get it back, should I need it. I really want
both to be available.

Travis


On 12/18/06, Ajith Ranabahu <aj...@gmail.com> wrote:
> Hmm... Interesting issue. So you need to transform some of the
> messages and keep databinding for some of the messages ? I can give
> you a few options
>
> 1. The case is that WSDL2Java creates classes to go with just one
> databinding mechanism so either all messages are databound or not.
> However each databinding mechanism provides a way to convert objects
> in and out of XML. Although it may not be efficient you can convert
> the object into  an XML object model and then do the XSLT operation.
>
> 2. Generate the skels without databinding ! This may not be an option
> for you but if you do need to run XSLT transformations  and work with
> the raw XML packet then this is the best way.
>
> 3. Modifiy the message receivers. This is a somewhat complex operation
> but if you read through the generated code you will find the place
> where the XML object model is converted to the databound object. So
> you can insert the code right at that place!
>
> HTH
>
> Ajith
>
> On 12/18/06, Travis Tabbal <tr...@tabbal.net> wrote:
> > I have a service I generated with WSDL2Java. Now some developers want
> > the ability to run things like XSLT on the raw XML packet. How do I go
> > about getting the XML message from the web service call and keep
> > databinding for those that want it?
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> > For additional commands, e-mail: axis-user-help@ws.apache.org
> >
> >
>
>
> --
> Ajith Ranabahu
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>

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


Re: [Axis2] Can I get the raw XML?

Posted by Ajith Ranabahu <aj...@gmail.com>.
Hmm... Interesting issue. So you need to transform some of the
messages and keep databinding for some of the messages ? I can give
you a few options

1. The case is that WSDL2Java creates classes to go with just one
databinding mechanism so either all messages are databound or not.
However each databinding mechanism provides a way to convert objects
in and out of XML. Although it may not be efficient you can convert
the object into  an XML object model and then do the XSLT operation.

2. Generate the skels without databinding ! This may not be an option
for you but if you do need to run XSLT transformations  and work with
the raw XML packet then this is the best way.

3. Modifiy the message receivers. This is a somewhat complex operation
but if you read through the generated code you will find the place
where the XML object model is converted to the databound object. So
you can insert the code right at that place!

HTH

Ajith

On 12/18/06, Travis Tabbal <tr...@tabbal.net> wrote:
> I have a service I generated with WSDL2Java. Now some developers want
> the ability to run things like XSLT on the raw XML packet. How do I go
> about getting the XML message from the web service call and keep
> databinding for those that want it?
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>


-- 
Ajith Ranabahu

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