You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by A Andrew <wi...@yandex.ru> on 2008/04/16 23:29:52 UTC

adding handler to client (generated with WSDL2Java) (AXIS 1.4)

I've generated with WSDL2Java Client for this web-service:
http://www.w3schools.com/webservices/tempconvert.asmx?WSDL

in my program I use this code:

TempConvert service = new TempConvertLocator();
TempConvertSoap port = service.getTempConvertSoap();
System.out.println(port.celsiusToFahrenheit("20"));//returns 68

But how to recieve SOAP request and response messages content that stand upon this call?(without client-config.wsdd)

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Axis2 Client error NoSuchMethodError - Weblogic jrockit

Posted by "Qureshi, Affan" <AQ...@epsilon.com>.
Hi,

I am trying to call a web service using Axis2. I am getting a weird error when deploying my application to Weblogic running jrockit 1.4.2_05. My code is really simple, all I am doing is using the ADB generated stub, I call the web service with required parameters.

It works fine when I run the same code in a stand alone main() class. I use Sun's JDK 1.4.2 to run that.

java.lang.NoSuchMethodError: <init>
at org.apache.axis2.engine.DispatchPhase.<clinit>()V(DispatchPhase.java:270)
at jrockit.vm.Reflect$IClass.runClinit(I)V(Unknown Source)
at jrockit.vm.Reflect$IClass.ensureInitialized(Ljava.lang.Class;)V(Unknown Source)
at java.lang.Class.newInstanceCached(I)Ljava.lang.Object;(Unknown Source)
at java.lang.Class.newInstance(I)Ljava.lang.Object;(Unknown Source)
at
org.apache.axis2.deployment.AxisConfigBuilder.getPhase(Ljava.lang.String;)Lorg.apache.axis2.engine.Phase;(AxisConfigBuilder.java:638)                          at org.apache.axis2.deployment.AxisConfigBuilder.processPhaseList(Lorg.apache.axiom.om.OMElement;)Ljava.util.ArrayList;(AxisConfigBuilder.java
:390)
        at org.apache.axis2.deployment.AxisConfigBuilder.processPhaseOrders(Ljava.util.Iterator;)V(AxisConfigBuilder.java:433)
        at org.apache.axis2.deployment.AxisConfigBuilder.populateConfig()V(AxisConfigBuilder.java:133)
        at org.apache.axis2.deployment.DeploymentEngine.populateAxisConfiguration(Ljava.io.InputStream;)Lorg.apache.axis2.engine.AxisConfiguration;(De
ploymentEngine.java:615)
        at org.apache.axis2.deployment.FileSystemConfigurator.getAxisConfiguration()Lorg.apache.axis2.engine.AxisConfiguration;(FileSystemConfigurator
.java:115)
        at org.apache.axis2.context.ConfigurationContextFactory.createConfigurationContext(Lorg.apache.axis2.engine.AxisConfigurator;)Lorg.apache.axis
2.context.ConfigurationContext;(ConfigurationContextFactory.java:64)
        at org.apache.axis2.context.ConfigurationContextFactory.createConfigurationContextFromFileSystem(Ljava.lang.String;Ljava.lang.String;)Lorg.apa
che.axis2.context.ConfigurationContext;(ConfigurationContextFactory.java:180)
        at org.apache.axis2.client.ServiceClient.configureServiceClient(Lorg.apache.axis2.context.ConfigurationContext;Lorg.apache.axis2.description.A
xisService;)V(ServiceClient.java:146)
        at org.apache.axis2.client.ServiceClient.<init>(Lorg.apache.axis2.context.ConfigurationContext;Lorg.apache.axis2.description.AxisService;)V(Se
rviceClient.java:139)
        at com.frequencymarketing.citi.ws.sonar.generated.EchoWebServiceStub.<init>(Lorg.apache.axis2.context.ConfigurationContext;Ljava.lang.String;Z
)V(EchoWebServiceStub.java:235)

Any clues to fix this?

Thanks a lot!

Affan


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: SecurityOutflow Configuration

Posted by Davanum Srinivas <da...@gmail.com>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Anthony, Sean,

Please raise a stink on rampart-dev@ that these should not be remove in a future version and should not be marked
deprecated :)

Thanks,
dims

PS: Background, There are some people who don't listen to logic and wanted to get rid of these useful API's...

Anthony Bull wrote:
| We've got the same problem in production.  It basically isn't a risk
| unless you upgrade to a future version of Axis 2/Rampart that they have
| decided to remove those classes or the functionality they provide is
| turned off.
| To minimise the effect of this, all our production web services and web
| clients (we have 5 independent axis 2 web services running in
| production) use the same re-usable security library that abstracts the
| rampart configuration code.  So, when we change the ouflowConfiguration
| code, we only need to rebuild that jar and re-release it, instead of
| having to do full release builds of all our web services.
|
| Sean Conlon wrote:
|> I am using the deprecated class OutflowConfiguration in order to set my
|> dynamic usernames and passwords in the OutflowSecurity parameter.  Below
|> are the methods that I use to do this.
|> What is an alternative approach for me to set my username and password
|> dynamically?  What are my risks with launching this into production with
|> a deprecated class?
|> This may be more specific to Rampart then Axis2, but I am hoping that
|> someone else has had this issue too.  Others have documented this
|> problem, but I have not found a viable solution.
|> Thanks!
|> ////////////////////////////////////////////////////////
|> //////////////////////// getStub () ////////////////////
|> ////////////////////////////////////////////////////////
|>     private PartnerAPIStub getStub() throws EmailException {
|>         PartnerAPIStub myStub = null;
|>
|>         try {
|>             EndpointReference endPointReference = new
|> EndpointReference(endpoint);
|>             ConfigurationContext configurationContext =
|> ConfigurationContextFactory.createConfigurationContextFromFileSystem(
|>                 null, ABSOLUTE_AXIS2_CLIENT_CONFIG_PATH);
|>
|>             myStub = new PartnerAPIStub(configurationContext, endpoint);
|>             ServiceClient serviceClient = myStub._getServiceClient();
|>
|>             Options options = serviceClient.getOptions();
|>
|>             options.setTo(endPointReference);
|>
|>             this.updateOutflowSecurity(myStub);
|>         }
|>         catch (AxisFault e) {
|>             // TODO JL - temp code
|>             throw new EmailException(e);
|>         }
|>
|>         return myStub;
|>     }
|>
|> ////////////////////////////////////////////////////////
|> ////////////////// updateOutflowSecurity() /////////////
|> ////////////////////////////////////////////////////////
|> private void updateOutflowSecurity(PartnerAPIStub stub) {
|>
|>         ServiceClient serviceClient = stub._getServiceClient();
|>         Options options = serviceClient.getOptions();
|>
|>         OutflowConfiguration ofc = new OutflowConfiguration();
|>         ofc.setActionItems("UsernameToken");
|>         ofc.setUser(apiUsername);
|> ofc.setPasswordType("PasswordText");
|>
|>         options.setProperty(WSSHandlerConstants.OUTFLOW_SECURITY,
|> ofc.getProperty());
|>
|>      //pwcbhandler is of type PWCBHandler that is injected via
|> Spring        options.setProperty(WSHandlerConstants.PW_CALLBACK_REF,
|> pwcbhandler);
|>     }
|>
|> ---------------------------------------------------------------------
|> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
|> For additional commands, e-mail: axis-user-help@ws.apache.org
|>
|>
|>
|>
|
|
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Cygwin)

iD8DBQFIBpt9gNg6eWEDv1kRAsyoAKDfwCuYBUzXdsj7aS3UqZ5Zq4+ylwCfaf9K
7C6gjnRqIqXt/Gu80rDgoSY=
=4NRi
-----END PGP SIGNATURE-----

Re: SecurityOutflow Configuration

Posted by Davanum Srinivas <da...@gmail.com>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Anthony, Sean,

Please raise a stink on rampart-dev@ that these should not be remove in a future version and should not be marked
deprecated :)

Thanks,
dims

PS: Background, There are some people who don't listen to logic and wanted to get rid of these useful API's...

Anthony Bull wrote:
| We've got the same problem in production.  It basically isn't a risk
| unless you upgrade to a future version of Axis 2/Rampart that they have
| decided to remove those classes or the functionality they provide is
| turned off.
| To minimise the effect of this, all our production web services and web
| clients (we have 5 independent axis 2 web services running in
| production) use the same re-usable security library that abstracts the
| rampart configuration code.  So, when we change the ouflowConfiguration
| code, we only need to rebuild that jar and re-release it, instead of
| having to do full release builds of all our web services.
|
| Sean Conlon wrote:
|> I am using the deprecated class OutflowConfiguration in order to set my
|> dynamic usernames and passwords in the OutflowSecurity parameter.  Below
|> are the methods that I use to do this.
|> What is an alternative approach for me to set my username and password
|> dynamically?  What are my risks with launching this into production with
|> a deprecated class?
|> This may be more specific to Rampart then Axis2, but I am hoping that
|> someone else has had this issue too.  Others have documented this
|> problem, but I have not found a viable solution.
|> Thanks!
|> ////////////////////////////////////////////////////////
|> //////////////////////// getStub () ////////////////////
|> ////////////////////////////////////////////////////////
|>     private PartnerAPIStub getStub() throws EmailException {
|>         PartnerAPIStub myStub = null;
|>
|>         try {
|>             EndpointReference endPointReference = new
|> EndpointReference(endpoint);
|>             ConfigurationContext configurationContext =
|> ConfigurationContextFactory.createConfigurationContextFromFileSystem(
|>                 null, ABSOLUTE_AXIS2_CLIENT_CONFIG_PATH);
|>
|>             myStub = new PartnerAPIStub(configurationContext, endpoint);
|>             ServiceClient serviceClient = myStub._getServiceClient();
|>
|>             Options options = serviceClient.getOptions();
|>
|>             options.setTo(endPointReference);
|>
|>             this.updateOutflowSecurity(myStub);
|>         }
|>         catch (AxisFault e) {
|>             // TODO JL - temp code
|>             throw new EmailException(e);
|>         }
|>
|>         return myStub;
|>     }
|>
|> ////////////////////////////////////////////////////////
|> ////////////////// updateOutflowSecurity() /////////////
|> ////////////////////////////////////////////////////////
|> private void updateOutflowSecurity(PartnerAPIStub stub) {
|>
|>         ServiceClient serviceClient = stub._getServiceClient();
|>         Options options = serviceClient.getOptions();
|>
|>         OutflowConfiguration ofc = new OutflowConfiguration();
|>         ofc.setActionItems("UsernameToken");
|>         ofc.setUser(apiUsername);
|> ofc.setPasswordType("PasswordText");
|>
|>         options.setProperty(WSSHandlerConstants.OUTFLOW_SECURITY,
|> ofc.getProperty());
|>
|>      //pwcbhandler is of type PWCBHandler that is injected via
|> Spring        options.setProperty(WSHandlerConstants.PW_CALLBACK_REF,
|> pwcbhandler);
|>     }
|>
|> ---------------------------------------------------------------------
|> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
|> For additional commands, e-mail: axis-user-help@ws.apache.org
|>
|>
|>
|>
|
|
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Cygwin)

iD8DBQFIBpt9gNg6eWEDv1kRAsyoAKDfwCuYBUzXdsj7aS3UqZ5Zq4+ylwCfaf9K
7C6gjnRqIqXt/Gu80rDgoSY=
=4NRi
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: SecurityOutflow Configuration

Posted by Anthony Bull <an...@bcsoft.co.nz>.
We've got the same problem in production.  It basically isn't a risk 
unless you upgrade to a future version of Axis 2/Rampart that they have 
decided to remove those classes or the functionality they provide is 
turned off. 

To minimise the effect of this, all our production web services and web 
clients (we have 5 independent axis 2 web services running in 
production) use the same re-usable security library that abstracts the 
rampart configuration code.  So, when we change the ouflowConfiguration 
code, we only need to rebuild that jar and re-release it, instead of 
having to do full release builds of all our web services.

Sean Conlon wrote:
> I am using the deprecated class OutflowConfiguration in order to set my
> dynamic usernames and passwords in the OutflowSecurity parameter.  Below
> are the methods that I use to do this.    
>
> What is an alternative approach for me to set my username and password
> dynamically?  What are my risks with launching this into production with
> a deprecated class? 
>
> This may be more specific to Rampart then Axis2, but I am hoping that
> someone else has had this issue too.  Others have documented this
> problem, but I have not found a viable solution.  
>
> Thanks! 
>
> ////////////////////////////////////////////////////////
> //////////////////////// getStub () ////////////////////
> ////////////////////////////////////////////////////////
>     private PartnerAPIStub getStub() throws EmailException {
>         PartnerAPIStub myStub = null;
>
>         try {
>             EndpointReference endPointReference = new
> EndpointReference(endpoint);
>             ConfigurationContext configurationContext =
> ConfigurationContextFactory.createConfigurationContextFromFileSystem(
>                 null, ABSOLUTE_AXIS2_CLIENT_CONFIG_PATH);
>
>             myStub = new PartnerAPIStub(configurationContext, endpoint);
>             ServiceClient serviceClient = myStub._getServiceClient();
>
>             Options options = serviceClient.getOptions();
>
>             options.setTo(endPointReference);
>
>             this.updateOutflowSecurity(myStub);
>         }
>         catch (AxisFault e) {
>             // TODO JL - temp code
>             throw new EmailException(e);
>         }
>
>         return myStub;
>     }
>
> ////////////////////////////////////////////////////////
> ////////////////// updateOutflowSecurity() /////////////
> ////////////////////////////////////////////////////////
> private void updateOutflowSecurity(PartnerAPIStub stub) {
>
>         ServiceClient serviceClient = stub._getServiceClient();
>         Options options = serviceClient.getOptions();
>
>         OutflowConfiguration ofc = new OutflowConfiguration();
>         ofc.setActionItems("UsernameToken");
>         ofc.setUser(apiUsername); 
>         ofc.setPasswordType("PasswordText");
>
>         options.setProperty(WSSHandlerConstants.OUTFLOW_SECURITY,
> ofc.getProperty());
>
> 	 //pwcbhandler is of type PWCBHandler that is injected via
> Spring 
>        options.setProperty(WSHandlerConstants.PW_CALLBACK_REF,
> pwcbhandler);
>     }
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
> For additional commands, e-mail: axis-user-help@ws.apache.org
>
>
>
>   


-- 

Anthony
------------------------------------- 
Anthony Bull
Senior Developer
Black Coffee Software Ltd
PO Box 10-192 The Terrace
Wellington, New Zealand
 
anthony.bull@bcsoft.co.nz
Ph  +64 4 472 8818
Fax +64 4 472 8811
------------------------------------- 
www.bcsoft.co.nz
--------------------------------------------------------------- 
This email may contain confidential or privileged information, 
and is intended for use only by the addressee, or addressees. 
If you are not the intended recipient please advise the sender 
immediately and do not copy, use or disclose the contents to 
any other person or organisation.
Black Coffee Software Ltd accepts no responsibility for viruses 
received with this email, or to any changes made to the original 
content. Any views or opinions expressed in this email may be
personal to the sender and are not necessarily those of Black 
Coffee Software Ltd.
--------------------------------------------------------------- 



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


SecurityOutflow Configuration

Posted by Sean Conlon <sc...@credera.com>.
I am using the deprecated class OutflowConfiguration in order to set my
dynamic usernames and passwords in the OutflowSecurity parameter.  Below
are the methods that I use to do this.    

What is an alternative approach for me to set my username and password
dynamically?  What are my risks with launching this into production with
a deprecated class? 

This may be more specific to Rampart then Axis2, but I am hoping that
someone else has had this issue too.  Others have documented this
problem, but I have not found a viable solution.  

Thanks! 

////////////////////////////////////////////////////////
//////////////////////// getStub () ////////////////////
////////////////////////////////////////////////////////
    private PartnerAPIStub getStub() throws EmailException {
        PartnerAPIStub myStub = null;

        try {
            EndpointReference endPointReference = new
EndpointReference(endpoint);
            ConfigurationContext configurationContext =
ConfigurationContextFactory.createConfigurationContextFromFileSystem(
                null, ABSOLUTE_AXIS2_CLIENT_CONFIG_PATH);

            myStub = new PartnerAPIStub(configurationContext, endpoint);
            ServiceClient serviceClient = myStub._getServiceClient();

            Options options = serviceClient.getOptions();

            options.setTo(endPointReference);

            this.updateOutflowSecurity(myStub);
        }
        catch (AxisFault e) {
            // TODO JL - temp code
            throw new EmailException(e);
        }

        return myStub;
    }

////////////////////////////////////////////////////////
////////////////// updateOutflowSecurity() /////////////
////////////////////////////////////////////////////////
private void updateOutflowSecurity(PartnerAPIStub stub) {

        ServiceClient serviceClient = stub._getServiceClient();
        Options options = serviceClient.getOptions();

        OutflowConfiguration ofc = new OutflowConfiguration();
        ofc.setActionItems("UsernameToken");
        ofc.setUser(apiUsername); 
        ofc.setPasswordType("PasswordText");

        options.setProperty(WSSHandlerConstants.OUTFLOW_SECURITY,
ofc.getProperty());

	 //pwcbhandler is of type PWCBHandler that is injected via
Spring 
       options.setProperty(WSHandlerConstants.PW_CALLBACK_REF,
pwcbhandler);
    }

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org