You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by mm jj <me...@yahoo.com> on 2006/02/02 15:23:33 UTC

RE: java client to invoke webservices?

yes i did add the SOAPAction but noting change. any other suggestion or solutions.
   
  i really appreciate.

Dinesh Shahane <ds...@tibco.com> wrote:
  Looking at your WSDL, I think you need the following SOAPAction 




call.setSOAPActionURI("/Processes/SOAPServer ");

________________________________________
From: mm jj [mailto:metibco@yahoo.com] 
Sent: Wednesday, February 01, 2006 1:33 PM
To: axis-user@ws.apache.org
Subject: Re: could someone help me in java client to invoke webservices?

i did add the following line but nothing change. 
if you see the error, what is this "faultString: No handler for body element" and some other errors.


Dong Liu wrote:
Please try after adding this line into your client

call.setSOAPActionURI("Operation");

Cheers,

Don

On 2/1/06, mm jj < metibco@yahoo.com> wrote: 
thanks for reply. could you please look into the following code, error and WSDL. 
 
here is the code, error, and wsdl(this wsdl is created in TIBCO). I used AXIS 1.3 to write and c ompile java code.
 
import org.apache.axis.client.*;
import javax.xml.rpc.ParameterMode ;
import org.apache.axis.encoding.XMLType;
import org.apache.axis.utils.Options;
 
public class FibClient {
  public static void main(String[] args) throws Exception {
    String endpoint = " http://DUSU41009X1:80/Processes/SOAPServer";
    //String endpoint = " http://DUSU41009X1:8080/Processes_sp_Definition";
    String Sub = "SUBJECT";
    String Data = "DATA";
    Service service = n ew Service();
    Call call = (Call) service.createCall();
    call.setTargetEndpointAddress(endpoint);
    call.setOperationName("Operation");
    call.setProperty(Call.OPERATION_STYLE_PROPERTY, "wrapped"); 
    call.addParameter("op1", XMLType.XSD_STRING, ParameterMode.IN);
    call.addParameter("op2", XMLType.XSD_STRING, ParameterMode.IN);
    call.setReturnType(XMLType.XSD_STRING);
    call.setReturnType (XMLType.XSD_STRING);
    String ret = (String) call.invoke(new Object[]{Sub, Data});
    System.out.println("Got result : " + ret);
    
    
    
  }
}
--------------------------
 
init:
deps-jar:
compile-single:
run-single:
- Unable to find required classes (javax.activation.DataHandler an d javax.mail.internet.MimeMultipart). Attachment support is disabled.
AxisFault
 faultCode: { http://schemas.xmlsoap.org/soap/envelope/}Client
 faultSubcode: 
 faultString: No handler for body element
 faultActor: 
 faultNode: 
 faultDetail: 
        {}detail: http://DUSU41009X1:80/Processes/SOAPServer""Operation
No handler for body element
        at org.apache.axis.message.SOAPFaultBuilder.createFault (SOAPFaultBuilder.java:222)
        at org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:129)
        at org.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1087)
        at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1712)
        at org.apache.crimson.parser.Parser2.content (Parser2.java:1963)
        at org.apache.crimson.parser.Parser2.maybeElement(Parser2.java:1691)
        at org.apache.crimson.parser.Parser2.content(Parser2.java:1963)
        at org.apache.crimson.parser.Parser2.maybeElement (Parser2.java:1691)
        at org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:667)
        at org.apache.crimson.parser.Parser2.parse(Parser2.java:337)
        at org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:448)
        at javax.xml.parsers.SAXParser.parse(SAXParser.java:345)
        at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java :227)
        at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
        at org.apache.axis.Message.getSOAPEnvelope(Message.java:435)
        at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke (MustUnderstandChecker.java:62)
        at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
        at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
        at org.apache.axis.client.Call.invoke(Call.java:2767)
        at org.apache.axis.client.Call.invoke(Call.java:2443)
        at org.apache.axis.client.Call.invoke(Call.java:2366)
        at org.apache.axis.client.Call.invoke (Call.java:1812)
        at FibClient.main(FibClient.java:24)
Exception in thread "main" 
Java Result: 1
BUILD SUCCESSFUL (total time: 1 second)
 
---------------------------------------------- 
 



    
        
            
                
                    Generic web service request
                
                
                    
                        
                        
                            
                                insert the reply XML here
                            
                        
                    
                
            
            
                
                    Generic web service request 
                
                
                    
                        
                        
                            
                                insert the request XML here
                            
                        
                    
                
            
        
    
    
        
    
    
        
    
    
        
            
            
        
    
    
        
        
            The operation has no documentation
            
            
                
            
            
                
            
        
    
    
        
            
        
    



Glenn Bech < glenn.bech@webstep.no> wrote:
Public class Test {
  
   Public static void main(String[] args) {
 
String wsdlURI = "http://localhost:8888/axis/myService.wsdl";
String nsURI = " http://schemnamespace/2004/01/22/";
String endPointURI = " http://localhost:8888/axis/services/Provisioning/";
String serviceName = "MyServiceName";
String portNameProv = "MyPortName";
 
ServiceFactory serviceFactory = ServiceFactory.newInstance(); 
Service provisioningService = serviceFactory.createService(new URL(wsdlURI), new QName(nsURI, serviceName)); 
SessionControlStub sessionControlStu b = new SessionControlStub(new URL(endPointURI), provisioningService);
Object returnValue = sessionControlStub.login(argument);
   }
}
 
 
 
________________________________________
From: mm jj [mailto:metibco@yahoo.com ] 
Sent: 1. februar 2006 18:33
To: axis-user@ws.apache.org
Subject: could someone help me in java client to invoke webservices?
 
could someone help me in java client to invoke webservices?
________________________________________
Do you Yahoo!? 
With a free 1 GB, there's more in store with Yahoo! Mail.

__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


________________________________________
Yahoo! Autos. Looking for a sweet ride? Get pricing, reviews, & more on new and used cars.
  


			
---------------------------------
 Yahoo! Autos. Looking for a sweet ride? Get pricing, reviews, & more on new and used cars.