RE: Set properties

2009-12-23 Thread spamy
Hi,

After hours of research and testing I've got a solution.
I don't know if my solution is the 'right'-one, but it works. Maybe you could 
explain how to do things better?
The follwing C/S Code shows how to send and recieve custom HTTP-Header and 
custom SOAP-Header.

Configuration:
- Axis 1.4
- Eclipse Galileo
- Tomcat 6

Development-steps:
- Install Eclipse and bind Tomcat into Eclipse
- Build new Dynamic Web-Project (Server)
- Add Axis libs
- Create POJO
- Use Eclipse to generate the Webservice in the same Project
- Use Eclipse to generate the Client (another Project)
- Configure the Eclipse TCP-Monitor
- Configure the generated endpoints for TCP-Monitoring
- Run Server as Webapplication in Tomcat
- Run Client as Application

Note that the follwing webservice is a little bit different to the Post before! 
(I created a new Test-Environment)


// Service
System.out.println(Server: Start);
try{
MessageContext mc = MessageContext.getCurrentContext();
mc.setMaintainSession(true); // enable axis session

/**
 * Read properties
 */
Iterator i = mc.getAllPropertyNames();
while (i.hasNext()){
  System.out.println(Server: found Property - +i.next());
}
System.out.println(Server: found Username - 
+mc.getUsername());
System.out.println(Server: found Pasword - 
+mc.getPassword());
System.out.println(Server: found Cookie - 
+mc.getProperty(HTTPConstants.HEADER_COOKIE));

HttpServletRequest request = 
(HttpServletRequest)mc.getProperty(HTTPConstants.MC_HTTP_SERVLETREQUEST);
String testProperty = (String) request.getHeader(testProperty);
System.out.println(Server: found testProperty on HTTP-Header - 
+testProperty);


/**
 * Read Session
 */
System.out.println(Server: MaintainSession - 
+mc.getMaintainSession());
System.out.println(Server: Session ID - +mc.getSession());

   
/**
 * Set properties
 */
HttpServletResponse response = 
(HttpServletResponse)mc.getProperty(HTTPConstants.MC_HTTP_SERVLETRESPONSE);
response.addHeader(testProperty2, 
testvalue123fromserver);
mc.setProperty(HTTPConstants.MC_HTTP_SERVLETRESPONSE, 
response);
   
/**
 * Set Session properties
 */
mc.getSession().set(testServerSessionProperty, 11234test);

/**
 * Set SOAP-Header
 */
SOAPEnvelope env = 
mc.getResponseMessage().getSOAPEnvelope();
SOAPHeaderElement headerElement = new 
org.apache.axis.message.SOAPHeaderElement(http://webservice.cuba/headers;, 
myHeader, test12346);
env.addHeader(headerElement);

/**
 * Read SOAP-Header (source 
https://svn.apache.org/repos/asf/webservices/rampart/scratch/java/test-module/modules/chamanthi-jar/src/main/java/org/apache/rampart/chamanthi/handler/Receiver.java)
 */
env = mc.getRequestMessage().getSOAPEnvelope(); 
SOAPHeaderElement header = 
env.getHeaderByName(http://webservice.cuba/headers;, myHeader);
if (header != null)
System.out.println(Server: SOAP-header - +header.getValue());

} catch (Exception e) {
e.printStackTrace(); // error output
}
System.out.println(Server: Finished);
return true; // WS return true


// Client 1 (for HTTP-Header)
System.out.println(Client: Start);
try {
/**
 * Simple WS-Call (source: 
http://ws.apache.org/axis/java/user-guide.html#ConsumingWebServicesWithAxis)
 * + set http-Header
 * + read http-Header
 */
String endpoint = 
http://localhost:80/CubaDummyServer/services/CubaAxisTestService;;
Service  service = new Service();
service.setMaintainSession(true); // Enable Session-support
Call call= (Call) service.createCall();
call.setTargetEndpointAddress( new java.net.URL(endpoint) );
call.setOperationName(new QName(http://webservice.cuba;, 
doSomething) );

// set http-Header
MessageContext msgContext = call.getMessageContext();
Hashtable userHeaderTable = (Hashtable) 
msgContext.getProperty(HTTPConstants.REQUEST_HEADERS);
if (userHeaderTable == null)
{
 userHeaderTable = new Hashtable();
}
userHeaderTable.put(testProperty, testvalue123);
   

Passing custom object to Axis2/J Web service

2009-12-23 Thread Kamran Soomro (کامرا ن سومرو)

Hi,

I've created a web service using Axis2/J and Eclipse WTP tools. I want  
to pass an object of a custom class into it. The class contains only  
one public String member. However, the proxy class generated on the  
client side does not provide me any way of specifying this member. Any  
suggestions on how to go about this would be much appreciated. Thanks!


--Kamran


WS-Eventing

2009-12-23 Thread Yashvant chauhan
How I can develope a WS-Eventing in Axis2


Re: SAAJ0009 Exception while sending a SOAP request

2009-12-23 Thread suzhen



Ananya wrote:
 
 Hi,
 
 I am using a soap client running on java 6 and server running on 1.5.
 I am writing a test class and getting the following exception when I send
 the request to a url which doesn't exist ( the test requires me to send
 the request to an incorrect url and check the fail over to the backup soap
 server).
 
 com.sun.xml.internal.messaging.saaj.client.p2p.HttpSOAPConnection post
 SEVERE: SAAJ0009: Message send failed
 
 Earlier when my client was running on jdk 1.4, I used to get
 java.net.UnknowHostException which was the desired result. But since I
 moved to java 6, I am getting a different error.
 I understand that the issue is with saaj now being part of the rt.jar in
 java 6. So now my request goes to the saaj implementation in rt.jar
 instead of Axis. 
 I would like to know what are the options to prevent this behavior apart
 from adding the axis related jar to the bootstrap loader or from adding
 the jar to the endorsed directory. 
 
 Thanks in advance
 
 
 

-- 
View this message in context: 
http://old.nabble.com/SAAJ0009-Exception-while-sending-a-SOAP-request-tp23628825p26905926.html
Sent from the Axis - User mailing list archive at Nabble.com.



Re: SAAJ0009 Exception while sending a SOAP request

2009-12-23 Thread suzhen

Hi,

Did you resolve this problem?

Now I face same problem as you.

Thanks,


Ananya wrote:
 
 Hi,
 
 I am using a soap client running on java 6 and server running on 1.5.
 I am writing a test class and getting the following exception when I send
 the request to a url which doesn't exist ( the test requires me to send
 the request to an incorrect url and check the fail over to the backup soap
 server).
 
 com.sun.xml.internal.messaging.saaj.client.p2p.HttpSOAPConnection post
 SEVERE: SAAJ0009: Message send failed
 
 Earlier when my client was running on jdk 1.4, I used to get
 java.net.UnknowHostException which was the desired result. But since I
 moved to java 6, I am getting a different error.
 I understand that the issue is with saaj now being part of the rt.jar in
 java 6. So now my request goes to the saaj implementation in rt.jar
 instead of Axis. 
 I would like to know what are the options to prevent this behavior apart
 from adding the axis related jar to the bootstrap loader or from adding
 the jar to the endorsed directory. 
 
 Thanks in advance
 
 
 

-- 
View this message in context: 
http://old.nabble.com/SAAJ0009-Exception-while-sending-a-SOAP-request-tp23628825p26905943.html
Sent from the Axis - User mailing list archive at Nabble.com.



Re: WS-Eventing

2009-12-23 Thread Prabath Siriwardena

Please have a look at [1].

Thanks  regards.
-Prabath

[1]: http://blog.facilelogin.com/search/label/Savan

Yashvant chauhan wrote:

How I can develope a WS-Eventing in Axis2



 




WSDL2Java

2009-12-23 Thread Demetris


Hi all,

   I intercept and transport the outgoing HTTP GET request to a remote 
axis container/engine
over a p2p overlay. I reissue the GET command using HTTP libraries on 
the remote side and the
URL I sent always has the http://127.0.0.1:8080 in it .. however the 
WSDL I get back does not
always (and I say does not always because it is not consistent over 
identical reps) contain this

local address in its namespace:

ex. wsdl:definitions 
targetNamespace=http://cypress.ne.uk:25718/axis/services/remoteBooks73862E4EF09047ABB172814D14F915A9; 


instead of
ex. wsdl:definitions 
targetNamespace=http://127.0.0.1:25718/axis/services/remoteBooks73862E4EF09047ABB172814D14F915A9; 


etc.

Why is this the case and should I force the namespace to be what I want 
on the client side by

using the --package command as a safeguard?

Thanks much
Demetris



Re: WSDL2Java

2009-12-23 Thread Demetris


Yep - I guess I answered my own question of how to manage the namespace. 
Since I am not really
interested on using the namespace on the client side other than building 
local directories to store the

stubs, I can simple use the --package option to generate what I need.
If there is any other (more efficient and correct method) out there by 
all means stop me ! ;)


Thanks

Demetris wrote:


Hi all,

   I intercept and transport the outgoing HTTP GET request to a remote 
axis container/engine
over a p2p overlay. I reissue the GET command using HTTP libraries on 
the remote side and the
URL I sent always has the http://127.0.0.1:8080 in it .. however the 
WSDL I get back does not
always (and I say does not always because it is not consistent over 
identical reps) contain this

local address in its namespace:

ex. wsdl:definitions 
targetNamespace=http://cypress.ne.uk:25718/axis/services/remoteBooks73862E4EF09047ABB172814D14F915A9; 


instead of
ex. wsdl:definitions 
targetNamespace=http://127.0.0.1:25718/axis/services/remoteBooks73862E4EF09047ABB172814D14F915A9; 


etc.

Why is this the case and should I force the namespace to be what I 
want on the client side by

using the --package command as a safeguard?

Thanks much
Demetris





EngineConfigurationFactory - No such file or directory

2009-12-23 Thread Peter Johnson
Hi,

Below you see some output of *truss *command on our server.
It seems Axis is trying to find *client-config.wsdd* and *
org.apache.axis.EngineConfigurationFactory* by searching the whole
classpath.

We want to get rid of these *No such file or directory* errors for our
performance concerns.

Errors for client-config.wsdd disappeared after we set *
axis.ClientConfigFile* property to point the default client-config.wsdd
file in axis.
JAVA_OPTIONS=${JAVA_OPTIONS}
-Daxis.ClientConfigFile=/config/client-config.wsdd

What about the strange No such file or directory error for
org.apache.axis.EngineConfigurationFactory? How to avoid it (by *
axis.ServerConfigFile*)? Is it safe/possible to set a global config for
different webservices? We have many webservices written by different teams,
and we don't want to check them all to see if they will be affected.

Any help will be appreciated.

*client-config.wsdd*
/.../.../wlserver10/wlserver_10.0/common/lib/client-config.wsdd2  No
such file or directory
/.../.../wlserver10/wlserver_10.0/domains/xxx-DMN/client-config.wsdd2
No such file or directory
/.../diagnostic803/DiagnosticsAgent/classes/boot/org/apache/axis/client/client-config.wsdd
2  No such file or directory
/.../.../wlserver10/wlserver_10.0/domains/xxx-DMN/servers/xxx-MAN1-M2-3/cache/EJBCompilerCache/-15y6mj31o919q/client-config.wsdd
2  No such file or directory
/.../.../wlserver10/wlserver_10.0/domains/xxx-DMN/servers/xxx-MAN1-M2-2/cache/EJBCompilerCache/-15y6mj31o919q/client-config.wsdd
2  No such file or directory
/.../.../wlserver10/wlserver_10.0/domains/xxx-DMN/servers/xxx-MAN1-M2-4/cache/EJBCompilerCache/-15y6mj31o919q/client-config.wsdd
2  No such file or directory
/.../.../wlserver10/wlserver_10.0/domains/xxx-DMN/servers/xxx-MAN1-M2-4/cache/EJBCompilerCache/18esxp4i4x9qr/client-config.wsdd
2  No such file or directory
/.../.../wlserver10/wlserver_10.0/domains/xxx-DMN/servers/xxx-MAN1-M2-4/tmp/_WL_user/App/3t3w3z/appEjb.jar/client-config.wsdd
2  No such file or directory

*org.apache.axis.EngineConfigurationFactory*
/.../.../wlserver10/wlserver_10.0/common/lib/META-INF/services/org.apache.axis.EngineConfigurationFactory
2  No such file or directory
/.../.../wlserver10/wlserver_10.0/domains/xxx-DMN/META-INF/services/org.apache.axis.EngineConfigurationFactory
2  No such file or directory
/.../.../wlserver10/wlserver_10.0/domains/xxx-DMN/servers/xxx-MAN1-M2-4/cache/EJBCompilerCache/-15y6mj31o919q/META-INF/services/org.apache.axis.EngineConfigurationFactory
2  No such file or directory
/.../.../wlserver10/wlserver_10.0/domains/xxx-DMN/servers/xxx-MAN1-M2-3/tmp/_WL_user/xyzWS/g0ci2b/war/WEB-INF/classes/META-INF/services/org.apache.axis.EngineConfigurationFactory
2  No such file or directory
/.../.../wlserver10/wlserver_10.0/domains/xxx-DMN/servers/xxx-MAN1-M2-4/tmp/_WL_user/myapp/jxwpwe/META-INF/services/org.apache.axis.EngineConfigurationFactory
2  No such file or directory
/.../.../wlserver10/wlserver_10.0/domains/xxx-DMN/servers/xxx-MAN1-M2-4/tmp/_WL_user/myapp/jxwpwe/war/WEB-INF/classes/META-INF/services/org.apache.axis.EngineConfigurationFactory
2  No such file or directory
/.../.../wlserver10/wlserver_10.0/domains/xxx-DMN/servers/xxx-MAN1-M2-2/cache/EJBCompilerCache/18esxp4i4x9qr/META-INF/services/org.apache.axis.EngineConfigurationFactory
2  No such file or directory
/.../.../wlserver10/wlserver_10.0/domains/xxx-DMN/servers/xxx-MAN1-M2-2/tmp/_WL_user/App/3u7hap/appEjb.jar/META-INF/services/org.apache.axis.EngineConfigurationFactory
2  No such file or directory

Peter.