web service clients and OMElement

2009-04-03 Thread Ashish Sarna
Hello,

 

I am new to Axis2. I was going through samples provided by Axis and read few
other articles. 

 

When Axis2 service is build using AXIOM, all the methods need to follow a
fix signature: 

 

OMElement methodName(OMElement) 

 

Or

 

void methodName(OMElement)

 

In services.xml, we specify the message receivers as
RawXMLINOutMessageReceiver or RawXMLINOnlyMessageReceiver. 

 

My question is that how would a non-java client call the methods which
accept an OMElement object reference? Is it like something that client
passes a String (which is in XML format) and message receiver converts in
into OMElement reference?

 

Please help me understand this concept.

 

Thanks.



Re: WSDL2JAVA created uncompilable Stub

2009-04-03 Thread Jacques46

Just putting in my 2 cents, because a week ago I knew nothing about Axis, and
I had to overcome some of the hurdles that have been encountered by other
posters in the past...  I hope I can avoid other people the same wasted time
that I experienced...

My environment is Eclipse 3.2.2, with the Codegen Wizard plugin.

I have used the wizard in both directions (wsdl2java and java2wsdl) in
versions 1.3 and 1.4.1 of Axis2.

About the wizard : when you go to the Axis website, you can download the
Codegen Wizard plugin for any version of Axis.  What's misleading is that
when you unzip each version (1.3 and 1.4.1), they both are contained in the
"Axis2_Codegen_Wizard_1.3.0" directory.  Having successfully created my
stubs with version 1.3 of the wizard and Axis libraries, I now wanted to
compile them with Axis2 1.4.1.  My first reaction when I downloaded the
1.4.1 wizard was to say "hmmm... seems the wizard hasn't changed since
version 1.3, because it's in the same directory name".  WRONG !  Upon
further inspection, I clearly saw that the libraries in the /lib directory
of the plugin were indeed different.

So, here are the steps I would recommend for a successful compile :

- If you're in Eclipse, EXIT !
- If you have not done so yet, download the Axis2 standard distribution
binary for the version you want, unzip it to some directory, and then create
an environment variable "AXIS2_HOME" that points to that directory.
- Download the Codegen Wizard for the Axis version you're shooting for (the
same version as the standard distribution).  Unzip it into your Eclipse's
plugins directory.  Note that if you had a previous version of the plugin
there, you're gonna have to overwrite it with this new one if they both have
the same name.
- Copy the geronimo-stax-api_1.0_spec-1.0.1.jar and
backport-util-concurrent-3.1.jar from the AXIS2_HOME/lib directory to the
Wizard's /lib directory.
- Edit the plugin.xml file of the Wizard.  You'll see in there a bunch of
 nodes, add 2 nodes pointing to the jars you just copied.
- Start Eclipse
- Create a new project
- In that project, import the jars from the AXIS2_HOME/lib directory (import
them in a new folder you'll call lib)
- Refresh the project
- Project properties : Add all the jars to the build path
- Create some java class that will have the methods you want your web
service to have.  Save it.
- Right-click on the project, New->, Other...
- Select Axis2 Wizards -> Axis2 Code Generator, Next.
- Select Java2WSDL
- Type the fully qualified class name, and then add the path for the class
file.  For example, if you class is com.xyz.TheClass, and your java source
is in /src/com/xyz/TheClass.java, and the corresponding class file
is in /bin/com/xyz/TheClass.class, then you'd enter "/bin.
- Click Test Class Loading...  If it doesn't work, review previous step.
- Click Next, and you can change the options if you want, and then click
next again.
- Select to send the output to a project in the workspace, and browse to
that project.  Then give your wsdl a name, and click Finish.
- Hopefully, all went well, and if you refresh your project, you'll see the
WSDL.

Now, if you want to create client and server code for this new WSDL:

- Go in the codegen wizard again, this time select WSDL2Java, click Next.
- Select the WSDL file you've just created.  Next.
- In Codegen Option, select Custom.  Check "Generate both..." (last
checkbox).  Next.
- Browse to the project location, and Click Finish.

You should have the client and server code generated, along with a nice ant
build file.

The class you'll want to modify is Skeleton.java for the
server-side.  For a client to use that service, you'd instantiate
Stub.java.

I really hope this helps someone in the future.  It's been a frustrating
week.

Jacques.
-- 
View this message in context: 
http://www.nabble.com/WSDL2JAVA-created-uncompilable-Stub-tp17775033p22872262.html
Sent from the Axis - User mailing list archive at Nabble.com.



XSI type attribute has no namespace prefix

2009-04-03 Thread Steve Buster

I have a service written in Axis2 1.3 and when response messages are is sent 
back it contains the XSI:type attribute, but there is not namespace prefix for 
it.  This is causing errors for client applications.  A sample of the message 
is below.  Has anyone else seen this issue, and has it been resolved in a 
future version?


  
 http://windowslive.com/RediscoverHotmail?ocid=TXT_TAGLM_WL_HM_Rediscover_Mobile1_042009

wsdl2java and javadoc (AXIS2-3371)

2009-04-03 Thread Martin Fernau
Are there any news about this improvement?
https://issues.apache.org/jira/browse/AXIS2-3371

Would be really handy to have javadoc generated if using contract first...


RV: problems with Axis2

2009-04-03 Thread Alcaraz Galofre, Joan Eugeni

Sr Developers of Axis2:
 
I have a problem with Axis2 after a couple of days  working without
success
 
I develop a axis2 webservice client embeded into a web application. 
The objective is download a binary file using MTOM technology
 
The webservice client generate the following exception
 
Caused by: javax.activation.UnsupportedDataTypeException: 
no object DCH for MIME type text/xml; charset=UTF-8
 at
javax.activation.ObjectDataContentHandler.writeTo(DataHandler.java:851)
 
The code of the web service client is like this:
 
EndpointReference targetEPR = new EndpointReference(URLConnexion);
Options options = new Options();
options.setTo(targetEPR); 
options.setAction("urn:"+functionName);
options.setProperty(Constants.Configuration.ENABLE_MTOM,
Constants.VALUE_TRUE); //configure MTOM at client side
options.setTransportInfo(Constants.TRANSPORT_HTTP,Constants.TRANSPORT_HT
TP, false); //optimize MTOM at client side
options.setSoapVersionURI(SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI); 
options.setProperty(Constants.Configuration.MIME_BOUNDARY,
"Axis2_MIME_Boundary"); //force Axis2 MIME head
options.setProperty(HTTPConstants.CHUNKED,Constants.VALUE_TRUE); 
 
options.setTimeOutInMilliSeconds(1); //delay a maximum of 10 seconds
ServiceClient sender = new ServiceClient();
sender.setOptions(options);
OperationClient mepClient =
sender.createClient(ServiceClient.ANON_OUT_IN_OP); //use the
OperationClient method
MessageContext mc = new MessageContext();
SOAPEnvelope env = createEnvelope(XML,functionName);
mc.setEnvelope(env);
 
mepClient.addMessageContext(mc);
mepClient.execute(true); <== GENERATE THE EXCEPTION AT THIS POINT
 

What's it happend? Have anyone any idea?
 
I work with axis2 1.3.jar

for MIME support I use activation.jar (1.1v) and mail.jar (1.4v).
 
Both (client and server) uses the same version of activation.jar and
mail.jar
 
Compiled with WSAD 5.1.1 (WebSphere v5 JRE)
 
The web application is deployed into a WAS 6.1

Both SO are Windows 2000 SP4
 
I hope your answers and thanks in advance!
 
Sincerely
 
Joan Alcaraz
 
PD: sorry my poor english



This e-mail and any attachments may contain confidential or
privileged information. Any unauthorised copying, use or distribution of
this information is strictly prohibited.