RE: How do I pass an array as an OMElement?

2008-04-04 Thread Nate Roe

I found this KB article which I think is exactly what I want.

http://wso2.org/library/332

After I read that, at first I wasn't sure how to make an appropriate QName, but 
now I see that my auto-generated ADBBean classes make QName objects often, so I 
can copy paste from there.

Thanks,
Nate Roe

-Original Message-
From: Martin Gainty [mailto:[EMAIL PROTECTED]
Sent: Friday, April 04, 2008 4:45 PM
To: Nate Roe
Subject: Re: How do I pass an array as an OMElement?

assuming the wsdl defines some unique entity (such as Person) which will be
represented in Axiom code as an OMElement

   
http://data.test.vegas.com/xsd";
  attributeFormDefault="qualified" elementFormDefault="qualified"
  targetNamespace="http://data.test.vegas.com/xsd";>







//you can then assign the array to be an open ended Array of predefined
Person entities





 


Does this help?
M-
- Original Message -
From: "Nate Roe" <[EMAIL PROTECTED]>
To: 
Sent: Friday, April 04, 2008 6:00 PM
Subject: How do I pass an array as an OMElement?



I'm using Axis 1.3.

On the client side, I have an ADBBean setter method that takes an OMElement.
The corresponding service method takes an array of objects.

How do I make my array of objects into an OMElement?

Thanks,
Nate Roe

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



How do I pass an array as an OMElement?

2008-04-04 Thread Nate Roe

I'm using Axis 1.3.

On the client side, I have an ADBBean setter method that takes an OMElement.  
The corresponding service method takes an array of objects.

How do I make my array of objects into an OMElement?

Thanks,
Nate Roe

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Security Policy question

2008-04-04 Thread SGruverman
I'm trying to apply a digital signature to the inbound and outbound message
for a simple Axis2 (1.3) web service.
I would like the client to send their certificate with the request but send
the DN and certidicate serial # in the response and have the client look it
up in their keystore.
I've include the policy assertions in the services.xml for the server and
in the WSDL (which is used to codegen the client stub).

Questions:
   Is this signature validation scenario reasonable? Or is there a better
   practice for send information for validating the signature?
   Is there currently a way to get policy assertions from the WSDL into
   services.xml when generating code?
   Below are the relevant parts of the security policy I think should work
   as described above but doesn't: the reponse includes a
   BinarySecurityToken that is referenced
   in the reponse . Any ideas about what I'm doing wrong?


  
http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/AlwaysToRecipient";
>  

  

  


  
http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/Never";>
  

  

  


Any help on this is appreciated!

Also, if this is not appropriate for this list and there's a better one,
sorry and please let me know.

- Steve

__
Steve Gruverman
IntelliCare, Inc. | A Medco Health Solutions Company






-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



xmlns problem - targetNamespace="urn:TestSearchEngine" ceating problem document Literal web services

2008-04-04 Thread sh_santosh

Dear All,

I am facing a problem with xmlns.
I have created document literal web services. When send a SOAP request then
for 1st tag  xmlns is required -- xmlns="urn:TestSearchEngine"  but i don't
want to pass the xmlns.

If i am not passing xmlns in SOAP Request then it's throwing exception.
  So, i don't want to use the xmlns in SOAP request.

Schema inside WSDL :
 
 http://www.w3.org/2001/XMLSchema";>
 

   

  
 


How can i send SOAP request without xmlns . Is there any way to solve the
problem.

see SOAP request :

Content-Type: text/xml; charset=utf-8\r\n
SOAPAction: "http://www.test.com/UTSv/2004/01/01/SearchProduct";


http://schemas.xmlsoap.org/soap/envelope/";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xmlns:xsd="http://www.w3.org/2001/XMLSchema";>

  
  

 

  
  



 

Thanx
Santosh



  


Anne Thomas Manes wrote:
> 
> The problem is not caused by your namespace or WSDL. The problem is
> caused by the deploy.wsdd method. I suspect that your classpath or
> some other aspect of your server environment has not been set up
> correctly.
> 
> Anne
> 
> On Mon, Mar 31, 2008 at 11:52 AM, sh_santosh <[EMAIL PROTECTED]>
> wrote:
>>
>>
>>  It may be a classpath error. Do you have more information on the
>> exception?
>>
>>  Reply :
>>
>>Dear Anne,
>>
>>  I am taking a sample example - Document Literal web services.
>>  I have generated WSDL 2 Java, it's successful BUT
>>
>>When i try to Deploy it using AdminClient in axis. it is throwing
>>  Exception. ONLY this exception comes on console -
>>
>>  See Exception :-
>>  Processing file
>> 
>> /home/surekha/workspace/ezsan/src/webservices/wsdoclittest/book/deploy.wsdd
>>
>> Exception: AxisFault
>>   faultCode:
>> {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
>>   faultSubcode:
>>   faultString: java.lang.reflect.InvocationTargetException
>>   faultActor:
>>   faultNode:
>>   faultDetail:
>> {http://xml.apache.org/axis/}hostname:vibpj178
>>
>>
>> I think it's something related to beanMapping or typeMapping i have
>> putted
>>  bean Mapping in server-config.wsdd.
>>  but not working.
>>
>>  Please see the deploy.wsdd :
>>
>>
>> > xmlns="http://xml.apache.org/axis/wsdd/";
>> xmlns:java="http://xml.apache.org/axis/wsdd/providers/java";>
>>
>>   
>>
>>   >  use="literal">
>>   > value="urn:TestSearchEngine"/>
>>   >  value="TestSearchEngineInterfaceService"/>
>>   
>>   
>>   > 
>> value="webservices.wsdoclittest.annethomas.WsTestsearchdetailsSoapBindingImpl"/>
>>   
>>   
>>   >  xmlns:operNS="urn:TestSearchEngine" returnQName="ResponseDetail"
>>  returnType="rtns:responseDetail" xmlns:rtns="urn:TestSearchEngine"
>>  soapAction="" >
>> >  xmlns:tns="urn:TestSearchEngine"/>
>>   
>>   
>>   
>>
>>   > xmlns:ns="urn:TestSearchEngine"
>> qname="ns:responseDetail"
>> type="java:webservices.wsdoclittest.annethomas.ResponseDetail"
>> serializer="org.apache.axis.encoding.ser.BeanSerializerFactory"
>>
>> deserializer="org.apache.axis.encoding.ser.BeanDeserializerFactory"
>> encodingStyle=""
>>   />
>>   > xmlns:ns="urn:TestSearchEngine"
>> qname="ns:requestDetail"
>> type="java:webservices.wsdoclittest.annethomas.RequestDetail"
>> serializer="org.apache.axis.encoding.ser.BeanSerializerFactory"
>>
>> deserializer="org.apache.axis.encoding.ser.BeanDeserializerFactory"
>> encodingStyle=""
>>   />
>>   
>>  
>>
>>
>> Please see the WSDL file :
>>
>>
>> 
>>  > xmlns="http://schemas.xmlsoap.org/wsdl/";
>> xmlns:tns="urn:TestSearchEngine"
>> xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/";
>> xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/";
>> xmlns:xsd="http://www.w3.org/2001/XMLSchema";>
>> 
>> > targetNamespace="urn:TestSearchEngine"
>>
>> xmlns:xsd="http://www.w3.org/2001/XMLSchema";>
>>
>> 
>> 
>> 
>> > name="RequestDetail" type="tns:requestDetail" />
>>
>> 
>> 
>> 
>> 
>> 
>> 
>> > name="ResponseDetail" type="tns:responseDetail" />
>>
>> 
>> 
>> 
>>
>> 
>> 
>> > type="xsd:string" />
>> 

Re: [Axis2] Client Thread Safety

2008-04-04 Thread Davanum Srinivas

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Yes.

Daniel Ritchey wrote:
| From what I understand with Axis2 1.3, client stubs are not thread safe,
| however the ConfigurationContext is; so I can create a single
| ConfigurationContext (an expensive operation) and reuse it for all stub
| instances.
|
| Is this a correct assumption?
|
| Thanks,
| Dan Ritchey
|
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.5 (Cygwin)

iD8DBQFH9i6bgNg6eWEDv1kRAvtPAKCufdr3XRrzrv8gr9+hhuf+cwIb6wCgnFlU
drUtQSfPBRlsR9M3J/Aduo4=
=MofF
-END PGP SIGNATURE-

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[Axis2] Client Thread Safety

2008-04-04 Thread Daniel Ritchey
>From what I understand with Axis2 1.3, client stubs are not thread safe,
however the ConfigurationContext is; so I can create a single
ConfigurationContext (an expensive operation) and reuse it for all stub
instances.

Is this a correct assumption?

Thanks,
Dan Ritchey


Migrating Project form axis 1.4 to axis2

2008-04-04 Thread Strembski, Christoph (ESN-Bochum)
Hi,

 

im currently trying to migrate an existing project from axis to axis2.
That means I will run the contract first approach because the interface
must not be changed. What I really want to do is to run a "code and
contract first" approach.

 

When I try to use wsdl2java I get disappointing results.  I'm trying to
deploy a doc/lit Service on POJOs. But either one does not work: 

-  Keeping my POJOs, by using custom MessageRecievers

-  Having doc/lit WebServices

 

The next-best possible approach is to use wsdl2java with mappings
(namespace settings don't match java classes) with the -em option and an
xml based mapping file.  That makes any object generated with its own
marshalling and unmarshalling methods. The generated sources are quite
different from the actual structure. This means I'll have to tweak the
mapping and the generated sources to meet the desired structure. This is
a terrible job to do, which will take ages.

 

Is there any support say "axis to axis2" migration tool? Does anyone
have experience in migrating existing pojo doc/lit WebServices to axis2
using custom mappings? Do I make any mistake by design?

 

Any help is appreciated

Christoph Strembski



AnlageAilog.wsdl
Description: AnlageAilog.wsdl
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Re: setManageSession not working in JAVA client to .NET web service

2008-04-04 Thread Deepal Jayasinghe



Hi.

 I am writing a Java client to a .NET web service. I call an 
authentication service and then I get a cookie in the response. I need 
to set the cookie in all subsequent outgoing requests to other web 
services available on the same server. I tried using the 
"setManageSession(true)" , but it is not setting the cookie. I 
verified this on the TCP Monitor. I am attaching my code. Can somebody 
help me with how to get this working or point me to some other thread 
on the same problem.


T
Axis2 handle the JSSIONID correctly , however in the case of .net they 
use some other name. Even for that we have support in Axis2 but you need 
to set the following property before you call the service


options.setProperty("customCookieID" ,"Cookie Name")

Once you set this and setManageSession , Axis2 will send the correct 
cookie back.


Thank you!
Deepal


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



setManageSession not working in JAVA client to .NET web service

2008-04-04 Thread Rajat Bhushan

Hi.

 I am writing a Java client to a .NET web service. I call an 
authentication service and then I get a cookie in the response. I need 
to set the cookie in all subsequent outgoing requests to other web 
services available on the same server. I tried using the 
"setManageSession(true)" , but it is not setting the cookie. I verified 
this on the TCP Monitor. I am attaching my code. Can somebody help me 
with how to get this working or point me to some other thread on the 
same problem.


Thanks,
Rajat
package almconnectorserver;

import org.apache.axiom.om.OMAbstractFactory;
import org.apache.axiom.om.OMElement;
import org.apache.axiom.om.OMFactory;
import org.apache.axiom.om.OMNamespace;
import org.apache.axis.transport.http.HTTPConstants;
import org.apache.axis2.Constants;
import org.apache.axis2.addressing.EndpointReference;
import org.apache.axis2.client.Options;
import org.apache.axis2.client.ServiceClient;

import org.omg.CORBA.TIMEOUT;

public class ClientTrial {

private static EndpointReference targetEPR1 = new EndpointReference("http://localhost:81/pwa/_vti_bin/psi/LoginForms.asmx";);
private static EndpointReference targetEPR2 = new EndpointReference("http://localhost:81/pwa/_vti_bin/psi/Project.asmx";);
private static long TIMEOUT = 1;
public ClientTrial() {
}

public static void main(String[] args) throws Exception{
OMElement loginRequest;
OMElement projectList;
ServiceClient sender = new ServiceClient();
try{
loginRequest = loginProject("Srinivasan Raman","[EMAIL PROTECTED]");
Options options = new Options();
options.setTo(targetEPR1);
options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
options.setAction("http://schemas.microsoft.com/office/project/server/webservices/LoginForms/Login";);
options.setTimeOutInMilliSeconds(TIMEOUT);
sender.setOptions(options);
sender.getOptions().setManageSession(true);
OMElement result = sender.sendReceive(loginRequest);
String response = result.getFirstElement().getText();
System.out.println(response);
}
catch(Exception ex){
ex.printStackTrace();
}
try{
projectList = createProjectList();
Options options = new Options();
options.setAction("http://schemas.microsoft.com/office/project/server/webservices/Project/ReadProjectList";);
options.setTo(targetEPR2);
options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
options.setTimeOutInMilliSeconds(TIMEOUT);
sender.setOptions(options);
OMElement result = sender.sendReceive(projectList);
}
catch(Exception ex){
ex.printStackTrace();
}
}

public static OMElement createProjectList() {
OMFactory fac = OMAbstractFactory.getOMFactory();
OMNamespace omNS = fac.createOMNamespace("http://schemas.microsoft.com/office/project/server/webservices/Project/","tns";);

OMElement method = fac.createOMElement("ReadProjectList",omNS);
   
return method;
}

public static OMElement loginProject(String uname,String passwd) {
OMFactory fac = OMAbstractFactory.getOMFactory();
OMNamespace omNS = fac.createOMNamespace("http://schemas.microsoft.com/office/project/server/webservices/LoginForms/","tns";);

OMElement method = fac.createOMElement("Login",omNS);

OMElement value1 = fac.createOMElement("username",omNS);
value1.addChild(fac.createOMText(value1,uname));
method.addChild(value1);

OMElement value2 = fac.createOMElement("password",omNS);
value2.addChild(fac.createOMText(value2,passwd));
method.addChild(value2);

return method;
}

}

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Re: Axis2 Client Engage Module

2008-04-04 Thread A Sunley

Thanks Dimuthu,

By engaging the module with each request, do you think this represents any
significant difference in performance?

Regards,
Alan. 



Dimuthu-2 wrote:
> 
> Hi,
> 
> When you engage the module to client it has to be engaged each time you
> instantiate a new ServiceClient. Each time the module is engaged it will
> be extracted into the temp folder to do class loading much faster.
> 
> You can avoid this by engaging the module to the
> ConfigurationContext[1]. Then it will be done only once.
> 
> Thank you,
> Dimuthu
> 
> [1]
> ConfigurationContext ctx =
> ConfigurationContextFactory.createConfigurationContextFromFileSystem(path,
> path + "/conf/axis2.xml");
> ctx.getAxisConfiguration().engageModule("rampart");
> 
> On Thu, 2008-04-03 at 15:59 -0700, A Sunley wrote:
>> Greetings Axis users,
>> 
>> We are accessing a web service from within a jsp/servlet webapp within a
>> Tomcat container, using Axis2-1.2. We also make use of the Rampart
>> security
>> module.
>> 
>> I want to clarify how we should 'engage' module. At the moment we do this
>> for every request to the webservice using:
>> 
>> client.engageModule(new QName("rampart"));
>> 
>> Do we have to do this for each and every request or can we delpoy the
>> module
>> once for the web application?
>> 
>> I am noticing that for each request the following is printed to the
>> console:
>> "Deploying module: rampart-1.2". In addition the Tomcat/temp folder is
>> chocker full of "axis264rampart-1.2.mar" files (each with a different
>> number). The temp file is now approaching one gigabyte in size.
>> 
>> Is this normal behavior? I'm concerned that I might have not configured
>> the
>> Axis2 client correctly and may potentially cause performance issues.
>> 
>> Is this that case?
>> 
>> Regards,
>> Alan.
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Axis2-Client-Engage-Module-tp16475749p16490209.html
Sent from the Axis - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: session problem

2008-04-04 Thread Michelantonio Trizio
This code is in a service that invoke another service in the same
servicegroup.
Thank you.

 Michelantonio

2008/4/4, Deepal Jayasinghe <[EMAIL PROTECTED]>:
>
>
>
>
>
> >
> > I'd like someone make a comment on my solution.
> > Thanks
> > Mikelantonio
> >
> > ServiceGroupContext
> > sgc=MessageContext.getCurrentMessageContext().getServiceGroupContext();
> >
> Is this code in client side or the server side ?
>
> > HashMap map=new HashMap();
> >QName qn=new QName("http://ws.apache.org/namespaces/axis2";,
> > "ServiceGroupId");
> >OMElement el = AXIOMUtil.stringToOM(" > xmlns:axis2=\"http://ws.apache.org/namespaces/axis2\<
> > http://ws.apache.org/namespaces/axis2%5C>" xmlns:wsa=\"
> > http://www.w3.org/2005/08/addressing\<
> > http://www.w3.org/2005/08/addressing%5C>"
> > wsa:IsReferenceParameter=\"true\">"+sgc.getId()+"");
> >map.put(qn, el);
> >AdministratorServiceStub ass=new AdministratorServiceStub("
> > http://localhost:8080/Profiler0.1/services/AdministratorService";);
> >ass._getServiceClient().engageModule("addressing-1.3");
> >ass._getServiceClient().getOptions().setManageSession(true);
> >
> >  ass._getServiceClient().getOptions().getTo().setReferenceParameters(map);
> >
> Please have a look at his too
> http://wso2.org/library/3184
>
> Thank you!
> Deepal
>
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-- 
It's creepy, but here we are, the Pilgrims, the crackpots of our time,
trying to establish our own alternate reality. To build a world out of rocks
and chaos. What it's going to be, I don't know. Even after all that rushing
around, where we've ended up is the middle of nowhere in the middle of the
night. And maybe knowing isn't the point. Where we're standing right now, in
the ruins in the dark, what we build could be anything. [Choke - Chuck
Palahniuk]


Turning off Schema validation in Axis2 1.3

2008-04-04 Thread Sakari.Isoniemi


Hello

There has been quite a lot discussion of schema validation 
in Axis2 and I have understood that omitting validation is possible only
in JIXB model
or how would it be possibe with ADB ?

It would be nice to bybass validation in runtime but generation time is
enough.

I now use version Axis2 1.3

br. Sakari


Re: Alternatives to LifeCycle interface to allow data to be freed off immediately after a response is sent?

2008-04-04 Thread Deepal Jayasinghe




Hi,

I'm writing a web service using Axis2 that passes back binary data on 
the response.  Inside my service I achieve this by creating a 
DataHandler corresponding to the File I want to return, then add in 
some OMText to the response by calling OMFactory.createOMText(Object, 
boolean).
If you are using POJO approach , from the method you can just return the 
DataHandler rather than creating an OM element .


My Service is implemented to extend LifeCycle, so that after the 
message is sent I can delete the file that the File object represents 
(deleting it earlier doesn't work because it is only read in once I 
return to Axis2).  However that means I'm waiting until the HTTP 
session is closed before deleting the file, which I'd prefer not to 
do.  What I'd really like to do is have some sort of callback as soon 
as the message is sent (at which point I'm safe to delete the file).  
Any ideas?

hmm , I do not think we have something like that in Axis2.

Thank you!
Deepal


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]