XML Parsing Error: prefix not bound to a namespace

2009-04-07 Thread Claire Loto

Hi,
I deployed Axis2 in my application server (I am using RESIN). I got to 
the axis2 page through 
http://localhost:8080/axis2/services/listServices. However, when I tried 
to click on the Version link under Available Services, I got an XML 
Parsing error as shown below. May I know what could possibly gone wrong?


thanks a lot,

Claire


XML Parsing Error: prefix not bound to a namespace
Location: http://localhost:8080/axis2/services/Version?wsdl
Line Number 18, Column 393:name="getVersionMessage">name="getVersionResponse">element="ns0:getVersionResponse">name="getVersionFault">element="ns0:ExceptionFault">name="VersionPortType">message="axis2:getVersionMessage" 
wsaw:Action="urn:getVersion">message="axis2:getVersionResponse">message="axis2:getVersionFault" 
name="getVersionFault">name="VersionSOAP11Binding" type="axis2:VersionPortType">transport="http://schemas.xmlsoap.org/soap/http"; 
style="document">name="getVersion">style="document">use="literal">use="literal">name="getVersionFault">name="getVersionFault">name="VersionSOAP12Binding" type="axis2:VersionPortType">transport="http://schemas.xmlsoap.org/soap/http"; 
style="document">name="getVersion">style="document">use="literal">use="literal">name="getVersionFault">name="getVersionFault">name="VersionHttpBinding" type="axis2:VersionPortType">verb="POST">name="getVersion">location="getVersion">type="text/xml">type="text/xml">name="Version">binding="axis2:VersionSOAP11Binding">location="http://192.168.0.156:8080/axis2/services/Version";>name="VersionSOAP12port_http" 
binding="axis2:VersionSOAP12Binding">location="http://192.168.0.156:8080/axis2/services/Version";>name="VersionHttpport" binding="axis2:VersionHttpBinding">location="http://192.168.0.156:8080/axis2/services/Version";>

^


[Axis2] Memory leaks with 1.4.1

2009-04-07 Thread Pantvaidya, Vishwajit
Hello,

We are using Axis1.4.1 Java for our webservice deployment as well as client 
calling - and are finding significant memory leaks in Axis2 related objects. 
Most of the leaks are already mentioned in the following:

 1.  
https://issues.apache.org/jira/browse/AXIS2-3870?page=com.atlassian.jira.plugin.syst
 2.  https://issues.apache.org/jira/browse/AXIS2-4007
 3.  
http://www.nabble.com/Axis-2-Memory-Leak-when-Client-is-instantiated-within-Service---pertains-to-edu.emory...ConcurrentHashMap--%3E-WAS%3A-Re%3A-When-do-cleanup-functions-need-to-be-called--td19631299.html#a19631370

#1 and #2 seem to have been resolved after Axis2 1.4.1 - is there a stable 
build that we can use for getting these fixes? Or is a Axis2 release with these 
fixes upcoming?
For #3, there does not seem to be any fix yet. Is that accurate? If yes, is a 
fix proposed to reduce the number of edu.emory... instances?


Thanks,

Vish.


Re: Extracting attribute values from SAML token in rampart sample 05

2009-04-07 Thread Håkon Sagehaug
Hi

Thanks for the replay, but still a little lost ;). My main question I guess
is where should I extract these attributes? I feel that this should be taken
care of before the service invocation, correct? Tried getting the message
context in my callback handler, but it was null.
 Should I create a new module for this? Is it possible to write my own
Attributecallback and say to rampart use this?

2009/4/6 Martin Gainty 

>
> //Construct RahasData from MessageContext
> http://ws.apache.org/rampart/apidocs/org/apache/rahas/RahasData.html
>

>
> //get a default handle
> SAMLCallbackHandler handler = config.getCallbackHander();

Where is config coming from?

>
> //then construct SAML AttributeCallback to retrieve the RahasData contents
>
> http://ws.apache.org/rampart/apidocs/org/apache/rahas/impl/util/SAMLAttributeCallback.html
>
>SAMLAttributeCallback cb = new SAMLAttributeCallback(data);
>SAMLCallbackHandler handler = config.getCallbackHander();
>handler.handle(cb);
>attrs = cb.getAttributes();
>
> en annen svare ?

fra norden?

cheers, håkon

>
> Martin
> __
> Verzicht und Vertraulichkeitanmerkung / Note de déni et de confidentialité
> Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene
> Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte
> Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht
> dient lediglich dem Austausch von Informationen und entfaltet keine
> rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von
> E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen.
> Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le
> destinataire prévu, nous te demandons avec bonté que pour satisfaire
> informez l'expéditeur. N'importe quelle diffusion non autorisée ou la copie
> de ceci est interdite. Ce message sert à l'information seulement et n'aura
> pas n'importe quel effet légalement obligatoire. Étant donné que les email
> peuvent facilement être sujets à la manipulation, nous ne pouvons accepter
> aucune responsabilité pour le contenu fourni.
>
>
>
>
>
>
> Date: Mon, 6 Apr 2009 17:06:59 +0200
> Subject: Extracting attribute values from SAML token in rampart sample 05
> From: hakon.sageh...@bccs.uib.no
> To: axis-user@ws.apache.org; rampart-...@ws.apache.org
>
> Hi all,
>
> I was wondering if it's possible to extract the values inside a SAML token.
> I looked at sample 05 and wanted to list out the values of the attribute
> statement, I tried this in the password call back handler
>
>
> Element el = pwcb.getCustomToken();
>
> But just got null. What I'm  trying to achieve is not just validate that
> the attributes signed by the sts but also see what attributes the client can
> give the possessing.
>
>
> How can this be done??
>
> cheers, håkon
> --
> Håkon Sagehaug, Scientific Programmer
> Parallab, Bergen Center for Computational Science (BCCS)
> UNIFOB AS (University of Bergen Research Company)
>
> _
> Rediscover Hotmail®: Now available on your iPhone or BlackBerry
>
> http://windowslive.com/RediscoverHotmail?ocid=TXT_TAGLM_WL_HM_Rediscover_Mobile1_042009
>



-- 
Håkon Sagehaug, Scientific Programmer
Parallab, Bergen Center for Computational Science (BCCS)
UNIFOB AS (University of Bergen Research Company)


Facing Problem while Implementing WSSecurity Token based Authentication

2009-04-07 Thread Sudhir Mongia
Hi,
I have created a sample Say Hello Webservice and I am trying to do basic
implementation of WSSecurity using Axis2 and RamPart.

I am following the tutorial http://wso2.org/library/3190. Apart from this
also followed the link http://wso2.org/library/3787.which addresses
the compatibility issues with Axis2 1.4 and rampart 1.4. I have policy added
in services.xml and at bindings level in WSDL. At the end when I am trying
to run it I am getting "Invalid Security Error".

Here is the details of Environment
Axis2 version :Axis2 1.4
Rampart version: Rampart 1.4
Application Server :JBoss 4.0.5

WSDL file and services.xml is attached with this email.

I have pasted here request and response soap message, captured from TCPMON.
I have given the errors which I am getting on server side and client side.

Request SOAP Message


http://www.w3.org/2003/05/soap-envelope";>

http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd";
soapenv:mustUnderstand="true">
http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd";
wsu:Id="UsernameToken-31658378">
apache
http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText
">password




http://HelloWeb/xsd";>
Sudhir Mongia 1




Response Soap Message


http://www.w3.org/2003/05/soap-envelope";>


soapenv:Receiver
InvalidSecurity






Error on Client side
org.apache.axis2.AxisFault: InvalidSecurity
at
org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(Utils.java:512)
at
org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:370)
at
org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:416)
at
org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:228)
at org.apache.axis2.client.OperationClient.execute(OperationClient.java:163)
at
com.sample.webservice.client.HelloWebServiceStub.sayHello(HelloWebServiceStub.java:192)
at com.sample.webservice.client.TestWebService.main(TestWebService.java:52)

Error on Server side
16:10:00,138 INFO  [STDOUT] 16:10:00,138 ERROR [AxisEngine] InvalidSecurity
org.apache.axis2.AxisFault: InvalidSecurity
at
org.apache.rampart.handler.PostDispatchVerificationHandler.invoke(PostDispatchVerificationHandler.java:143)
at org.apache.axis2.engine.Phase.invoke(Phase.java:317)
at org.apache.axis2.engine.AxisEngine.invoke(AxisEngine.java:264)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:163)
at
org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:275)
at
org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:131)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at
org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
at
org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at
org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
at
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
at
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at
org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
at java.lang.Thread.run(Thread.java:595)


Any Pointer on this. Please let me know, if you need more information from
my side.

Thanks,
Sudhir
http://HelloWeb/"; xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"; xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"; xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"; xmlns:ns1="http://org.apache.

Re: WSDL2JAVA created uncompilable Stub

2009-04-07 Thread Jacques46

Hi Pricilla,

I'll answer you to the best of my knowledge, which is limited to how I've
used Axis so far.

The file with the word "Skeleton" in it is the only file that you should
have to modify.  The java class that you created in the first steps (to come
up with the WSDL file) probably only contained the signatures of your web
service methods.  The Skeleton file is pretty much the equivalent of your
.java file, e.g. it only contains method signatures, but it uses SOAP object
types instead of the types that you used.

Look for your method names in the skeleton file.  There should be a comment
for each of them telling you that you need to implement them (along with a
thrown exception).  In other words, for each of your methods, remove
everything between the opening and closing braces, and start coding.

The WSDL2Java process should have also created a build.xml file.  Once your
Skeleton is coded, you can right-click this build file, and choose "Run
as...", and then "Ant Build".  This will compile your classes (skeleton
included), and create the .class files and a .aar file in the "build"
sub-directory of your project (which it will create).

The .aar file is the archive that you need to deploy to a container. 
Personnally, I use Tomcat, and so that's what I'll talk to you about.

First, you need to download and install Tomcat.  Once tomcat is installed,
you need to download and install the Axis2 War Archive FOR THE SAME VERSION
OF AXIS2 THAT YOU USED TO CREATE YOUR WEB SERVICE.  

To install the .war file, you have two options : copy it to the
/webapps directory (and restart tomcat just to make sure), or
use the "Tomcat Manager" application that comes with Tomcat.  I'll let you
search a bit for that...

Once Axis2 is installed, you can access it by going to
http://:8080/axis2.  Three options will be offered there : Services,
Validate, and Admin.  You can validate your Axis2 installation with the
Validate option.

To deploy your service, again, you have two options.  1- drop your .aar file
in the /webapps/axis2/WEB-INF/services directory, or use the
deployment tool in the Admin section of axis2 (user/pass is admin/axis2). 
The deployment tool is the first option in the Admin section.

For development, I also recommend editing the
/webapps/axis2/WEB-INF/conf/axis2.xml configuration file.  The
line to edit is has "hotupdate" in it, you should set this parameter to
true.  This will make Axis re-deploy your web service every time you
overwrite the .aar file with a new one.

As for the stub, don't touch it.  It was created by WSDL2Java to match the
method signatures of your web service.  What you need to do in your client
is instantiate it, and call its methods.  It will take care of communicating
with your web service and returning you the result.

Here's a sample of my code that uses my stub.  This is the more complex
asynchronous call, for which you need to create a callback object.  The more
direct synchronous call is more intuitive... :

Dispatch request = new Dispatch();
DispatcherStub stub = new DispatcherStub("http://"; + dispatcherHost +
":8080/axis2/services/Dispatcher");
Callback callback = new Callback();
callback.setId(obj.getId());
request.setId(obj.getId());
stub.startdispatch(request, callback);

I'm sure I forgot a detail or two, but that's the essence of it.


pricilla p wrote:
> 
> Hi Jacques,
> 
> I am new to axis.
> 
> I have to develop an web service
> 
> I have followed the steps you mentioned and created a wsdl, skeleton and
> stubs.
> 
> Could you pls tell me what changes i need to make it in skeleton and stub
> files
> 
> Also pls tell me how to deploy this web service.
> 
> 
> Thanks,
> Pricilla.
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/WSDL2JAVA-created-uncompilable-Stub-tp17775033p22927751.html
Sent from the Axis - User mailing list archive at Nabble.com.



Re: webservice client

2009-04-07 Thread sudheshna iyer

Do anybody have any idea where I should mention uid and pwd before calling 
method on the web service. With out uid/pwd I was getting http authentication 
failed..

Thank you for your help.


--- On Mon, 4/6/09, sudheshna iyer  wrote:

> From: sudheshna iyer 
> Subject: webservice client
> To: axis-user@ws.apache.org
> Date: Monday, April 6, 2009, 9:49 PM
> I am faily new to Axis. I have a WSDL and I generated client
> stubs and proxies using WSDL2Java. 
> 
> But my WSDL needs uid and pwd. Classes generated are:
> 
> CustomerWSLocator 
> CustomerWS_PortType.java
> CustomerWS.java
> WebServices_CustomerWS_BinderStub.java
> 
> Which classes should I used to add my uid/pwd?


  


Block WSDL

2009-04-07 Thread Milan Tomic


Since Axis 1.4 has problems generating WSDL (when ?wsdl appended at the end of 
web service URL), is there any way to disable users to ask for WSDL by using 
?wsdl option and to force them to download valid WSDL from my web site?

Thank you in advance,
Milan



  


Re: Block WSDL

2009-04-07 Thread Sagara Gunathunga
Hi Milan,
You can package your original WSDL file  within your service's
META-INF directory  , and then use following option in the service.xml
file, this will pick up your original WSDL file instead  of automatic
generation.

 true

Thanks ,

On Tue, Apr 7, 2009 at 7:37 PM, Milan Tomic  wrote:
>
>
> Since Axis 1.4 has problems generating WSDL (when ?wsdl appended at the end 
> of web service URL), is there any way to disable users to ask for WSDL by 
> using ?wsdl option and to force them to download valid WSDL from my web site?
>
> Thank you in advance,
> Milan
>
>
>
>
>



-- 
Sagara Gunathunga

Blog - http://ssagara.blogspot.com
Web - http://sagaras.awardspace.com/


[Axis2] Setting hostname in axis2.xml ????

2009-04-07 Thread Raghu Upadhyayula
Hi,

 

I'm using Axis2 1.4 version.  I have to set the hostname in axis2.xml so
that the soap:address location in the WSDL (when user types ?wsdl) uses
that hostname instead of showing a IP address.

 

The problem I have is that my webservices war file is deployed on
multiple servers and I can't manually edit each axis2.xml file for each
server.

 

Is there any option to read the server name from some properties file &
set it to the hostname in axis2.xml programmatically?

 

Thanks

Raghu



Re: Block WSDL

2009-04-07 Thread Milan Tomic


Are you sure this will work in Axis 1.4? This sounds like axis2 solution...

Thank you very much for your time,
Milan




- Original Message 
From: Sagara Gunathunga 
To: axis-user@ws.apache.org
Sent: Tuesday, April 7, 2009 5:16:43 PM
Subject: Re: Block WSDL

Hi Milan,
You can package your original WSDL file  within your service's
META-INF directory  , and then use following option in the service.xml
file, this will pick up your original WSDL file instead  of automatic
generation.

true

Thanks ,

On Tue, Apr 7, 2009 at 7:37 PM, Milan Tomic  wrote:
>
>
> Since Axis 1.4 has problems generating WSDL (when ?wsdl appended at the end 
> of web service URL), is there any way to disable users to ask for WSDL by 
> using ?wsdl option and to force them to download valid WSDL from my web site?
>
> Thank you in advance,
> Milan
>
>
>
>
>



-- 
Sagara Gunathunga

Blog - http://ssagara.blogspot.com
Web - http://sagaras.awardspace.com/



  


Re: Block WSDL

2009-04-07 Thread Sagara Gunathunga
Ohhh Sorry , I confused  it with Axis2 :)

On Tue, Apr 7, 2009 at 9:53 PM, Milan Tomic  wrote:
>
>
> Are you sure this will work in Axis 1.4? This sounds like axis2 solution...
>
> Thank you very much for your time,
> Milan
>
>
>
>
> - Original Message 
> From: Sagara Gunathunga 
> To: axis-user@ws.apache.org
> Sent: Tuesday, April 7, 2009 5:16:43 PM
> Subject: Re: Block WSDL
>
> Hi Milan,
> You can package your original WSDL file  within your service's
> META-INF directory  , and then use following option in the service.xml
> file, this will pick up your original WSDL file instead  of automatic
> generation.
>
> true
>
> Thanks ,
>
> On Tue, Apr 7, 2009 at 7:37 PM, Milan Tomic  wrote:
>>
>>
>> Since Axis 1.4 has problems generating WSDL (when ?wsdl appended at the end 
>> of web service URL), is there any way to disable users to ask for WSDL by 
>> using ?wsdl option and to force them to download valid WSDL from my web site?
>>
>> Thank you in advance,
>> Milan
>>
>>
>>
>>
>>
>
>
>
> --
> Sagara Gunathunga
>
> Blog - http://ssagara.blogspot.com
> Web - http://sagaras.awardspace.com/
>
>
>
>
>



-- 
Sagara Gunathunga

Blog - http://ssagara.blogspot.com
Web - http://sagaras.awardspace.com/


Re: Facing Problem while Implementing WSSecurity Token based Authentication

2009-04-07 Thread Nandana Mihindukulasooriya
Hi Sudhir,
   The problem is, at the Rampart handler, effective policy is not found
correctly. Can you please try with addressing engaged ?  This will help to
pin down the issue.

thanks,
Nandana

On Tue, Apr 7, 2009 at 5:10 PM, Sudhir Mongia wrote:

> Hi,
> I have created a sample Say Hello Webservice and I am trying to do basic
> implementation of WSSecurity using Axis2 and RamPart.
>
> I am following the tutorial http://wso2.org/library/3190. Apart from this
> also followed the link http://wso2.org/library/3787.which addresses
> the compatibility issues with Axis2 1.4 and rampart 1.4. I have policy added
> in services.xml and at bindings level in WSDL. At the end when I am trying
> to run it I am getting "Invalid Security Error".
>
> Here is the details of Environment
> Axis2 version :Axis2 1.4
> Rampart version: Rampart 1.4
> Application Server :JBoss 4.0.5
>
> WSDL file and services.xml is attached with this email.
>
> I have pasted here request and response soap message, captured from TCPMON.
> I have given the errors which I am getting on server side and client side.
>
> Request SOAP Message
>
> 
> http://www.w3.org/2003/05/soap-envelope";>
>  
>  http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd";
> soapenv:mustUnderstand="true">
>  http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd";
> wsu:Id="UsernameToken-31658378">
>  apache
>  http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText
> ">password
>  
>  
>  
>  
>  http://HelloWeb/xsd";>
>  Sudhir Mongia 1
>  
>  
> 
>
> Response Soap Message
>
> 
>  http://www.w3.org/2003/05/soap-envelope
> ">
>  
>  
>
> soapenv:Receiver
>   xml:lang="en-US">InvalidSecurity
>  
>  
>  
>  
>
>
> Error on Client side
> org.apache.axis2.AxisFault: InvalidSecurity
>  at
> org.apache.axis2.util.Utils.getInboundFaultFromMessageContext(Utils.java:512)
>  at
> org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:370)
>  at
> org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:416)
>  at
> org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:228)
>  at
> org.apache.axis2.client.OperationClient.execute(OperationClient.java:163)
>  at
> com.sample.webservice.client.HelloWebServiceStub.sayHello(HelloWebServiceStub.java:192)
>  at
> com.sample.webservice.client.TestWebService.main(TestWebService.java:52)
>
> Error on Server side
> 16:10:00,138 INFO  [STDOUT] 16:10:00,138 ERROR [AxisEngine] InvalidSecurity
> org.apache.axis2.AxisFault: InvalidSecurity
> at
> org.apache.rampart.handler.PostDispatchVerificationHandler.invoke(PostDispatchVerificationHandler.java:143)
> at org.apache.axis2.engine.Phase.invoke(Phase.java:317)
> at org.apache.axis2.engine.AxisEngine.invoke(AxisEngine.java:264)
> at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:163)
> at
> org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:275)
> at
> org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:131)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
> at
> org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
> at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
> at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
> at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
> at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
> at
> org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
> at
> org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
> at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
> at
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
> at
> org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
> at
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
> at
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
> at
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
> at
> org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
> at
> org.ap

RE: [Axis2] Memory leaks with 1.4.1

2009-04-07 Thread Pantvaidya, Vishwajit
>From where can I take a stable niightly build for verifying #1 and #2?


From: Pantvaidya, Vishwajit [mailto:vpant...@selectica.com]
Sent: Tuesday, April 07, 2009 12:54 AM
To: axis-user@ws.apache.org
Subject: [Axis2] Memory leaks with 1.4.1

Hello,

We are using Axis1.4.1 Java for our webservice deployment as well as client 
calling - and are finding significant memory leaks in Axis2 related objects. 
Most of the leaks are already mentioned in the following:

 1.  
https://issues.apache.org/jira/browse/AXIS2-3870?page=com.atlassian.jira.plugin.syst
 2.  https://issues.apache.org/jira/browse/AXIS2-4007
 3.  
http://www.nabble.com/Axis-2-Memory-Leak-when-Client-is-instantiated-within-Service---pertains-to-edu.emory...ConcurrentHashMap--%3E-WAS%3A-Re%3A-When-do-cleanup-functions-need-to-be-called--td19631299.html#a19631370

#1 and #2 seem to have been resolved after Axis2 1.4.1 - is there a stable 
build that we can use for getting these fixes? Or is a Axis2 release with these 
fixes upcoming?
For #3, there does not seem to be any fix yet. Is that accurate? If yes, is a 
fix proposed to reduce the number of edu.emory... instances?


Thanks,

Vish.


problem with MTOM and attachments please help

2009-04-07 Thread Cyril Furtado
(using Axis2 1.4  & Tomcat 5.0)
I have 3 methods in my service 2 with attachments, 1 no attachments
The method without attachments runs correctly, but the ones with attachments 
don't
For server returning attachments I have method javax.activation.DataHandler 
sendAttach(String filename)
In axis2.xml I have set MTOM enable to true;
I have client generated by WSDL2Java & also example from Axis2 MTOM guide, both 
return the same error.
What am I missing???
server log shows
2009-04-07 11:50:51, DEBUG builder.StAXOMBuilder   - END_ELEMENT: 
{http://general.service.webservices.skire.com}datahandler:datahandler
2009-04-07 11:50:51, DEBUG builder.StAXOMBuilder   - END_ELEMENT: 
{http://general.service.webservices.skire.com}getAttach:getAttach
2009-04-07 11:50:51, ERROR receivers.RPCMessageReceiver-
Exception occurred while trying to invoke service method getAttach
org.apache.axis2.AxisFault: javax.activation.DataHandler
at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430)
at 
org.apache.axis2.engine.DefaultObjectSupplier.getObject(DefaultObjectSupplier.java:30)
at 
org.apache.axis2.databinding.utils.BeanUtil.deserialize(BeanUtil.java:410)
at 
org.apache.axis2.databinding.utils.BeanUtil.processObject(BeanUtil.java:722)
at 
org.apache.axis2.databinding.utils.BeanUtil.ProcessElement(BeanUtil.java:670)
at 
org.apache.axis2.databinding.utils.BeanUtil.deserialize(BeanUtil.java:602)
at 
org.apache.axis2.rpc.receivers.RPCUtil.processRequest(RPCUtil.java:153)
at 
org.apache.axis2.rpc.receivers.RPCUtil.invokeServiceClass(RPCUtil.java:188)
at 
org.apache.axis2.rpc.receivers.RPCMessageReceiver.invokeBusinessLogic(RPCMessageReceiver.java:102)
at 
org.apache.axis2.receivers.AbstractInOutMessageReceiver.invokeBusinessLogic(AbstractInOutMessageReceiver.java:40)
at 
org.apache.axis2.receivers.AbstractMessageReceiver.receive(AbstractMessageReceiver.java:100)
at 
org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:176)
at 
org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:275)
at 
org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:131)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at 
org.apache.catalina.valves.FastCommonAccessLogValve.invoke(FastCommonAccessLogValve.java:495)
at 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at 
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at 
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
at 
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
at 
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at 
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
at 
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:684)
at java.lang.Thread.run(Thread.java:595)
Caused by: java.lang.InstantiationException: javax.activation.DataHandler
at java.lang.Class.newInstance0(Class.java:335)
at java.lang.Class.newInstance(Class.java:303)
at 
org.apache.axis2.engine.DefaultObjectSupplier.getObject(DefaultObjectSupplier.java:28)


Re: [Axis2] Setting hostname in axis2.xml ????

2009-04-07 Thread Sagara Gunathunga
Hi Raghu ,
You can use same "hostname" parameter  programatically either  in
service level or module level . one possible approach is given below .

1. Implement the  "ServiceLifeCycle" interface within your service
class or as a separate class .

2. set the  value to "hostname" parameter within the startUp ( ...) method.

axisService.getAxisConfiguration().addParameter("hostname",
"myhost.com");

3. add your LifeCycle class to service.xml file.




Thanks


On Tue, Apr 7, 2009 at 9:39 PM, Raghu Upadhyayula
 wrote:
> Hi,
>
>
>
> I’m using Axis2 1.4 version.  I have to set the hostname in axis2.xml so
> that the soap:address location in the WSDL (when user types ?wsdl) uses that
> hostname instead of showing a IP address.
>
>
>
> The problem I have is that my webservices war file is deployed on multiple
> servers and I can’t manually edit each axis2.xml file for each server.
>
>
>
> Is there any option to read the server name from some properties file & set
> it to the hostname in axis2.xml programmatically?
>
>
>
> Thanks
>
> Raghu



-- 
Sagara Gunathunga

Blog - http://ssagara.blogspot.com
Web - http://sagaras.awardspace.com/


Halt message processing in handlers

2009-04-07 Thread Sirohi, Vivek
Hi All,

I have a peer web service architecture. The other web service that calls
my web service can throw a "soap:fault" . I need a way to handle this
soap fault. I don't suppose it can be done in the target business
method/operation, so I suppose I need a handler. Question is how I can
return a valid response to the other service from the handler itself. I
don't want the message to go to my business method. Throwing an
AxisFault  doesn't seem to be working either. 

 

Thanks!

 

Regards,

Vivek 

 



Problem with the "Conten-Type" in the Netbeans

2009-04-07 Thread Fabrício Cabral
Hello everybody,

I developed a Web Service (WS) using Eclipse plug-ins + axis2 1.4.1
running in Tomcat 6.0.18
(Windows). I'm using Netbeans 6.5.1 to test my WS. I set a SOAP
message in the input.xml
of the "TestCase" and do "execute". The message is sent and the
Netbeans saves the response
in the output.xml file.

My problem is when I'm using Netbeans to test my WS: it doesn't work.
If I use a client developed
by hand (using Eclipse stubs) works fine. Debugging the SOAP messages
(I used TCPMon) I figure
out that the problem is the "Content-Type" sent in the HTTP header.
Netbeans sends the Content-Type
with "text/xml" and if I change it to "application/soap+xml" (as my
Java code does) the request works fine.

So, I'd like know: the problem is Axis, Netbeans or with my Web
Services? Does anyone
know how can I fix it? Is there a way to change the Netbens "Content-Type" to
"application/soap+xml" or the problem is my WS that doesn't understand
the Content-Type
"text/xml" correctly?

Thanks in advance and sorry my poor english,

-- 
--fx


RE: [Axis2] Setting hostname in axis2.xml ????

2009-04-07 Thread Raghu Upadhyayula
Hi Sagara,

I have a skeleton class generated from WSDL2Java.  I've changed that 
skeleton class to implement the ServiceLifeCycle interface & implemented the 
startup method.

Looks like that startup method is never called, because after that 
change also I'm getting a private IP address in the soap:address location in 
WSDL.  I've put a debug point in the startup method & the control never stopped 
at the debug point.

Thanks
Raghu

-Original Message-
From: Sagara Gunathunga [mailto:sagara.gunathu...@gmail.com] 
Sent: Tuesday, April 07, 2009 2:36 PM
To: axis-user@ws.apache.org
Subject: Re: [Axis2] Setting hostname in axis2.xml 

Hi Raghu ,
You can use same "hostname" parameter  programatically either  in
service level or module level . one possible approach is given below .

1. Implement the  "ServiceLifeCycle" interface within your service
class or as a separate class .

2. set the  value to "hostname" parameter within the startUp ( ...) method.

axisService.getAxisConfiguration().addParameter("hostname",
"myhost.com");

3. add your LifeCycle class to service.xml file.




Thanks


On Tue, Apr 7, 2009 at 9:39 PM, Raghu Upadhyayula
 wrote:
> Hi,
>
>
>
> I’m using Axis2 1.4 version.  I have to set the hostname in axis2.xml so
> that the soap:address location in the WSDL (when user types ?wsdl) uses that
> hostname instead of showing a IP address.
>
>
>
> The problem I have is that my webservices war file is deployed on multiple
> servers and I can’t manually edit each axis2.xml file for each server.
>
>
>
> Is there any option to read the server name from some properties file & set
> it to the hostname in axis2.xml programmatically?
>
>
>
> Thanks
>
> Raghu



-- 
Sagara Gunathunga

Blog - http://ssagara.blogspot.com
Web - http://sagaras.awardspace.com/


policy.xml configuration for X509SecurityToken

2009-04-07 Thread Mark Kopec

Hi everyone,

Does anybody have a sample policy.xml file for Rampart that can create a 
X509SecurityToken for a .NET webservice:



for a .NET client it's something like this..

protected WebServicesClientProtocol foo(WebServicesClientProtocol ws){

..

X509SecurityToken st = new X509SecurityToken(foo);
Security sc = ws.RequestSoapConext.Security;
sc.Tokens.Add(st);
sc.Elements.Add(new MessageSignature(st));
sc.Timestamp.TtlInSeconds = ttl;

return ws;

}



I
can't find any information on how to create a policy.xml file that can
create this kind of token, there is a lot of flexibility, Asymmetric,
Symmetric binding.. etc are there any pre-packaged policy.xml's for my
situation, or any documentation that breaks down the policy.xml file so
that I can construct the SOAP header properly with this X509 token???

Thanks a lot in advance

-Mark
_
Share photos with friends on Windows Live Messenger
http://go.microsoft.com/?linkid=9650734

axis says /WEB-INF/server-config.wsdd was created but it does not

2009-04-07 Thread Yiannis Chronakis
Hi,

I have successfully installed axis (axis-1.4) under tomcat 4.1
(apache-tomcat-4.1.37-LE-jdk1.4 and java 1.4 (j2sdk1.4.2_17) and ubuntu 8.10
and I can run perfectly my web service application.

I can generate the server-config.wsdd from a deploy.wsdd file with my web
service class using the AdminService. From the WEB-INF directory i do:

export CLASSPATH=lib/*:classes
java -classpath "$CLASSPATH" org.apache.axis.client.AdminClient
-lhttp://localhost:8080/ws/services/AdminService classes/vmp/deploy.wsdd

It would be very convenient to do that automatically on loading my webapp
(ws) and I think that used to work in previous versions. However now when I
am starting tomcat and get the message:

  Unable to find config file.  Creating new servlet engine config file:
/WEB-INF/server-config.wsdd

there isn't any server-config.wsdd anywhere in my webapp.

I enabled logging for DEBUG messages following the manual instructions
(removing the configuration file from the axis.jar) and while I am getting
various messages, nothing says why server-config.wsdd is failing to be
created. Directories under webapp are writable by the tomcat process.

I even created a small clean test web application called ws to test it.

I do not understand what I am doing wrong here. I was thinking that probably
axis cannot write in the WEB-INF but I think i would get some security or io
exception in this case. I am pasting the files as well.

Any help would be apreciated.

regards

Yiannis



Here is my class:


package vmp;

public class PingService {
  public String ping() {
return "Hi There";
  }
}


Here is my deploy.wsdd placed under /WEB-INF/classes/vmp/deploy.wsdd
-

http://xml.apache.org/axis/wsdd/";
  xmlns:java="http://xml.apache.org/axis/wsdd/providers/java";>


  
  





This is my web.xml file (copy & paste from axis distribution)
--



http://java.sun.com/dtd/web-app_2_3.dtd";>


  Apache-Axis



org.apache.axis.transport.http.AxisHTTPSessionListener


  
AxisServlet
Apache-Axis Servlet

org.apache.axis.transport.http.AxisServlet

  

  
AdminServlet
Axis Admin Servlet

org.apache.axis.transport.http.AdminServlet

100
  

  
SOAPMonitorService
SOAPMonitorService

org.apache.axis.monitor.SOAPMonitorService


  SOAPMonitorPort
  5001

100
  

  
AxisServlet
/servlet/AxisServlet
  

  
AxisServlet
*.jws
  

  
AxisServlet
/services/*
  

  
SOAPMonitorService
/SOAPMonitor
  

 
  
AdminServlet
/servlet/AdminServlet
  



5



  
wsdl
 text/xml
  


  
xsd
text/xml
  

  
index.jsp
index.html
index.jws
  





console outpout
---

ClassLoaderFactory:  Creating new class loader
ClassLoaderFactory:Including directory
/opt/java/apache-tomcat-4.1.37-LE-jdk1.4/common/classes
ClassLoaderFactory:Including jar file
/opt/java/apache-tomcat-4.1.37-LE-jdk1.4/common/lib/commons-logging-api-1.1.1.jar
ClassLoaderFactory:Including jar file
/opt/java/apache-tomcat-4.1.37-LE-jdk1.4/common/lib/servlet.jar
ClassLoaderFactory:Including jar file
/opt/java/apache-tomcat-4.1.37-LE-jdk1.4/common/lib/jasper-compiler.jar
ClassLoaderFactory:Including jar file
/opt/java/apache-tomcat-4.1.37-LE-jdk1.4/common/lib/commons-collections-3.2.jar
ClassLoaderFactory:Including jar file
/opt/java/apache-tomcat-4.1.37-LE-jdk1.4/common/lib/naming-factory.jar
ClassLoaderFactory:Including jar file
/opt/java/apache-tomcat-4.1.37-LE-jdk1.4/common/lib/jasper-runtime.jar
ClassLoaderFactory:Including jar file
/opt/java/apache-tomcat-4.1.37-LE-jdk1.4/common/lib/naming-resources.jar
ClassLoaderFactory:Including jar file
/opt/java/apache-tomcat-4.1.37-LE-jdk1.4/common/lib/ant.jar
ClassLoaderFactory:Including jar file
/opt/java/apache-tomcat-4.1.37-LE-jdk1.4/common/lib/naming-common.jar
ClassLoaderFactory:Including jar file
/opt/java/apache-tomcat-4.1.37-LE-jdk1.4/common/lib/ant-launcher.jar
ClassLoaderFactory:  Creating new class loader
ClassLoaderFactory:Including directory
/opt/java/apache-tomcat-4.1.37-LE-jdk1.4/server/classes
ClassLoaderFactory:Including jar file
/opt/java/apache-tomcat-4.1.37-LE-jdk1.4/server/lib/catalina-ant.jar
ClassLoaderFactory:Including jar file
/opt/java/apache-tomcat-4.1.37-LE-jdk1.4/server/lib/commons-io-1.3.jar
ClassLoaderFactory:Including jar file
/opt/java/apache-tomcat-4.1.37-LE-jdk1.4/server/lib/tomcat-jk2.jar
ClassLoaderFactory:Including jar file
/opt/java/apache-tomcat-4.1.37-LE-jdk1.4/server/lib/tomcat-coyote.jar
ClassLoaderFactory:Including jar file
/opt/java/apache-tomcat-4.1.37-LE-jdk1.4/server/lib/tomcat-util.jar
Cla

Re: How to change Axis2 response character encoding

2009-04-07 Thread Sanat Mastan Kumar
Thanks a ton Andreas i read the stream completely and filtered invalid
characters and reassign new stream. of course this might not be idle
solution but it works to my application.

Following highlighted code is the one i added to the original SoapBuilder.

public class CustomSOAPBuilder implements Builder {
static Logger logger =
Logger.getLogger(CustomSOAPBuilder.class.getName());

public OMElement processDocument(InputStream inputStream, String
contentType,
 MessageContext messageContext) throws
AxisFault {
XMLStreamReader streamReader;
try {
logger.info("Calling my builder");
String charEncoding = "ISO-8859-1";

//String filename =
"C:\\Java_Source\\Inventory\\temp\\ranked_resp_mar_8_InvalidUTFChar_FromSoapBuilder.xml";
//FileWriter fw = new FileWriter(filename);

InputStreamReader isr = new
InputStreamReader(inputStream,charEncoding);
BufferedReader br = new BufferedReader (isr);

ByteArrayOutputStream baos = readSocketStream(br);
ByteArrayInputStream bais = new
ByteArrayInputStream(baos.toByteArray());

inputStream = bais;

//messageContext.setProperty(Constants.Configuration.CHARACTER_SET_ENCODING,charEncoding);
String charSetEncoding = (String) messageContext

.getProperty(Constants.Configuration.CHARACTER_SET_ENCODING);

// Get the actual encoding by looking at the BOM of the
InputStream
PushbackInputStream pis =
BuilderUtil.getPushbackInputStream(inputStream);
String actualCharSetEncoding =
BuilderUtil.getCharSetEncoding(pis, charSetEncoding);

// Get the XMLStreamReader for this input stream
streamReader = StAXUtils.createXMLStreamReader(pis,
actualCharSetEncoding);

StAXBuilder builder = new StAXSOAPModelBuilder(streamReader);
SOAPEnvelope envelope = (SOAPEnvelope)
builder.getDocumentElement();
BuilderUtil

.validateSOAPVersion(BuilderUtil.getEnvelopeNamespace(contentType),
envelope);
BuilderUtil.validateCharSetEncoding(charSetEncoding,
builder.getDocument()
.getCharsetEncoding(),
envelope.getNamespace().getNamespaceURI());
return envelope;
} catch (IOException e) {
throw AxisFault.makeFault(e);
} catch (XMLStreamException e) {
throw AxisFault.makeFault(e);
}
}
public static ByteArrayOutputStream readSocketStream(BufferedReader br){
char cbuf[] = new char[1];
int res= -1;
ByteArrayOutputStream baos = new ByteArrayOutputStream(1);
while(true){
try{
res= br.read(cbuf);
if (res == -1) break;
if (cbuf[0]>=32 && cbuf[0]<=127){
baos.write(cbuf[0]);
}else{
//System.out.println("Filtering Invalid
character:"+cbuf[0]+":"+(int)cbuf[0]);
logger.info("Filtering Invalid
character:"+cbuf[0]+":"+(int)cbuf[0]);
}
}catch (Exception e){
e.printStackTrace();
}
}
return baos;
}


}


=

The message builder receives the raw stream from the transport and
returns the corresponding Axiom tree. This is the right place to tweak
the character encoding. Message builders are implementations of
org.apache.axis2.builder.Builder and are configured in axis2.xml (in
the messageBuilders section). In your case you will probably have to
implement an alternative SOAPBuilder. The problem is that message
builders are selected by Content-Type alone. You need to take this
into account if your code access services other than the one having
the encoding issue.

Andreas


On Fri, Mar 13, 2009 at 11:27 AM, Sanat Mastan Kumar
wrote:

> Hi Andreas,
> The service we are accessing is Omniture Sitecatalyst webservice, which i
> think we (atleast i) dont have any control over them. they are claiming that
> they are sending data in UTF-8 format, i accept it is we who are sending
> these invalid characters(because our site has multi language support ) to
> omniture which Omniture is storing in its database, but omniture should
> takecare of normalizing them when sending data back in UTF-8 format.
>
> I added following code to my client handler to bring required stream, i put
> this handler in clients InFlow Address phase,
>
> ByteArrayOutputStream byteOutStr = new ByteArrayOutputStream();
> SOAPEnvelope se = msgContext.getEnvelope();
> OMOutputFormat outputFormat = new OMOutputFormat();
> outputFormat.setCharSetEncoding("ISO-8859-1"); //Also tried with
> differnt formats
> try{
> se.serializeAndConsume(byteOutStr, outputFormat);
> }catch (Exception e){
> e.printStackTrace();
> }
>
> i got the byte stream b