I solved by creating the client call this way:

private Call createCall( java.lang.String action ) throws Exception {
                Call     call    = (Call)_service.createCall();
                call.setTargetEndpointAddress( new URL( _endpoint ) );

                org.apache.axis.description.OperationDesc oper = new
org.apache.axis.description.OperationDesc();
                oper.setName( action );
                oper.addParameter(new
javax.xml.namespace.QName("http://soapgateway.service.wombat";, action ), new
javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema";, "anyType"),
java.lang.Object.class, org.apache.axis.description.ParameterDesc.IN, false,
false);
                oper.setReturnType(new
javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema";, "anyType"));
                oper.setReturnClass(java.lang.Object.class);
                oper.setStyle(org.apache.axis.enum.Style.MESSAGE);
                oper.setUse(org.apache.axis.enum.Use.LITERAL);

        
call.setOperationStyle(org.apache.axis.enum.Style.DOCUMENT_STR);
                call.setOperationUse( org.apache.axis.enum.Use.LITERAL_STR
);
                call.setOperation( oper );
                call.setUseSOAPAction(true);
                call.setSOAPActionURI("");
                call.setEncodingStyle(null);
                call.setProperty(org.apache.axis.client.Call.SEND_TYPE_ATTR,
Boolean.FALSE);
        
call.setProperty(org.apache.axis.AxisEngine.PROP_DOMULTIREFS,
Boolean.FALSE);
        
call.setSOAPVersion(org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS);
                call.setOperationName(new
javax.xml.namespace.QName("http://soapgateway.service.wombat";, action));
                
                return call;    
        } 

Thanks,
Matias

-----Original Message-----
From: Matias Woloski [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, August 11, 2004 5:23 PM
To: [EMAIL PROTECTED]
Subject: invoke returns null and the response is valid

I have a message style webservice on Axis 1.1. I make this request using the
Axis api:

org.w3c.dom.Element elem = Convert.toDomElement( SUBMIT_QUERY_XML_MESSAGE );
org.w3c.dom.Element[] input = new org.w3c.dom.Element[] { elem }; Object
response = call.invoke( input );
Assert.assertNotNull( response );       

Using TCPmon I see the request soap envelope

 <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/";
xmlns:xsd="http://www.w3.org/2001/XMLSchema";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";> 
      <soapenv:Body>  
         <submitQuery
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/";>   
            <arg0 xsi:type="ns1:Element"
xmlns:ns1="http://xml.apache.org/xml-soap";>    
               <message>     
                  <usernameToken>            
                     <user>garrahan</user>           
                     <password>1234</password>    
                  </usernameToken>    
                  <query>           
                     <SubmitQueryRequest
iD="E8E0D31E-49C4-A948-8615-9A076AF6415C" timeOut="100">                    
                        <request>                           
                           <dni>20</dni>                
                        </request>      
                     </SubmitQueryRequest>   
                  </query>  
               </message> 
            </arg0>
         </submitQuery>
      </soapenv:Body>
   </soapenv:Envelope>

And the response as follows:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/";
xmlns:xsd="http://www.w3.org/2001/XMLSchema";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";> 
      <soapenv:Body>
         <SubmitQueryResponse iD="E8E0D31E-49C4-A948-8615-9A076AF6415C"
start="2004-08-11 17:01:33.171" taskCount="2"/> 
      </soapenv:Body>
   </soapenv:Envelope>

However, the response is always null.

Any ideas?

Thanks,
Matias

Reply via email to