Re: Problem in Call.invokeBlocking when request has parameters[Axis2]

2005-10-13 Thread Anne Thomas Manes
Axis 2 doesn't support RPC/encoded yet. Switch to document/literal.On 10/12/05, Uday Kamath <[EMAIL PROTECTED]
> wrote:




1. My wsdl (just 
part where it doesn't work) looks like 



   
  message
>



   
  message
>



   


   

  operation
>



   


- 


   
  input
>


- 


   
  output
>
  operation
>
 
2. 
My Client Code looks like 
//get the soap 
factory    SOAPFactory factory = 
OMAbstractFactory.getSOAP11Factory();    SOAPEnvelope 
envelope = factory.getDefaultEnvelope();
    envelope.declareNamespace("http://www.w3.org/2001/XMLSchema-instance
", 
"xsi");    envelope.declareNamespace("http://www.w3.org/2001/XMLSchema","xsd
");EndpointReference 
targetEPR = new 
EndpointReference(AddressingConstants.WSA_TO,    
"http://localhost:8001/webservice/PurchaseOrderService");
   OMNamespace 
poNameSpace = factory.createOMNamespace("http://www.bea.com/examples/PurchaseOrder", 
"m");OMNamespace defNs 
=factory.createOMNamespace("", "");    OMElement operation = 
factory.createOMElement("getPurchaseOrderById", 
poNameSpace);    operation.addChild(getOMElement(factory, 
defNs, "string", "xsd:string", "1234"));    
envelope.getBody().addChild(operation);    Call call = new 
Call();    call.setTo(targetEPR);    
call.setTransportInfo(Constants.TRANSPORT_HTTP, Constants.TRANSPORT_HTTP, 
false);    //Blocking 
invocation OMElement result = (OMElement) 
call.invokeBlocking("getPurchaseOrderById", 
operation);
 
private static 
OMElement getOMElement(OMFactory factory, OMNamespace ns, String 
elementName,   
String type, String text) {  OMElement part = 
factory.createOMElement(elementName, 
null);  part.addAttribute("xsi:type", type, 
null);  part.addChild(factory.createText(text));  return 
part;    }
 
3. This throws 
AxisFault with no Message, If i use this for soap operation where there is no 
parameters passed like getAllPurchaseOrders the same client code works fine. 

4. Also instead 
of using Call to do transport, if i open HttpConnection and get the envelope , 
read it through writer and pass it as byte stream it works fine for both 
getAllPurchaseOrders and getPurchaseOrdersById.Does Call need to do something 
more? If it works for getAllPurchaseOrders and not for getPurchaseOrderById i 
assumed i am not setting namespace etc right, but if this works using my 
HttpConnection i am lost...
 
Can anyone point 
if i am doing anything wrong?
 
-Uday
 
 




Problem in Call.invokeBlocking when request has parameters[Axis2]

2005-10-12 Thread Uday Kamath



1. My wsdl (just 
part where it doesn't work) looks like 



   
  message>



   
  message>



   


   

  operation>



   

- 


   
  input>

- 


   
  output>
  operation>
 
2. 
My Client Code looks like 
//get the soap 
factory    SOAPFactory factory = 
OMAbstractFactory.getSOAP11Factory();    SOAPEnvelope 
envelope = factory.getDefaultEnvelope();
    envelope.declareNamespace("http://www.w3.org/2001/XMLSchema-instance", 
"xsi");    envelope.declareNamespace("http://www.w3.org/2001/XMLSchema","xsd");EndpointReference 
targetEPR = new 
EndpointReference(AddressingConstants.WSA_TO,    
"http://localhost:8001/webservice/PurchaseOrderService");   OMNamespace 
poNameSpace = factory.createOMNamespace("http://www.bea.com/examples/PurchaseOrder", 
"m");OMNamespace defNs 
=factory.createOMNamespace("", "");    OMElement operation = 
factory.createOMElement("getPurchaseOrderById", 
poNameSpace);    operation.addChild(getOMElement(factory, 
defNs, "string", "xsd:string", "1234"));    
envelope.getBody().addChild(operation);    Call call = new 
Call();    call.setTo(targetEPR);    
call.setTransportInfo(Constants.TRANSPORT_HTTP, Constants.TRANSPORT_HTTP, 
false);    //Blocking 
invocation OMElement result = (OMElement) 
call.invokeBlocking("getPurchaseOrderById", 
operation);
 
private static 
OMElement getOMElement(OMFactory factory, OMNamespace ns, String 
elementName,   
String type, String text) {  OMElement part = 
factory.createOMElement(elementName, 
null);  part.addAttribute("xsi:type", type, 
null);  part.addChild(factory.createText(text));  return 
part;    }
 
3. This throws 
AxisFault with no Message, If i use this for soap operation where there is no 
parameters passed like getAllPurchaseOrders the same client code works fine. 

4. Also instead 
of using Call to do transport, if i open HttpConnection and get the envelope , 
read it through writer and pass it as byte stream it works fine for both 
getAllPurchaseOrders and getPurchaseOrdersById.Does Call need to do something 
more? If it works for getAllPurchaseOrders and not for getPurchaseOrderById i 
assumed i am not setting namespace etc right, but if this works using my 
HttpConnection i am lost...
 
Can anyone point 
if i am doing anything wrong?
 
-Uday