Is better to deploy my services into Axis2 container?

2009-04-13 Thread Moley Harey
Hi folks,

I have several Axis2-based web services that perform different features,
each service is implemented separately and has its own WSDL etc...

My question is about what is the best way to deploy those services, the
possibilities are:

1. generate the *.aar for each service and deploy of all them into axis2.war
container.

2. generate for each service a *.war file and deploy them directly into
Tomcat.

Which advantages provide the axis2.war container? And about performances
which solution is best?

Thanks in advance,

Mh


Re: Authentication for non SOAP messages

2009-04-13 Thread Alexander Rosemann
I've added a handler to the security phase in my axis2.xml. The handler 
gets called each time a request comes in.


I'm just puzzled how I can directly send a response message in case the 
user has not logged in first.


Cheers,
Alex

Martin Gainty wrote:
from the HandlerExecution test harness i've seen this depends on 
assigned PHASE


package org.apache.axis2.engine;
public class HandlerExecutionTest extends LocalTestCase
{
*...
*private void registerOperationLevelHandlers(AxisOperation operation) {
ArrayList operationSpecificPhases = new ArrayList();
operationSpecificPhases.add(new 
Phase(PhaseMetadata.PHASE_POLICY_DETERMINATION));

operation.setRemainingPhasesInFlow(operationSpecificPhases);
ArrayList phaseList = operation.getRemainingPhasesInFlow();
for (int i = 0; i  phaseList.size(); i++) {
Phase operationSpecificPhase = (Phase)phaseList.get(i);
if (PhaseMetadata.PHASE_POLICY_DETERMINATION
.equals(operationSpecificPhase.getPhaseName())) {
operationSpecificPhase.addHandler(firstOperationInHandler);
operationSpecificPhase.addHandler(middleOperationInHandler);
operationSpecificPhase.addHandler(new TestHandler(In6));
}
}
operationSpecificPhases = new ArrayList();
operationSpecificPhases.add(new 
Phase(PhaseMetadata.PHASE_POLICY_DETERMINATION));

operation.setPhasesOutFlow(operationSpecificPhases);
phaseList = operation.getPhasesOutFlow();
for (int i = 0; i  phaseList.size(); i++) {
Phase operationSpecificPhase = (Phase)phaseList.get(i);
if (PhaseMetadata.PHASE_POLICY_DETERMINATION
.equals(operationSpecificPhase.getPhaseName())) {
operationSpecificPhase.addHandler(new TestHandler(Out1));

operationSpecificPhase.addHandler(middleOperationOutHandler);

operationSpecificPhase.addHandler(new TestHandler(Out3));
}
}
}

where PHASES are broken out to
package org.apache.axis2.phaseresolver;
public class PhaseMetadata {

   // INFLOW
public static final String PHASE_TRANSPORTIN = TransportIn;
public static final String PHASE_PRE_DISPATCH = PreDispatch;
public static final String PHASE_POST_DISPATCH = PostDispatch;
public static final String PHASE_POLICY_DETERMINATION = 
PolicyDetermination;
public static final String PHASE_MESSAGE_PROCESSING = 
MessageProcessing;


// OUTFLOW
public static final String PHASE_MESSAGE_OUT = MessageOut;
public static final String PHASE_DISPATCH = Dispatch;
public static final String PHASE_TRANSPORT_OUT = TransportOut;

public static final String TRANSPORT_PHASE = TRANSPORT;

which phase would you be attaching your handler to
?
Martin
__
Disclaimer and Confidentiality/Verzicht und Vertraulichkeitanmerkung / 
Note de déni et de confidentialité


This message is confidential. If you should not be the intended receiver, then 
we ask politely to report. Each unauthorized forwarding or manufacturing of a 
copy is inadmissible. This message serves only for the exchange of information 
and has no legal binding effect. Due to the easy manipulation of emails we 
cannot take responsibility over the the contents.
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: Sun, 12 Apr 2009 16:57:24 +0200
  From: alexander.rosem...@gmail.com
  To: axis-user@ws.apache.org
  CC: alexander.rosem...@gmail.com
  Subject: Authentication for non SOAP messages
 
  Hi,
 
  I've created a bunch of Web services, including an authentication
  service. All services consume and return raw XML messages (no SOAP)
  which works fine.
 
  Now I would like to force clients to authenticate themselves before they
  are allowed to access any of the services.
 
  My idea is to implement a simple handler which checks whether an
  authentication flag has been set in the ServiceGroupContext. In case
  it's not available the only service accessible should be the
  

UNSUBSCRIBE

2009-04-13 Thread Arijith Roy




  

Axis 1.4 not respecting timeout with SSL connection...

2009-04-13 Thread Christopher Ray
I am consuming a web service from one of our customers, and have found
that the timeout setting does not seem to get respected during the
connection process when the connection is secure.  To be more specific,
say it sometimes takes 1500 ms to connect and 500 ms to process the
request.  If I set the timeout for 1000 ms, then the timeout will not be
triggered, even though the connection takes longer than that.  With an
HTTP connection, it works fine... it is only when using HTTPS.  With
HTTPS, if I set the timeout to be less than 500 ms, then it will throw
the read timeout exception.  Ultimately, we would be using a timeout
longer than 1 second, but for testing purposes this is what we're using.
 

The major problem here is that while in test, the system seems to
timeout in about 25 seconds or so, but in production it waits long
enough that it seems to be indefinite.  I could use a timer as a hack
to handle this situation, but Axis does not provide a clean way to kill
this connection.
 

The code I am using to set this is the standard:
 

SoapLocator locator = new SoapLocator();
SoapService service = locator.getSoapService();
(Stub)service.setTimeout(1000);
 

I have spent a large amount of time researching this, and have not found
any kind of conclusive information as to what is going on here; however
I did see one post that stated there is a difference in the way the
socket object is created when using a secure connection vs. non-secure,
in that the timeout for non-secure is set in the constructor of the
socket, while with secure it is set after the constructor is called, and
that this may be the problem, since by the time the timeout value is
being set, you're already stuck with the problem.  Can someone help
confirm this for me, and if anyone has a workaround, please let me know.
 

Any help would be greatly appreciated.
 

Thanks,
Chris


Invalid code generated on enumeration extension

2009-04-13 Thread jcaristi

I am getting invalid Java when I generate ADB binding code from my WSDL. 
Here is the offending code, which contains the invalid type Int:

if (tempObjectAttribId!=null){
  object.setId((Int)tempObjectAttribId);
}

My WSDL defines an enumeration as follows:

simpleType name=ApplicationSearchElement
restriction base=string
length value=30 /
enumeration value=PositionId /
enumeration value=QualifierId /
enumeration value=RegionId /
/restriction
/simpleType

I then use this enumeration in a complex type (the Java class which
represents this type has the error):

xsd:complexType name=ApplicationSearchCriterionType
xsd:simpleContent
xsd:extension base=tns:ApplicationSearchElement
xsd:attribute name=Id type=xsd:int 
use=required /
/xsd:extension
/xsd:simpleContent
/xsd:complexType

I then use this type in another complex type:

xsd:complexType name=ApplicationSearchCriteriaType
xsd:sequence
xsd:element name=Criterion minOccurs=1 
maxOccurs=unbounded
type=tns:ApplicationSearchCriterionType /
/xsd:sequence
/xsd:complexType

I then define an element within a sequence:

xsd:element name=SearchCriteria 
type=tns:ApplicationSearchCriteriaType
minOccurs=0 maxOccurs=1 /
-- 
View this message in context: 
http://www.nabble.com/Invalid-code-generated-on-enumeration-extension-tp23026783p23026783.html
Sent from the Axis - User mailing list archive at Nabble.com.



facing issues in Axis

2009-04-13 Thread Umesh Barik
Hi,
I am trying to develop a Simulator which receives huge records from client. 
After sometime it throws following exception.

Exception in thread SIP-Server java.lang.OutOfMemoryError: Java heap space
Exception in thread Servant0 - Does dumpme file exists ::false
- Does dumpsa existsC:\TestSim\ESPPServer\dist\tomcat\bin\dumpsa
    at java.net.PlainDatagramSocketImpl.receive0(Native Method)
    at java.net.PlainDatagramSocketImpl.receive(PlainDatagramSocketImpl.java
:136)
    at java.net.DatagramSocket.receive(DatagramSocket.java:712)
    at com.cablelabs.espp.sip.SIPServer.run(SIPServer.java:138)
    at java.lang.Thread.run(Thread.java:595)
java.lang.OutOfMemoryError: Java heap space
    at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject
.addConditionWaiter(AbstractQueuedSynchronizer.java:1657)
Exception in thread BatchProcess  at java.util.concurrent.locks.AbstractQu
euedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:1870
)
    at java.util.concurrent.LinkedBlockingQueue.poll(LinkedBlockingQueue.jav
a:396)
java.lang.OutOfMemoryError: Java heap space
    at java.lang.StringBuilder.toString(StringBuilder.java:431)
    at com.sun.xml.bind.v2.model.impl.RuntimeBuiltinLeafInfoImpl$1.parse(Run
timeBuiltinLeafInfoImpl.java:161)
    at com.sun.xml.bind.v2.model.impl.RuntimeBuiltinLeafInfoImpl$1.parse(Run
timeBuiltinLeafInfoImpl.java:171)
    at com.sun.xml.bind.v2.runtime.reflect.TransducedAccessor$CompositeTrans
ducedAccessorImpl.parse(TransducedAccessor.java:205)
    at com.sun.xml.bind.v2.runtime.unmarshaller.LeafPropertyLoader.text(Leaf
PropertyLoader.java:25)
    at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext.text(Un
marshallingContext.java:415)

 
Assuming it could be due to low RAM size I specified the max and min JVM memory 
size with the -Xms and -Xmx parameter. But it did help me. Also after removing 
the processing of the records into memory, the above exception changed to 
something as follows:
 
Apr 10, 2009 12:28:57 PM org.apache.coyote.http11.Http11BaseProtocol pause
INFO: Pausing Coyote HTTP/1.1 on http-8080
Apr 10, 2009 12:28:57 PM org.apache.coyote.http11.Http11BaseProtocol pause
INFO: Pausing Coyote HTTP/1.1 on http-8443
Apr 10, 2009 12:28:57 PM org.apache.catalina.connector.Connector pause
SEVERE: Protocol handler pause failed
java.net.UnknownHostException: ESPP-Simulator-1.cablelabs.com: 
ESPP-Simulator-1.cablelabs.com
 at java.net.InetAddress.getLocalHost(InetAddress.java:1353)
 at org.apache.jk.common.ChannelSocket.unLockSocket(ChannelSocket.java:490)
 at org.apache.jk.common.ChannelSocket.pause(ChannelSocket.java:289)
 at org.apache.jk.server.JkMain.pause(JkMain.java:681)
 at org.apache.jk.server.JkCoyoteHandler.pause(JkCoyoteHandler.java:163)
 at org.apache.catalina.connector.Connector.pause(Connector.java:1032)
 at org.apache.catalina.core.StandardService.stop(StandardService.java:489)
 at org.apache.catalina.core.StandardServer.stop(StandardServer.java:734)
 at org.apache.catalina.startup.Catalina.stop(Catalina.java:602)
 at org.apache.catalina.startup.Catalina.start(Catalina.java:577)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 at java.lang.reflect.Method.invoke(Method.java:597)
 at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:295)
 at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:433)
Apr 10, 2009 12:28:58 PM org.apache.catalina.core.StandardService stop
INFO: Stopping service Catalina
 
I don't have any idea at this point of time how to solve this. Any help will be 
appreciated.