axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <Martin.Be...@materna.de>
Subject Axis2 wsdl2java client: How to add processing instructions
Date Thu, 23 Oct 2008 11:16:54 GMT
Hi,


I am trying to implement a client with axis2 1.4.1 (REST) for a "legacy
webservice". This webservice is defined as just sending XML per HTTP
POST (x-www-form-urlencoded) and getting the answer message as a
supplement of the http response. 
I generated a WSDL file according to the specification provided by the
webservice provider and created a client with wsdl2java (ADB). This is
working pretty fine, but i have two problems, i couldn't solve so far:

a) My requests are answered with an error message hinting towards two
missing processing instructions, at the beginnning of the request like

<?xml version="1.0" encoding="ISO-8859-1"?>
<?provider version="1.0"?>

I found a mailthread(Need for Child API in OMDocument:
http://markmail.org/search/?q=axis2+%22Need+for+Child+API+in+OMDocument+
%22 ) that suggests a possibility, to add such instructions before the
transport, but i did not find a way to use this. Can anybody give me a
hint, how to do this or where to look further? Or is it possible to
declare such processing instructions already inside the WSDL?

b) the received http response of the webservice (containing the error
message in the XML supplement) is not recognized by axis2, though it
looks quite correct. The error message is 
org.apache.axis2.AxisFault: org.apache.axis2.databinding.ADBException:
Unexpected subelement EngineAnswer
I have not finally analyzed the exact reason by debugging through the
code, but I am affraid i will have to manipulate the http response in a
similar manner like the request, before it is handed over to the axis2
parsing. So, if anybody has a way to achieve this at his fingertips, his
help is appreciated very much!

I'm pretty new to axis ( and java as well ) so please forgive me, if
this is a BRTFM.


Thanks in advance for any hint and best regards
Martin Berns


P.S.: My actual configuration is:

  AxisConfiguration axisConfig = new AxisConfiguration();
  ConfigurationContext myConfigContext;
  try {
  	myConfigContext =
ConfigurationContextFactory.createConfigurationContextFromFileSystem(nul
l , null);
  } catch (AxisFault e1) {
  	// TODO Auto-generated catch block
  	e1.printStackTrace();
 	return;
  }	
  myConfigContext.setProperty(Constants.Configuration.ENABLE_REST,
Constants.VALUE_TRUE);
  myConfigContext.setProperty(Constants.Configuration.HTTP_METHOD ,
org.apache.axis2.Constants.Configuration.HTTP_METHOD_POST);
 
myConfigContext.setProperty(Constants.Configuration.DISABLE_SOAP_ACTION,
Constants.VALUE_TRUE);
  myConfigContext.setProperty(Constants.Configuration.CONTENT_TYPE ,
HTTPConstants.MEDIA_TYPE_X_WWW_FORM);
 
myConfigContext.setProperty(org.apache.axis2.transport.http.HTTPConstant
s.CHUNKED, Boolean.FALSE);
 
org.apache.axis2.transport.http.HttpTransportProperties.ProxyProperties
proxy = new
org.apache.axis2.transport.http.HttpTransportProperties.ProxyProperties(
);
  proxy.setProxyName(proxyName);
  proxy.setProxyPort(8080);
  myConfigContext.setProperty(HTTPConstants.PROXY , proxy);
  myConfigContext.setProperty(HTTPConstants.PROTOCOL_VERSION ,
HTTPConstants.HEADER_PROTOCOL_10);
  try {
	myServiceStub myStub = new myServiceStub(myConfigContext,
myUrl);
  ...

---------------------------------------------------------------------
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