how to get the http status code

2009-07-15 Thread Vivian Wang

Hi There,

I am using axis2/c to make web service client call, like this:

  axiom_node_t * node = axis2_svc_client_send_receive(_wsf_service_client, 
_env, payload);

After this, I am trying to use the following API to get the http status code,

  AXIS2_EXTERN int AXIS2_CALL 
axis2_svc_client_get_http_status_code(axis2_svc_client_t * svc_client, const 
axutil_env_t * env);

I am expecting 408 for time out, 200 for success. However, I am always getting 
0. How do I get the proper status code?

Thanks!
Vivian 






Error invoking service through SOAP test tool - SOAP UI v3.0

2009-07-15 Thread Sudhanshu Umalkar Umalkar
Getting below given error while trying to invoke WS developed in Axis2, but
the same thing works when tested with JSP client. Any solution to resolve
this?
 
[7/15/09 0:29:48:318 PDT] 65828312 SystemOut O 276754 ERROR
[Servlet.Engine.Transports : 2]
com.cisco.framework.axis2.receivers.GenericInOutReceiver - Error
invoking the service [EngagementStatusService] , operation
[getEngagementStatus]
org.xml.sax.SAXParseException: unexpected root element (uri:,
local:EngagementStatusRequest). Expected elements are
{http://tools-dev.cisco.com/ktn/xsd}EngagementStatusResponse,{http://tool
s-dev.cisco.com/ktn/xsd}Error,{http://tools-dev.cisco.com/ktn/xsd}Engageme
ntStatusRequest
at
com.cisco.is.ktnx.vws.model.status.impl.runtime.SAXUnmarshallerHandlerImpl.s
tartElement(SAXUnmarshallerHandlerImpl.java:113)
at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown
Source)
at
org.apache.xerces.impl.XMLNSDocumentScannerImpl$NSContentDispatcher.scanRoot
ElementHook(Unknown Source)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatc
her.dispatch(Unknown Source)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
at
com.cisco.is.ktnx.vws.model.status.impl.runtime.UnmarshallerImpl.unmarshal(U
nmarshallerImpl.java:140)
at
javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshall
erImpl.java:131)
at
javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshall
erImpl.java:178)
at
com.cisco.framework.axis2.databinding.JAXBDataBindingProcessor.fromOM(JAXBDa
taBindingProcessor.java:53)
at
com.cisco.framework.axis2.receivers.GenericInOutReceiver.invokeBusinessLogic
(GenericInOutReceiver.java:119)
at
com.cisco.framework.axis2.receivers.GenericInOutReceiver.invokeBusinessLogic
(GenericInOutReceiver.java:70)
at
org.apache.axis2.receivers.AbstractMessageReceiver.receive(AbstractMessageRe
ceiver.java:96)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:145)
at
org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HT
TPTransportUtils.java:275)
at org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:120)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService(StrictServle
tInstance.java:110)
at
com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._service(StrictLifecy
cleServlet.java:174)
at
com.ibm.ws.webcontainer.servlet.IdleServletState.service(StrictLifecycleServ
let.java:313)
at
com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(StrictLifecyc
leServlet.java:116)
at
com.ibm.ws.webcontainer.servlet.ServletInstance.service(ServletInstance.java
:283)
at
com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dispatch(ValidSer
vletReferenceState.java:42)
at
com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch(ServletIns
tanceReference.java:40)
at
com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.
java:76)
at com.netegrity.was511.filter.ServletFilter.doFilter(ServletFilter.java:54)
at
com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstance
Wrapper.java:132)
at
com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.
java:71)
at com.cisco.tools.filter.AccessLogFilter.doFilter(AccessLogFilter.java:114)
at
com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstance
Wrapper.java:132)
at
com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.
java:71)
at
com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDispatch(
WebAppRequestDispatcher.java:1027)
at
com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppReques
tDispatcher.java:544)
at
com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequest
Dispatcher.java:210)
at
com.ibm.ws.webcontainer.srt.WebAppInvoker.doForward(WebAppInvoker.java:139)
at
com.ibm.ws.webcontainer.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker
java:332)
at
com.ibm.ws.webcontainer.cache.invocation.CachedInvocation.handleInvocation(C
achedInvocation.java:71)
at
com.ibm.ws.webcontainer.srp.ServletRequestProcessor.dispatchByURI(ServletReq
uestProcessor.java:254)
at
com.ibm.ws.webcontainer.oselistener.OSEListenerDispatcher.service(OSEListene
r.java:334)
at
com.ibm.ws.webcontainer.http.HttpConnection.handleRequest(HttpConnection.jav
a:56)
at
com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java:657)
at 

WSDL2Java StringIndexOutOfBoundException

2009-07-15 Thread Tina Vießmann

Hi everyone,

I try to generate a service out of my wsdl file. Unfortunately, I get a 
exception I can't interpret.

Does anyone have an idea what could be the cause?

Greetings,
Tina


Exception in thread main 
org.apache.axis2.wsdl.codegen.CodeGenerationException: Error parsing WSDL
   at 
org.apache.axis2.wsdl.codegen.CodeGenerationEngine.init(CodeGenerationEngine.java:159)

   at org.apache.axis2.wsdl.WSDL2Code.main(WSDL2Code.java:35)
   at org.apache.axis2.wsdl.WSDL2Java.main(WSDL2Java.java:24)
Caused by: java.lang.StringIndexOutOfBoundsException: String index out 
of range: -1

   at java.lang.String.substring(String.java:1938)
   at 
org.apache.axis2.wsdl.codegen.CodeGenerationEngine.getBaseURI(CodeGenerationEngine.java:341)
   at 
org.apache.axis2.wsdl.codegen.CodeGenerationEngine.init(CodeGenerationEngine.java:151)

   ... 2 more


Rampart error (Incoming message does not contain required Security header)

2009-07-15 Thread Chinmoy Chakraborty
Hi,

I am getting following error while trying to invoke a WS-Security enabled
client request:

org.apache.axis2.AxisFault: WSDoAllReceiver: Incoming message does not
contain required Security header
 at
org.apache.rampart.handler.WSDoAllReceiver.processBasic(WSDoAllReceiver.java:221)
 at
org.apache.rampart.handler.WSDoAllReceiver.processMessage(WSDoAllReceiver.java:86)
 at org.apache.rampart.handler.WSDoAllHandler.invoke(WSDoAllHandler.java:72)
 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)

I am missing something I know but not sure what. Following is my client
code:

  ServiceClient client = new ServiceClient();
  Options options = new Options();
  options.setAction(invoke);
  options.setUserName(system);
  options.setPassword(manager);
  options.setTo(new EndpointReference(wsServerUrl + services/ABS));
  client.setOptions(options);
  client.engageModule(rampart);
  OMElement response = client.sendReceive(getPayload(args));

Following is my services.xml:

service name=ABS targetNamespace=http://www.abc.com/webservice;
descriptionService description for ABS/description
schema 
schemaNamespace=http://www.abc.com/webservice/http://www.abc.com/webservice%22/

parameter name=ServiceClassABS/parameter
parameter name = disasbleRESTtrue/parameter
operation name=invoke
messageReceiver class=org.apache.axis2.rpc.receivers.RPCMessageReceiver/
/operation
module ref=soapmonitor/
module ref=rampart /
parameter name = InflowSecurityaction
itemsUsernameToken/items
passwordCallbackClassweb.ws.control.PWCBHandler/passwordCallbackClass
/action
/parameter
parameter name=OutflowSecurity
 action
  itemsUsernameToken/items
  passwordCallbackClassweb.ws.control.PWCBHandler/passwordCallbackClass
 /action
/parameter
/service

Any idea?

Chinmoy


Lookup QName for Class

2009-07-15 Thread Mark
Is there an easy way for the client developer to lookup the QName that will
be used for serialization of a given class?
I know it is possible deep within the serialization to do this with a
serialization context via getQNameForClass().   However, is there a simple
way at an outer most level for someone to lookup the QName?

The use case is an easy way to pass in a QName representing the type of a
class to an web service operation that resolves the type based on QName.


Re: WSDL2Java StringIndexOutOfBoundException

2009-07-15 Thread Tina Vießmann

Ok, I've found the cause of the problem.
It seems to be a problem with Axis2 1.5 itself. I've tried to build a 
service out of different wsdl files and got the same error every time - 
also with a file originally generated by Axis2 once. I've switched to 
version 1.4.1 and everything is fine now.


Greetings,
Tina


Hi everyone,

I try to generate a service out of my wsdl file. Unfortunately, I get 
a exception I can't interpret.

Does anyone have an idea what could be the cause?

Greetings,
Tina


Exception in thread main 
org.apache.axis2.wsdl.codegen.CodeGenerationException: Error parsing WSDL
   at 
org.apache.axis2.wsdl.codegen.CodeGenerationEngine.init(CodeGenerationEngine.java:159) 


   at org.apache.axis2.wsdl.WSDL2Code.main(WSDL2Code.java:35)
   at org.apache.axis2.wsdl.WSDL2Java.main(WSDL2Java.java:24)
Caused by: java.lang.StringIndexOutOfBoundsException: String index out 
of range: -1

   at java.lang.String.substring(String.java:1938)
   at 
org.apache.axis2.wsdl.codegen.CodeGenerationEngine.getBaseURI(CodeGenerationEngine.java:341) 

   at 
org.apache.axis2.wsdl.codegen.CodeGenerationEngine.init(CodeGenerationEngine.java:151) 


   ... 2 more





Axis 2 Rampart sample 06 not working: No such algorithm: http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p

2009-07-15 Thread cbr600

Hi,

I am a newbie to Axis 2 and Rampart. I am trying to run sample 06 downloaded
from this link:
Version 1.5: http://ws.apache.org/axis2/1_5/installationguide.html

The service and the STS works fine after fixing few things in the build.xml
(please see below):

-
property name=addressing.mar value=addressing-1.5.mar
property name=rampart.mar value=rampart-1.4.mar
property name=rahas.mar value=rahas-1.4.mar
-

But when I run the client, the program threw exception as following:

-
C:\Documents and
Settings\pvu\Desktop\Software\rampart-dist-1.4-bin\rampart-1.4\
samples\policyC:\Documents and
Settings\pvu\Desktop\Software\apache-ant-1.7.1-
bin\apache-ant-1.7.1\bin\ant client.06
Buildfile: build.xml

check.dependency:

client.06:
[copy] Copying 1 file to C:\Documents and Settings\pvu\Desktop\Software\ram
part-dist-1.4-bin\rampart-1.4\samples\policy\build\client_repositories\sample06\
modules
[copy] Copying 1 file to C:\Documents and Settings\pvu\Desktop\Software\ram
part-dist-1.4-bin\rampart-1.4\samples\policy\build\client_repositories\sample06\
modules
[copy] Copying 1 file to C:\Documents and Settings\pvu\Desktop\Software\ram
part-dist-1.4-bin\rampart-1.4\samples\policy\build\temp_client
[copy] Copying 1 file to C:\Documents and Settings\pvu\Desktop\Software\ram
part-dist-1.4-bin\rampart-1.4\samples\policy\build\temp_client
[java] log4j:WARN No appenders could be found for logger (org.apache.axis2.
deployment.FileSystemConfigurator).
[java] log4j:WARN Please initialize the log4j system properly.
[java] Exception in thread main org.apache.axis2.AxisFault: Error in crea
ting an encrypted key
[java] at org.apache.rampart.handler.RampartSender.invoke(RampartSender
.java:70)
[java] at org.apache.axis2.engine.Phase.invoke(Phase.java:318)
[java] at org.apache.axis2.engine.AxisEngine.invoke(AxisEngine.java:251
)
[java] at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:416)
[java] at org.apache.axis2.description.OutInAxisOperationClient.send(Ou
tInAxisOperation.java:402)
[java] at org.apache.axis2.description.OutInAxisOperationClient.execute
Impl(OutInAxisOperation.java:229)
[java] at org.apache.axis2.client.OperationClient.execute(OperationClie
nt.java:165)
[java] at org.apache.axis2.client.ServiceClient.sendReceive(ServiceClie
nt.java:539)
[java] at org.apache.axis2.client.ServiceClient.sendReceive(ServiceClie
nt.java:520)
[java] at org.apache.rampart.samples.policy.sample06.Client.main(Unknow
n Source)
[java] Caused by: org.apache.rampart.RampartException: Error in creating an
encrypted key
[java] at org.apache.rampart.builder.BindingBuilder.getEncryptedKeyBuil
der(BindingBuilder.java:228)
[java] at org.apache.rampart.builder.SymmetricBindingBuilder.setupEncry
ptedKey(SymmetricBindingBuilder.java:697)
[java] at org.apache.rampart.builder.SymmetricBindingBuilder.doSignBefo
reEncrypt(SymmetricBindingBuilder.java:422)
[java] at org.apache.rampart.builder.SymmetricBindingBuilder.build(Symm
etricBindingBuilder.java:90)
[java] at org.apache.rampart.MessageBuilder.build(MessageBuilder.java:1
44)
[java] at org.apache.rampart.handler.RampartSender.invoke(RampartSender
.java:64)
[java] ... 9 more
[java] Caused by: org.apache.ws.security.WSSecurityException: An unsupporte
d signature or encryption algorithm was used (unsupported key transport
encrypti
on algorithm: No such algorithm:
http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p
)
[java] at org.apache.ws.security.util.WSSecurityUtil.getCipherInstance(
WSSecurityUtil.java:689)
[java] at org.apache.ws.security.message.WSSecEncryptedKey.prepareInter
nal(WSSecEncryptedKey.java:195)
[java] at org.apache.ws.security.message.WSSecEncryptedKey.prepare(WSSe
cEncryptedKey.java:173)
[java] at org.apache.rampart.builder.BindingBuilder.getEncryptedKeyBuil
der(BindingBuilder.java:224)
[java] ... 14 more
[java] Java Result: 1

BUILD SUCCESSFUL
Total time: 3 seconds
---

I google the error and found the following links:

1)
https://wso2.org/jira/browse/CARBON715;jsessionid=BD22C5780277D0AD4EACAE6B9276420D?page=com.atlassian.jira.plugin.system.issuetabpanels:changehistory-tabpanel
2) https://wso2.org/jira/browse/CARBON-3709

It seems to me that the problem has been fixed by the Axis team but where
can I find a new version of the sample?
OR is this another bug?

Any help or suggestion would be greatly appreciated.

Regards,
Phillip
-- 
View this message in context: 
http://www.nabble.com/Axis-2-Rampart-sample-06-not-working%3A-No-such-algorithm%3A-http%3A--www.w3.org-2001-04-xmlenc-rsa-oaep-mgf1p-tp24508879p24508879.html
Sent from the Axis - User mailing list archive at Nabble.com.



Re: Axis 2 Rampart sample 06 not working: No such algorithm: http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p

2009-07-15 Thread Nandana Mihindukulasooriya
Hi Phillip,
  Can you check bouncycastle jar is in your classpath ? We didn't ship
bouncycastle due a patent issue. README file in the rampart distribution has
more information.

regards,
Nandana

On Thu, Jul 16, 2009 at 7:32 AM, cbr600 phillip...@innovation.gov.auwrote:


 Hi,

 I am a newbie to Axis 2 and Rampart. I am trying to run sample 06
 downloaded
 from this link:
 Version 1.5: http://ws.apache.org/axis2/1_5/installationguide.html

 The service and the STS works fine after fixing few things in the build.xml
 (please see below):


 -
 property name=addressing.mar value=addressing-1.5.mar
 property name=rampart.mar value=rampart-1.4.mar
 property name=rahas.mar value=rahas-1.4.mar

 -

 But when I run the client, the program threw exception as following:


 -
 C:\Documents and
 Settings\pvu\Desktop\Software\rampart-dist-1.4-bin\rampart-1.4\
 samples\policyC:\Documents and
 Settings\pvu\Desktop\Software\apache-ant-1.7.1-
 bin\apache-ant-1.7.1\bin\ant client.06
 Buildfile: build.xml

 check.dependency:

 client.06:
 [copy] Copying 1 file to C:\Documents and Settings\pvu\Desktop\Software\ram

 part-dist-1.4-bin\rampart-1.4\samples\policy\build\client_repositories\sample06\
 modules
 [copy] Copying 1 file to C:\Documents and Settings\pvu\Desktop\Software\ram

 part-dist-1.4-bin\rampart-1.4\samples\policy\build\client_repositories\sample06\
 modules
 [copy] Copying 1 file to C:\Documents and Settings\pvu\Desktop\Software\ram
 part-dist-1.4-bin\rampart-1.4\samples\policy\build\temp_client
 [copy] Copying 1 file to C:\Documents and Settings\pvu\Desktop\Software\ram
 part-dist-1.4-bin\rampart-1.4\samples\policy\build\temp_client
 [java] log4j:WARN No appenders could be found for logger (org.apache.axis2.
 deployment.FileSystemConfigurator).
 [java] log4j:WARN Please initialize the log4j system properly.
 [java] Exception in thread main org.apache.axis2.AxisFault: Error in crea
 ting an encrypted key
 [java] at org.apache.rampart.handler.RampartSender.invoke(RampartSender
 .java:70)
 [java] at org.apache.axis2.engine.Phase.invoke(Phase.java:318)
 [java] at org.apache.axis2.engine.AxisEngine.invoke(AxisEngine.java:251
 )
 [java] at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:416)
 [java] at org.apache.axis2.description.OutInAxisOperationClient.send(Ou
 tInAxisOperation.java:402)
 [java] at org.apache.axis2.description.OutInAxisOperationClient.execute
 Impl(OutInAxisOperation.java:229)
 [java] at org.apache.axis2.client.OperationClient.execute(OperationClie
 nt.java:165)
 [java] at org.apache.axis2.client.ServiceClient.sendReceive(ServiceClie
 nt.java:539)
 [java] at org.apache.axis2.client.ServiceClient.sendReceive(ServiceClie
 nt.java:520)
 [java] at org.apache.rampart.samples.policy.sample06.Client.main(Unknow
 n Source)
 [java] Caused by: org.apache.rampart.RampartException: Error in creating an
 encrypted key
 [java] at org.apache.rampart.builder.BindingBuilder.getEncryptedKeyBuil
 der(BindingBuilder.java:228)
 [java] at org.apache.rampart.builder.SymmetricBindingBuilder.setupEncry
 ptedKey(SymmetricBindingBuilder.java:697)
 [java] at org.apache.rampart.builder.SymmetricBindingBuilder.doSignBefo
 reEncrypt(SymmetricBindingBuilder.java:422)
 [java] at org.apache.rampart.builder.SymmetricBindingBuilder.build(Symm
 etricBindingBuilder.java:90)
 [java] at org.apache.rampart.MessageBuilder.build(MessageBuilder.java:1
 44)
 [java] at org.apache.rampart.handler.RampartSender.invoke(RampartSender
 .java:64)
 [java] ... 9 more
 [java] Caused by: org.apache.ws.security.WSSecurityException: An unsupporte
 d signature or encryption algorithm was used (unsupported key transport
 encrypti
 on algorithm: No such algorithm:
 http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p
 )
 [java] at org.apache.ws.security.util.WSSecurityUtil.getCipherInstance(
 WSSecurityUtil.java:689)
 [java] at org.apache.ws.security.message.WSSecEncryptedKey.prepareInter
 nal(WSSecEncryptedKey.java:195)
 [java] at org.apache.ws.security.message.WSSecEncryptedKey.prepare(WSSe
 cEncryptedKey.java:173)
 [java] at org.apache.rampart.builder.BindingBuilder.getEncryptedKeyBuil
 der(BindingBuilder.java:224)
 [java] ... 14 more
 [java] Java Result: 1

 BUILD SUCCESSFUL
 Total time: 3 seconds

 ---

 I google the error and found the following links:

 1)

 https://wso2.org/jira/browse/CARBON715;jsessionid=BD22C5780277D0AD4EACAE6B9276420D?page=com.atlassian.jira.plugin.system.issuetabpanels:changehistory-tabpanel
 2) https://wso2.org/jira/browse/CARBON-3709

 It seems to me that the problem has been fixed by the Axis team but where
 can I find a new version of the sample?
 OR is this another bug?

 Any help or suggestion would 

Re: Axis 2 Rampart sample 06 not working: No such algorithm: http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p

2009-07-15 Thread cbr600

Hi Nan,

I copied the bcprov-jdk16-143.jar to AXIS_HOME/lib but then the client gave
me this error

 [java] Caused by: java.lang.ClassNotFoundException:
edu.emory.mathcs.backport.java.util.concurrent.locks.ReadWriteLock

I googled and found this link:
http://javacio.us/search?q=edu%2Femory%2Fmathcs%2Fbackport%2Fjava%2Futil%2Fconcurrent%2Flocks%2FReadWriteLock+more%3Ajar_filesinline=true

It could be a silly questions but which jar should I add this time?

Any help or suggestions would be greatly appreciated.

Regards,
Phillip


cbr600 wrote:
 
 Hi,
 
 I am a newbie to Axis 2 and Rampart. I am trying to run sample 06
 downloaded from this link:
 Version 1.5: http://ws.apache.org/axis2/1_5/installationguide.html
 
 The service and the STS works fine after fixing few things in the
 build.xml (please see below):
 
 -
 property name=addressing.mar value=addressing-1.5.mar
 property name=rampart.mar value=rampart-1.4.mar
 property name=rahas.mar value=rahas-1.4.mar
 -
 
 But when I run the client, the program threw exception as following:
 
 -
 C:\Documents and
 Settings\pvu\Desktop\Software\rampart-dist-1.4-bin\rampart-1.4\
 samples\policyC:\Documents and
 Settings\pvu\Desktop\Software\apache-ant-1.7.1-
 bin\apache-ant-1.7.1\bin\ant client.06
 Buildfile: build.xml
 
 check.dependency:
 
 client.06:
 [copy] Copying 1 file to C:\Documents and
 Settings\pvu\Desktop\Software\ram
 part-dist-1.4-bin\rampart-1.4\samples\policy\build\client_repositories\sample06\
 modules
 [copy] Copying 1 file to C:\Documents and
 Settings\pvu\Desktop\Software\ram
 part-dist-1.4-bin\rampart-1.4\samples\policy\build\client_repositories\sample06\
 modules
 [copy] Copying 1 file to C:\Documents and
 Settings\pvu\Desktop\Software\ram
 part-dist-1.4-bin\rampart-1.4\samples\policy\build\temp_client
 [copy] Copying 1 file to C:\Documents and
 Settings\pvu\Desktop\Software\ram
 part-dist-1.4-bin\rampart-1.4\samples\policy\build\temp_client
 [java] log4j:WARN No appenders could be found for logger
 (org.apache.axis2.
 deployment.FileSystemConfigurator).
 [java] log4j:WARN Please initialize the log4j system properly.
 [java] Exception in thread main org.apache.axis2.AxisFault: Error in
 crea
 ting an encrypted key
 [java] at org.apache.rampart.handler.RampartSender.invoke(RampartSender
 .java:70)
 [java] at org.apache.axis2.engine.Phase.invoke(Phase.java:318)
 [java] at org.apache.axis2.engine.AxisEngine.invoke(AxisEngine.java:251
 )
 [java] at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:416)
 [java] at org.apache.axis2.description.OutInAxisOperationClient.send(Ou
 tInAxisOperation.java:402)
 [java] at org.apache.axis2.description.OutInAxisOperationClient.execute
 Impl(OutInAxisOperation.java:229)
 [java] at org.apache.axis2.client.OperationClient.execute(OperationClie
 nt.java:165)
 [java] at org.apache.axis2.client.ServiceClient.sendReceive(ServiceClie
 nt.java:539)
 [java] at org.apache.axis2.client.ServiceClient.sendReceive(ServiceClie
 nt.java:520)
 [java] at org.apache.rampart.samples.policy.sample06.Client.main(Unknow
 n Source)
 [java] Caused by: org.apache.rampart.RampartException: Error in creating
 an
 encrypted key
 [java] at org.apache.rampart.builder.BindingBuilder.getEncryptedKeyBuil
 der(BindingBuilder.java:228)
 [java] at org.apache.rampart.builder.SymmetricBindingBuilder.setupEncry
 ptedKey(SymmetricBindingBuilder.java:697)
 [java] at org.apache.rampart.builder.SymmetricBindingBuilder.doSignBefo
 reEncrypt(SymmetricBindingBuilder.java:422)
 [java] at org.apache.rampart.builder.SymmetricBindingBuilder.build(Symm
 etricBindingBuilder.java:90)
 [java] at org.apache.rampart.MessageBuilder.build(MessageBuilder.java:1
 44)
 [java] at org.apache.rampart.handler.RampartSender.invoke(RampartSender
 .java:64)
 [java] ... 9 more
 [java] Caused by: org.apache.ws.security.WSSecurityException: An
 unsupporte
 d signature or encryption algorithm was used (unsupported key transport
 encrypti
 on algorithm: No such algorithm:
 http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p
 )
 [java] at org.apache.ws.security.util.WSSecurityUtil.getCipherInstance(
 WSSecurityUtil.java:689)
 [java] at org.apache.ws.security.message.WSSecEncryptedKey.prepareInter
 nal(WSSecEncryptedKey.java:195)
 [java] at org.apache.ws.security.message.WSSecEncryptedKey.prepare(WSSe
 cEncryptedKey.java:173)
 [java] at org.apache.rampart.builder.BindingBuilder.getEncryptedKeyBuil
 der(BindingBuilder.java:224)
 [java] ... 14 more
 [java] Java Result: 1
 
 BUILD SUCCESSFUL
 Total time: 3 seconds
 ---
 
 I google the error and found the following links:
 
 1)
 

Re: Rampart error (Incoming message does not contain required Security header)

2009-07-15 Thread Nandana Mihindukulasooriya
Hi Chinmoy,
As it seems, you don't have the OutflowSecurity parameter defined
in the client side. So basically you need to have a client side axis2 with
that parameter and then create a ConfigurationContext out of it. Rampart
basic sample 01 shows how to do this [1],[2]. But you won't be able to pass
username/password through options when you use parameter based
configuration. Is there a possibility for you to use policy based
configuration. If so, please look at following tutorial [2].

regards,
Nandana

[1] -
https://svn.apache.org/repos/asf/webservices/rampart/trunk/java/modules/rampart-samples/basic/sample01/client.axis2.xml
[2] -
https://svn.apache.org/repos/asf/webservices/rampart/trunk/java/modules/rampart-samples/basic/sample01/src/org/apache/rampart/samples/sample01/Client.java
[3] - https://www.wso2.org/library/3190

On Wed, Jul 15, 2009 at 5:45 PM, Chinmoy Chakraborty cch...@gmail.comwrote:

 Hi,

 I am getting following error while trying to invoke a WS-Security enabled
 client request:

 org.apache.axis2.AxisFault: WSDoAllReceiver: Incoming message does not
 contain required Security header
  at
 org.apache.rampart.handler.WSDoAllReceiver.processBasic(WSDoAllReceiver.java:221)
  at
 org.apache.rampart.handler.WSDoAllReceiver.processMessage(WSDoAllReceiver.java:86)
  at
 org.apache.rampart.handler.WSDoAllHandler.invoke(WSDoAllHandler.java:72)
  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)

 I am missing something I know but not sure what. Following is my client
 code:

   ServiceClient client = new ServiceClient();
   Options options = new Options();
   options.setAction(invoke);
   options.setUserName(system);
   options.setPassword(manager);
   options.setTo(new EndpointReference(wsServerUrl + services/ABS));
   client.setOptions(options);
   client.engageModule(rampart);
   OMElement response = client.sendReceive(getPayload(args));

 Following is my services.xml:

 service name=ABS targetNamespace=http://www.abc.com/webservice;
 descriptionService description for ABS/description
 schema 
 schemaNamespace=http://www.abc.com/webservice/http://www.abc.com/webservice%22/
 
 parameter name=ServiceClassABS/parameter
 parameter name = disasbleRESTtrue/parameter
 operation name=invoke
 messageReceiver
 class=org.apache.axis2.rpc.receivers.RPCMessageReceiver/
 /operation
 module ref=soapmonitor/
 module ref=rampart /
 parameter name = InflowSecurityaction
 itemsUsernameToken/items
 passwordCallbackClassweb.ws.control.PWCBHandler/passwordCallbackClass
 /action
 /parameter
 parameter name=OutflowSecurity
  action
   itemsUsernameToken/items
   passwordCallbackClassweb.ws.control.PWCBHandler/passwordCallbackClass
  /action
 /parameter
 /service

 Any idea?

 Chinmoy




-- 
Nandana Mihindukulasooriya
WSO2 inc.

http://nandana83.blogspot.com/
http://www.wso2.org