Re: WS-Policy support

2009-04-07 Thread Manjula Peiris
Axis2/C Neethi framework handles WS-policy. If you want implement custom
policies you can do that in [1]. For more details see how secpolicy and
rmpolicy is implemented. You can attach polices in services.xml for
service, operation and message.

[1]
https://svn.apache.org/repos/asf/webservices/axis2/trunk/c/neethi/src




On Mon, 2009-04-06 at 16:40 -0700, Vivian Wang wrote:
 Hi All, 
  
 I am working on using axis2/c to built a web service client. I have a
 few questions regarding WS-policy support in axis2/c. From the manual
 in axis2/c web site, it seems that the WS-policy support is built in
 to the axis2/c. I would like to know the following:
  
 (1) Are there any documents regarding how to use WS-policy in
 axis2/c? 
  
 (2) Are there any examples regarding how to use WS-policy in axis2/c? 
  
 (3) I have a customer presenting me with a WSDL that contains some
 policy definitions and then referenced in operation/binding
 definitions, suppose I can parse the WSDL and extract all the policy
 information, at runtime, how do I use axis2/c to set the related
 policy in a operation/binding when I create a web service client
 (using axis2/c)? Any APIs? 
  
 The afore mentioned WSDL (shortened to contain only related info)
 is pasted at the end of the message :
  
 Thanks much in advance!
 Vivian
 === 
 wsdl:definitions 
   wsp:UsingPolicy wsdl:required=true / 
   wsp:Policy wsu:Id=BN_BN_BatchByIDQueryResponse_Binding
   wsp:ExactlyOne ...
   /wsp:ExactlyOne
   /wsp:Policy
   wsp:Policy wsu:Id=IF_IF_BatchByIDQueryResponse_In
xyzAdmin:CentralAdministration
 xmlns:xyzAdmin=http://www.xyz.com/webas/1000/soap/features101/;
 wsp:Optional=true / 
   /wsp:Policy
 - wsp:Policy wsu:Id=OP_IF_OP_BatchByIDQueryResponse_In
   xyzcomhnd:enableCommit
 xmlns:xyzcomhnd=http://www.xyz.com/NW05/soap/features/commit/;false/xyzcomhnd:enableCommit
  
   xyzblock:enableBlocking
 xmlns:xyzblock=http://www.xyz.com/NW05/soap/features/blocking/;true/xyzblock:enableBlocking
  
   /wsp:Policy
 wsdl:types
.
 /wsdl:types
 ...
 wsdl:portType name=BatchByIDQueryResponse_In
wsp:Policy
 wsp:PolicyReference
 URI=#IF_IF_BatchByIDQueryResponse_In / 
  /wsp:Policy
wsdl:operation name=BatchByIDQueryResponse_In
   wsp:Policy
wsp:PolicyReference
 URI=#OP_IF_OP_BatchByIDQueryResponse_In / 
  /wsp:Policy
  wsdl:input message=tns:BatchByIDQuery_sync / 
  wsdl:output message=tns:BatchByIDResponse_sync / 
  wsdl:fault name=StandardMessageFault
 message=tns:StandardMessageFault / 
   /wsdl:operation
  /wsdl:portType
   wsdl:binding name=BatchByIDQueryResponse_Binding
 type=tns:BatchByIDQueryResponse_In
 wsp:Policy
 wsp:PolicyReference
 URI=#BN_BN_BatchByIDQueryResponse_Binding / 
  /wsp:Policy
  soap:binding
 transport=http://schemas.xmlsoap.org/soap/http; style=document / 
 wsdl:operation name=BatchByIDQueryResponse_In
  soap:operation soapAction= style=document / 
   wsdl:input
  soap:body use=literal / 
  /wsdl:input
   wsdl:output
  soap:body use=literal / 
  /wsdl:output
   wsdl:fault name=StandardMessageFault
   soap:fault name=StandardMessageFault
 use=literal / 
  /wsdl:fault
  /wsdl:operation
  /wsdl:binding
 ..
 /wsdl:definitions
  
 



Generics Support / Forced Stub Generation

2009-04-07 Thread Rahul J

Hi,

I'm using axis 1.2.1

I have a method which returns an object of type MapString, MyType1 where 
MyType1 is a bean. 

  MapString, MyType1 myMethod(String a, String b)

When I run java2wsdl followed by wsdl2java, this results in a HashMap object in 
the generated Java type. 

  HashMap myMethod(String a, String b)

Thus, the types of the Map (generics feature) are lost. 

Is there a way to make java2wsdl/wsdl2java to support Java 5 generics, so that 
the generated method also has a return type of MapString, MyType1?


Secondly, because generics are not supported, the WSDL doesn't contain MyType1, 
so MyType1 Java type is not generated by wsdl2java. 

This type is defined in beanMapping as follows: 

beanMapping qname=myNs:MyType1 type=java:com.myCompany.MyType1 
encodingStyle=/

Is there a way to force generation of this Java type (Stubs) even if any method 
in WSDL doesn't contain it? 

Thanks, 
Rahul 





RE: Generics Support / Forced Stub Generation

2009-04-07 Thread Rahul Miglani
Hi,

You can use the -xc (extraClasses) option with java2wsdl and give the fully 
qualified name of the MyType1 bean. This will result in generation of schema 
for your bean class even if it is not directly referenced in any of the 
operations.

As for the first part of your mail I am not very sure so maybe somebody else 
might be able to help you out in that.

Thanks and Regards,
Rahul Miglani
Quark Media House

-Original Message-
From: Rahul J [mailto:rj...@yahoo.com] 
Sent: Tuesday, April 07, 2009 11:42 AM
To: axis-user@ws.apache.org
Subject: Generics Support / Forced Stub Generation


Hi,

I'm using axis 1.2.1

I have a method which returns an object of type MapString, MyType1 where 
MyType1 is a bean. 

  MapString, MyType1 myMethod(String a, String b)

When I run java2wsdl followed by wsdl2java, this results in a HashMap object in 
the generated Java type. 

  HashMap myMethod(String a, String b)

Thus, the types of the Map (generics feature) are lost. 

Is there a way to make java2wsdl/wsdl2java to support Java 5 generics, so that 
the generated method also has a return type of MapString, MyType1?


Secondly, because generics are not supported, the WSDL doesn't contain MyType1, 
so MyType1 Java type is not generated by wsdl2java. 

This type is defined in beanMapping as follows: 

beanMapping qname=myNs:MyType1 type=java:com.myCompany.MyType1 
encodingStyle=/

Is there a way to force generation of this Java type (Stubs) even if any method 
in WSDL doesn't contain it? 

Thanks, 
Rahul 


  


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:/xs:schema/wsdl:typeswsdl:message 
name=getVersionMessage/wsdl:messagewsdl:message 
name=getVersionResponsewsdl:part name=part1 
element=ns0:getVersionResponse/wsdl:part/wsdl:messagewsdl:message 
name=getVersionFaultwsdl:part name=part1 
element=ns0:ExceptionFault/wsdl:part/wsdl:messagewsdl:portType 
name=VersionPortTypewsdl:operation name=getVersionwsdl:input 
message=axis2:getVersionMessage 
wsaw:Action=urn:getVersion/wsdl:inputwsdl:output 
message=axis2:getVersionResponse/wsdl:outputwsdl:fault 
message=axis2:getVersionFault 
name=getVersionFault/wsdl:fault/wsdl:operation/wsdl:portTypewsdl:binding 
name=VersionSOAP11Binding type=axis2:VersionPortTypesoap:binding 
transport=http://schemas.xmlsoap.org/soap/http; 
style=document/soap:bindingwsdl:operation 
name=getVersionsoap:operation soapAction=urn:getVersion 
style=document/soap:operationwsdl:inputsoap:body 
use=literal/soap:body/wsdl:inputwsdl:outputsoap:body 
use=literal/soap:body/wsdl:outputwsdl:fault 
name=getVersionFaultsoap12:fault use=literal 
name=getVersionFault/soap12:fault/wsdl:fault/wsdl:operation/wsdl:bindingwsdl:binding 
name=VersionSOAP12Binding type=axis2:VersionPortTypesoap12:binding 
transport=http://schemas.xmlsoap.org/soap/http; 
style=document/soap12:bindingwsdl:operation 
name=getVersionsoap12:operation soapAction=urn:getVersion 
style=document/soap12:operationwsdl:inputsoap12:body 
use=literal/soap12:body/wsdl:inputwsdl:outputsoap12:body 
use=literal/soap12:body/wsdl:outputwsdl:fault 
name=getVersionFaultsoap12:fault use=literal 
name=getVersionFault/soap12:fault/wsdl:fault/wsdl:operation/wsdl:bindingwsdl:binding 
name=VersionHttpBinding type=axis2:VersionPortTypehttp:binding 
verb=POST/http:bindingwsdl:operation 
name=getVersionhttp:operation 
location=getVersion/http:operationwsdl:inputmime:content 
type=text/xml/mime:content/wsdl:inputwsdl:outputmime:content 
type=text/xml/mime:content/wsdl:output/wsdl:operation/wsdl:bindingwsdl:service 
name=Versionwsdl:port name=VersionSOAP11port_http 
binding=axis2:VersionSOAP11Bindingsoap:address 
location=http://192.168.0.156:8080/axis2/services/Version;/soap:address/wsdl:portwsdl:port 
name=VersionSOAP12port_http 
binding=axis2:VersionSOAP12Bindingsoap12:address 
location=http://192.168.0.156:8080/axis2/services/Version;/soap12:address/wsdl:portwsdl:port 
name=VersionHttpport binding=axis2:VersionHttpBindinghttp:address 
location=http://192.168.0.156:8080/axis2/services/Version;/http:address/wsdl:port/wsdl:service/wsdl:definitions

^


[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 mgai...@hotmail.com


 //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

?xml version='1.0' encoding='UTF-8'?
soapenv:Envelope xmlns:soapenv=http://www.w3.org/2003/05/soap-envelope;
soapenv:Header
wsse:Security xmlns:wsse=
http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd;
soapenv:mustUnderstand=true
wsse:UsernameToken xmlns:wsu=
http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd;
wsu:Id=UsernameToken-31658378
wsse:Usernameapache/wsse:Username
wsse:Password Type=
http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText
password/wsse:Password
/wsse:UsernameToken
/wsse:Security
/soapenv:Header
soapenv:Body
ns1:sayHello xmlns:ns1=http://HelloWeb/xsd;
ns1:param0Sudhir Mongia 1/ns1:param0
/ns1:sayHello
/soapenv:Body
/soapenv:Envelope

Response Soap Message

?xml version='1.0' encoding='UTF-8'?
soapenv:Envelope xmlns:soapenv=http://www.w3.org/2003/05/soap-envelope;
soapenv:Body
soapenv:Fault
soapenv:Codesoapenv:Valuesoapenv:Receiver/soapenv:Value/soapenv:Code
soapenv:Reasonsoapenv:Text
xml:lang=en-USInvalidSecurity/soapenv:Text/soapenv:Reason
soapenv:Detail /
/soapenv:Fault
/soapenv:Body
/soapenv:Envelope


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

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
TOMCAT_HOME/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://server: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 TOMCAT_HOME/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
TOMCAT_HOME/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 sudheshnai...@yahoo.com wrote:

 From: sudheshna iyer sudheshnai...@yahoo.com
 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.

 parameter name=useOriginalwsdltrue/parameter

Thanks ,

On Tue, Apr 7, 2009 at 7:37 PM, Milan Tomic tomicmi...@yahoo.com 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 sagara.gunathu...@gmail.com
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.

parameter name=useOriginalwsdltrue/parameter

Thanks ,

On Tue, Apr 7, 2009 at 7:37 PM, Milan Tomic tomicmi...@yahoo.com 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 tomicmi...@yahoo.com 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 sagara.gunathu...@gmail.com
 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.

 parameter name=useOriginalwsdltrue/parameter

 Thanks ,

 On Tue, Apr 7, 2009 at 7:37 PM, Milan Tomic tomicmi...@yahoo.com 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: [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.

service name=SimpleService class=LifeCycleClassName


Thanks


On Tue, Apr 7, 2009 at 9:39 PM, Raghu Upadhyayula
rupadhyay...@responsys.com 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.

service name=SimpleService class=LifeCycleClassName


Thanks


On Tue, Apr 7, 2009 at 9:39 PM, Raghu Upadhyayula
rupadhyay...@responsys.com 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){

...snip...

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

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
sanatmas...@gmail.comwrote:

 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 but it is copy of the