axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From KaySquare <>
Subject howto: construct a sopa-request fully manually!!
Date Tue, 17 Apr 2007 18:08:01 GMT

i'm looking for a solution to build a soap-request completely by hand...
Reason for this is that wsdl2java constructs an invalid stub from the
(existing) wsdl-file from a legacy-system (I used Eclipse/Lomboz and the
code which was generated ignores parameters of any response-message... I
dont know why).

I managed most of the task using this code:

<snip: java code, using apache axis1>

String endpoint =

Service  webservice 	 = new Service();
Call     webserviceCall  = (Call) webservice.createCall();

webserviceCall.setTargetEndpointAddress( new );

webserviceCall.setOperationName(new QName(null, "IPS_SubServiceCall"));
webserviceCall.setEncodingStyle( ""

webserviceCall.addParameter("SID", org.apache.axis.Constants.XSD_STRING,
webserviceCall.addParameter("SERVICE", org.apache.axis.Constants.XSD_STRING,
org.apache.axis.Constants.XSD_STRING, javax.xml.rpc.ParameterMode.IN);
org.apache.axis.Constants.XSD_STRING, javax.xml.rpc.ParameterMode.IN);


Object o = (Object) webserviceCall.invoke( new Object[] {sessionID, service,
subservice, "requestmap"} );
MessageContext mc = webserviceCall.getMessageContext();
String response = mc.getResponseMessage().getSOAPPartAsString();
StringReader strReader = new StringReader(response); 
InputSource inputsrc = new InputSource(strReader); 
Document document = XMLUtils.newDocument(inputsrc);
/* nothing to scan for (here)
XPath xpath = XPathFactory.newInstance().newXPath();
String expressionForERRORCODE = "//ERRORCODE";
String ips_errorcode = xpath.evaluate(expressionForERRORCODE, document);

I need to construct the part of the requestmap by hand, as I don't know, how
to consturct an rpc-encoded array of a user-defined type...
It should look like this:

<snip: SOAP>
<CALLER s:type="y:string">USER</CALLER> 
<SID s:type="y:string">TEST:1264335072</SID> 
<SERVICE s:type="y:string">METASEARCH</SERVICE> 
<REQUESTMAP s:type="ns1:Map" xmlns:ns1=""> 
 <key s:type="y:string">TEMPLATE</key>
 <value s:type="y:string">FALSE</value>
<!-- probably even more items -->
 <key s:type="y:string">COUNT</key>
 <value s:type="y:string">20</value>
<key s:type="y:string">START</key>
<value s:type="y:string">0</value>

The complete wsdl-file could be downloaded from here: 

THANK YOU for your help - I'm really stuck here...

View this message in context:
Sent from the Axis - User mailing list archive at

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message