Meaningless Drivel is fun!*
The moose likes Web Services and the fly likes invoking webservice using Dynamic Invcation Interface Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "invoking webservice using Dynamic Invcation Interface" Watch "invoking webservice using Dynamic Invcation Interface" New topic
Author

invoking webservice using Dynamic Invcation Interface

Niranjan Talluru Talluru
Greenhorn

Joined: Dec 18, 2006
Posts: 4
Hi,

i am trying to invoke a webservice which is developed .NET with Dynamic Invocation Interface Technique using AXIS 1.4. But i am unable to invoke. I am getting the following Exception.

Error:
System.Web.Services.Protocols.SoapException: Server did not recognize the value of HTTP Header SOAPAction: .
at System.Web.Services.Protocols.Soap11ServerProtocolHelper.RouteRequest()
at System.Web.Services.Protocols.SoapServerProtocol.Initialize()
at System.Web.Services.Protocols.ServerProtocolFactory.Create(Type type, HttpContext context, HttpRequest request, HttpResponse response, Boolean& abortProcessing)




Service wsdl url as follows.

http://www.webservicex.net/SendSMS.asmx?WSDL



and my invocation client code as follows


String endpoint = "http://www.webservicex.net/SendSMS.asmx";

Service service = new Service();
Call call = (Call) service.createCall();

call.setTargetEndpointAddress( new java.net.URL(endpoint) );
call.setOperationName(new QName("http://www.webserviceX.NET", "SendSMSToIndia"));

Object ret = (Object) call.invoke(new Object[] {"98000000", "test@rediffmail.com","Igone this Message"} );
System.out.println("Hello");
System.out.println("Request sended successfully, got reaponse as '" + ret + "'");
System.out.println("Number of elements = " + ret);

}



Any suggestion appreciated.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41096
    
  44
Welcome To JavaRanch.

The error message makes it look like the value of the SOAPAction header is "." Is that the case? If so, that looks like an error. Leave it blank or put a sensible value in there, if required.


Ping & DNS - my free Android networking tools app
Niranjan Talluru Talluru
Greenhorn

Joined: Dec 18, 2006
Posts: 4
Thanks for the replay. But i am not getting you. Can you please pass any snippet for invoking the service using Dynamic Interface invocation.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41096
    
  44
You will benefit greatly if you study the SOAP that gets transferred over the wire. The TCPMon tool that comes with Axis can help with this.

Now, in this particular problem, the server sees a SOAPAction header that it can't deal with (SOAPAction is an HTTP header, not a SOAP header). So you can use TCPMon to figure the value of SOAPAction - is it really "." as the error message suggests, or is it something else?

If instead of Service and Call you can use a SAAJ client, then you'll find a simple generic one here. It should be adaptable to your situation without too much effort.
[ December 21, 2006: Message edited by: Ulf Dittmer ]
Niranjan Talluru Talluru
Greenhorn

Joined: Dec 18, 2006
Posts: 4
Thanks for the replay. I am capable of invoking any service that are running on single port using axis API. But in above URL same operations under three port. When i am trying to invoke it is showing above exception.

And by chaging soap header(by putting null)also no change.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: invoking webservice using Dynamic Invcation Interface
 
Similar Threads
STUB, Dynamic Proxy, DII
My first webservice call
consume web service
Problem in cross paltform webservice
Currency Web Service almost there