axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Deepal Jayasinghe <dee...@opensource.lk>
Subject Re: Getting teh following error trying to set the transport properties dynamically
Date Wed, 24 Oct 2007 19:59:36 GMT

> Hi,
>
> I have created a Stubs using ADB binding from .NET webservice
> wsdl.When running the client to access the webservice
>
> I got the error on “*Unknown host exception*”.It looked like the
> client was unable to go through the proxy to the webservice.
>
What was the address ?
>
> The web service is outside my client’s network,hence using the proxy.
>
You can configure the proxy using options object.
>
> To resolve this problem I assumed that the stubs would be using the
> axis2.xml file ,
>
In your case Axis2 uses default axis2.xml file which in the kernel jar ,
so you wont be able to change that. If you want to do so then you need
to create a configuration context from your axis2.xml and then need to
create the stub using your configuration context.

ConfigurationContext configCtx =
ConfigurationContextFactory.createConfigurationContextFromFileSystem(null
, "location of your axis2.xml")

MyStub stub = new MyStub(configCtx );
>
> so I set the configurations in transport sender there. But still the
> problem persisted as my java client is a standalone and not in a J2EE
> app server. So I am trying to set the transport sender properties
> dynamically in code. But now I get the following error:
>
> og4j:WARN No appenders could be found for logger
> (org.apache.axis2.description.AxisService).
>
> log4j:WARN Please initialize the log4j system properly.
>
> org.apache.axis2.AxisFault: Transport out has not been set
>
> at org.apache.axis2.engine.AxisEngine.send(_AxisEngine.java:383_)
>
> at
> org.apache.axis2.description.OutInAxisOperationClient.send(_OutInAxisOperation.java:374_)
>
> at
> org.apache.axis2.description.OutInAxisOperationClient.executeImpl(_OutInAxisOperation.java:211_)
>
> at
> org.apache.axis2.client.OperationClient.execute(_OperationClient.java:163_)
>
> at
> com.choicepoint.bixg.axis2.webservice.SearchAPI1Stub.CustomSearch(_SearchAPI1Stub.java:764_)
>
> at com.choicepoint.bixg.axis2.client.Client.doInOnly(_Client.java:64_)
>
> at com.choicepoint.bixg.axis2.client.Client.main(_Client.java:20_)
>
> Following is the piece of code in stub which I am trying to set the
> properties
>
> public SearchAPI1Stub(org.apache.axis2.context.ConfigurationContext
> configurationContext,
>
> java.lang.String targetEndpoint, boolean useSeparateListener)
>
> throws org.apache.axis2.AxisFault {
>
> //To populate AxisService
>
> populateAxisService();
>
> populateFaults();
>
> _serviceClient = new
> org.apache.axis2.client.ServiceClient(configurationContext,_service);
>
> configurationContext =
> _serviceClient.getServiceContext().getConfigurationContext();
>
> _serviceClient.getOptions().setTo(new
> org.apache.axis2.addressing.EndpointReference(
>
> targetEndpoint));
>
> _serviceClient.getOptions().setUseSeparateListener(useSeparateListener);
>
> //Set the soap version
>
> _serviceClient.getOptions().setSoapVersionURI(org.apache.axiom.soap.SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI);
>
> //_serviceClient.getOptions().setSenderTransport(new
> TransportOutDescription(new QName(Constants.TRANSPORT_HTTP)));
>
> _serviceClient.getOptions().setProperty(HTTPConstants.HTTP_PROTOCOL_VERSION,HTTPConstants.HEADER_PROTOCOL_11);
>
> HttpTransportProperties.ProxyProperties proxyProperties = new
> HttpTransportProperties.ProxyProperties();
>
> proxyProperties.setProxyName("proxyname");
>
> proxyProperties.setProxyPort(proxyport);
>
> proxyProperties.setDomain("domain name");
>
> HttpTransportProperties.Authenticator
>
> auth = new HttpTransportProperties.Authenticator();
>
> auth.setUsername("username");
>
> auth.setPassword("password");
>
> // set if realm or domain is known
>
> _serviceClient.getOptions().setProperty(org.apache.axis2.transport.http.HTTPConstants.AUTHENTICATE,
> auth);
>
> _serviceClient.getOptions().setProperty(HTTPConstants.PROXY,proxyProperties);
>
> }
>



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


Mime
View raw message