Calling one Axis2 Web Service from another

2008-11-19 Thread Howell, David
Back in August there was a thread on this list about problems that arise
when you try to call an Axis2 Web service from another one:
http://www.mail-archive.com/axis-user@ws.apache.org/msg42206.html

 

Basically, you can implement Service A, and write a client using
ServiceClient,

 

ServiceClient client = new ServiceClient();

Options clientOptions = new Options();

 

clientOptions.setTo(new
EndpointReference(ServiceAEndpointURL));

client.setOptions(clientOptions);

 

OMElement request makeRequestElement();

OMElement response = client.sendReceive(request);

 

and get this to work from a test program, but if you move this code to
the implementation of an operation in a 2nd service, the sendReceive()
invocation throws an exception:

 

[WARN] triggerActionNotSupportedFault: messageContext: [MessageContext:
logID=urn:uuid:29EB883E1292BECC7B1227033256438] problemAction:
urn:anonOutInOpResponse

[ERROR] The [action] cannot be processed at the receiver.

org.apache.axis2.AxisFault: The [action] cannot be processed at the
receiver.

at
org.apache.axis2.addressing.AddressingFaultsHelper.triggerAddressingFaul
t(AddressingFaultsHelper.java:373)

at
org.apache.axis2.addressing.AddressingFaultsHelper.triggerActionNotSuppo
rtedFault(AddressingFaultsHelper.java:336)

at
org.apache.axis2.handlers.addressing.AddressingValidationHandler.checkAc
tion(AddressingValidationHandler.java:149)

at
org.apache.axis2.handlers.addressing.AddressingValidationHandler.invoke(
AddressingValidationHandler.java:55)

...

 

As far as I know, this hasn't been resolved - is that correct?

 

I can see that for Web Service deployments that provide wrapper
interfaces intended for use by other parties this isn't an issue.
However, if you're trying to put together a service-orientated system
involving extensive use of services by other services, this seems to be
a significant problem - to the point where I wonder whether I'm missing
something. 

 

I appreciate that these intra Axis2 calls are candidates for migration
to some other invocation mechanism such as RMI, but  I wouldn't have
expected to have to do that in all cases right from the start. 

 

Would using Axis2 in the context of an ESB like the WSO2 ESB provide a
way avoid this problem?

 

Any comments would be appreciated.

 

Dave

 

 



Re-generating an Axis 1.4 Web Service in Eclipse?

2008-11-04 Thread Howell, David
Hi,

 

I'm using Eclipse Europa and Axis 1.4 (i.e. not Axis2) to generate a Web
service in a top-down manner from a wsdl file I have created. This was
working fine, and I was able to generate server-side stubs and develop
my service until I wanted to alter the wsdl and change some of the
elements used in the message definitions (it's a doc/literal service).

 

I tried to recreate the service from the wsdl by re-running the Web
Service wizard without doing anything else to the Eclipse project and
started to get class not found exceptions associated with generated
classes corresponding to an XML element I was no longer using. (I'd post
the exception details, but I no longer have the console output.)

 

= Is there something I should have done at this point equivalent to a
clean and re-build action?

 

 

Assuming that there were stale build products in my project I deleted
the WebContent folder, hoping that the Web Service wizard / codegen
tools would recreate everything necessary. What I find now is that some
of the files in this folder are generated anew: the WEB-INF  and lib
folders are there, and the generated classes are in the src folder tree.


 

But other files are missing, and the service can't be deployed to
Tomcat: no META-INF folder, no server-config.wsdd or web.xml.

 

= Is there anything I can do at this point to get the Axis 1.4 Web
service tools to generate all the appropriate artefacts as though it was
doing it for the first time? 

 

Thanks,

 

Dave



RE: Re-generating an Axis 1.4 Web Service in Eclipse?

2008-11-04 Thread Howell, David
I now see that the stuff in WEB-INF isn't solely the responsibility of
the axis tools, but am still curious: as I iterate through the cycle of:

 

1) Author or edit my wsdl and xsd files

2) Generate the axis artifacts

3) Work on my service implementation

 

Is there anything that I need to or can do prior to repeating step 2)
that with clean out any axis generated artifacts so I don't have any
stale files in my Eclipse project?

 

Dave

 

From: Howell, David [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, November 04, 2008 9:44 AM
To: axis-user@ws.apache.org
Subject: Re-generating an Axis 1.4 Web Service in Eclipse?

 

Hi,

 

I'm using Eclipse Europa and Axis 1.4 (i.e. not Axis2) to generate a Web
service in a top-down manner from a wsdl file I have created. This was
working fine, and I was able to generate server-side stubs and develop
my service until I wanted to alter the wsdl and change some of the
elements used in the message definitions (it's a doc/literal service).

 

I tried to recreate the service from the wsdl by re-running the Web
Service wizard without doing anything else to the Eclipse project and
started to get class not found exceptions associated with generated
classes corresponding to an XML element I was no longer using. (I'd post
the exception details, but I no longer have the console output.)

 

= Is there something I should have done at this point equivalent to a
clean and re-build action?

 

 

Assuming that there were stale build products in my project I deleted
the WebContent folder, hoping that the Web Service wizard / codegen
tools would recreate everything necessary. What I find now is that some
of the files in this folder are generated anew: the WEB-INF  and lib
folders are there, and the generated classes are in the src folder tree.


 

But other files are missing, and the service can't be deployed to
Tomcat: no META-INF folder, no server-config.wsdd or web.xml.

 

= Is there anything I can do at this point to get the Axis 1.4 Web
service tools to generate all the appropriate artefacts as though it was
doing it for the first time? 

 

Thanks,

 

Dave



[Un]marshalling rpc/encoded SOAP body in Axis2 web service

2008-10-29 Thread Howell, David
Hi,

I'm developing a doc/literal Web service in Axis2 that needs to invoke a 3rd 
party Web service that uses the rpc/encoded style. From previous posts to this 
list it looks like my main options are:

1) Use Axis 1.4 to write a doc/literal service that is a wrapper around the 3rd 
party service, then invoke the wrapper from my Axis2 service.

2) Within my Axis2 web service use an instance of ServiceClient and deal 
directly with the OMElement instances that are the request and the response.

In order to compare the alternatives I'm trying to understand how to approach 
option 2). I'm already using Axiom rather than any form of data binding, so am 
OK with that part of things, but have had no luck tracking down some means of 
[un]marshalling to/from the SOAP encoded body element other than rolling my own 
implementation.

Does anyone have any pointers on how to do this? I realize that this isn't 
necessarily an Axis2 question, so if you want to point me at another list, 
thanks fine with me.

Thanks,

Dave

-Original Message-
From: Tian Chi [mailto:[EMAIL PROTECTED] 
Sent: Monday, October 13, 2008 7:32 PM
To: axis-user@ws.apache.org
Subject: RE: [Axis2]Help! How to create a SOAP service using Axis2 in my own 
webapp?


Thank you very much for your quick response, Ricky.
I'll start building the war file you mentioned.

Can I ask you two more questions about how to creat a SOAP service using Axis2?

Basically my client will just send a XML file with data using the SOAP service 
I'll provide him (an URL). From the document, I think the service names will be 
defined in the services.xml and associate with a java class with all the 
functions (services) there. My question is how in my class program to get the 
XML file my client posted?

I saw some example, it just pass the parameters using '?'

http://my-service-URL/getPrice?book=1234

But using SOAP, my client's XML file will be posted to my service program, How 
to get the XML document sent from my client to my service?

If it's too much to explain, do you know any online exmaples I can look into?

My 2nd question is
How to define the 'SOAPAction' in the service I'll create?

thank you again, 

-tian 


--- On Tue, 10/14/08, Ricky Murphy [EMAIL PROTECTED] wrote:

 From: Ricky Murphy [EMAIL PROTECTED]
 Subject: RE: [Axis2]Help! How to create a SOAP service using Axis2 in my own 
 webapp?
 To: axis-user@ws.apache.org
 Date: Tuesday, October 14, 2008, 11:51 AM
 Right, there will be a lot of jars. Actually, your web
 application will end up like what makes axis2.war
 eventually. 
 you may remove all those admin related stuff from
 your app. Start with those made axis2.war, use
 all its directory structure and build your own app and
 embed axis2 inside.
 
 HTH
 
 -Ricky
 
 
 
  Date: Mon, 13 Oct 2008 17:38:14 -0700
  From: [EMAIL PROTECTED]
  Subject: [Axis2]Help! How to create a SOAP service
 using Axis2 in my own webapp?
  To: axis-user@ws.apache.org
  
  MIME-Version: 1.0
  Content-Type: text/plain; charset=iso-8859-1
  Content-Transfer-Encoding: quoted-printable
  
  Hi all, 
  
  Sorry previous message is still in wrong text format, this is it again.
  
  I'm a newbie on using Axis2. After reading through most of the documents on 
  this site,
  I still couldn't find the answer I need. I'd really apreciate it if someone 
  can help me on this.
  
  All Axis2 documents I read on this site are to build new web 
  services/client using Axis2.
  Currently I have already a big web app  in use and I need to add a SOAP 
  service to
  my web app using Axis2. Is that doable?  If yes, what are the steps to   
  make that happen?
  
  Is it possible to copy axis2.war into my servlet container (Resin)(both 
  'axis2' and 'myWebapp' directories under webapps directory) , create   a 
  SOAP service in the axis2 app and then forward the request (by deinfing the 
  'ServiceClass' parameter in services.xml?) to my own web app   to handle 
  some complicated database processes? It seems to me it's not   doable.  
  Please don't laugh at me if this question is too sily. 
  
  If the previous approach is not possible. The only other apprach I can   
  think of is to embed Axis2 in my
  own webapp. In that case, do I need to copy all the needed Axis2 jar files 
  to my own web app in WEB-INF/lib directory? If so, what are the needed jar 
  files for a SOAP service? 
  Basically the SOAP service is receive data from my client, save it to   
  database and respond to client with the results. There are many jar files 
  in Axis2. I just hope to skip some unnecessary Axis2 jar files to avoid 
  overhead since my own web app is already very big.
  
  Besides the Axis2 jar files, what else needs to be done to embed a SOAP 
  service in my own web app?
  
  I'd really really appreciate it if someone gives me some guidance or shed 
  some lights on this.
  Hope to hear from you soon.
  
  thank you very much,
  
  -tian
  
 
 

Versioning a service deployed on Axis2

2008-10-21 Thread Howell, David
Hi,

 

Is there a recommended or commonly used approach to versioning a service
(SOAP, doc/literal) that is to be deployed on Axis2? I'm trying to
provide some means of not breaking consumers of an existing service if I
have to deploy a new version that isn't backwards compatible. We're
using AXIOM / no data binding for the service consumers and producers.

 

In a lot of cases I think I'll just want to move from deploying
MyService_V1.aar to deploying MyService_V2.aar. V1 can stay deployed on
the Axis2 server until the consumers have all moved on to V2. 

 

I've been looking at including version information in the target
namespace specified in the WSDL for the service as a mechanism for
consumers to specify which version of the service they want to use. I'm
struggling to understand what my options are for deploying the old and
new versions of my service. Specifically:

 

- I don't seem to need to deploy MyService_V1 and MyService_V2 on
different endpoint addresses, but

- I assume I do have to give them different names in the service
element of the wsdl.

 

Is this correct?

 

Finally, is there any way of using a single endpoint and service name
that accepts requests from consumers that may have different XML
namespaces depending on the version of the service they are using?

 

Thanks,

 

Dave