473,397 Members | 1,950 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

Server did not recognize the value of HTTP Header SOAPAction

hello friends,
I wrote a WebService client as below

Expand|Select|Wrap|Line Numbers
  1.  
  2. import org.apache.axis.client.Call; 
  3. import org.apache.axis.client.Service; 
  4.  
  5. import javax.xml.namespace.QName; 
  6.  
  7. public class AtmuClient 
  8.         public static void main(String [] args) { 
  9.                try { 
  10.                         String req="request"; 
  11.                    String endpoint ="http://deleted/mims/service.asmx?WSDL"; 
  12.                    String nameSpaceUri = "http://www.deleted.com/MIMS"; 
  13.  
  14.                    Service  service = new Service(); 
  15.                    Call     call    = (Call) service.createCall(); 
  16.  
  17.                    call.setTargetEndpointAddress( new java.net.URL(endpoint) ); 
  18.                    call.setOperationName(new QName(nameSpaceUri, "echoString") ); 
  19.  
  20.                    String ret = (String) call.invoke( new Object[] { req } ); 
  21.                    System.out.println("Sent 'Hello!', got '" + ret + "'"); 
  22.  
  23.                } catch (Exception e) { 
  24.                    System.err.println(e.toString()); 
  25.                } 
  26.            } 
  27.  
  28.  
  29.  

the out put I am getting is


Server did not recognize the value of HTTP Header SOAPAction: .




what still I need to incorporate to my code. Do i need to add any methods still ? and one more thing is do i need to write WSDD for this? how ?. can any bady guide me

thanQ for any greatful guidance.
Ajay.
Jan 14 '08 #1
1 11661
ezanih
1
Hi Ajay

There appears to be a bug in Axis. Just add this 2 lines of code before you initialize call. Check out my code below. If you manage to fix yours, can you please test out my code and why it cannot access the Stock Quote web service (code below). I'm getting an exception. Thanks!

Expand|Select|Wrap|Line Numbers
  1.  
  2. package mypackage;
  3.  
  4.  
  5. import org.apache.axis.client.Call;
  6. import org.apache.axis.client.Service;
  7. import javax.xml.namespace.QName;
  8.  
  9.  
  10. public class SOAPTest
  11. {
  12.  
  13.     public static void main(String [] args) throws Exception {
  14.  
  15.         try {
  16.  
  17.                 String endpoint =  "http://www.webserviceX.NET/stockquote.asmx";
  18.                 //String endpoint =  "http://www.webserviceX.NET/stockquote.asmx?method=GetQuote";
  19.                 //String endpoint =  "http://www.webserviceX.NET";
  20.  
  21.  
  22.                Service  service = new Service();
  23.  
  24.  
  25.                Call call= (Call) service.createCall();
  26.  
  27.  
  28.                call.setProperty( Call.SOAPACTION_USE_PROPERTY, new Boolean( true ) );
  29.                call.setProperty( Call.SOAPACTION_URI_PROPERTY, "http://www.webserviceX.NET/GetQuote");
  30.  
  31.  
  32.                call.setTargetEndpointAddress( new java.net.URL(endpoint) );
  33.                call.setOperationName(new QName("http://www.webserviceX.NET/GetQuote", "GetQuote") );
  34.  
  35.  
  36.                String ret = (String) call.invoke( new Object[] { "MSFT" } );
  37.                System.out.println("Sent 'MSFT', got '" + ret + "'");
  38.  
  39.  
  40.         } catch (Exception e) {
  41.  
  42.  
  43.                System.err.println(e.toString());
  44.                //e.printStackTrace();
  45.        }
  46.    }
  47. }
  48.  
  49.  
  50.  
Feb 13 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Mark | last post by:
i have a very simple web servive Imports System.Web.Services <System.Web.Services.WebService(Namespace:="urn:Example1")> _ Public Class Example1 Inherits System.Web.Services.WebService
1
by: Kevin Yu | last post by:
hi All I have a reference to a web servrice in the data access layer. something strange happen with this web service, when calling to one of the web method, it works fine, but not the other web...
5
by: Grigs | last post by:
Hello, I have a project that contains a WebService that works great when connecting to it on my Localhost. Once we post the files to the test web server, all of the pages that do not touch the...
4
by: J | last post by:
I changed the server after creating a web service (VB.NET), and the WSDL and SOAP headers for the new site's web test page still are showing the old server's name. What code or are configuration...
5
by: Nate | last post by:
We are attempting to make a request to a web service (we will refer to it as XXXServices) hosted on a Web Logic server from a C# SOAP client. The server responds with a 401 Unauthorized error...
4
by: kuladeep.mohan | last post by:
Hi I am trying to consume a web service from asp.net web page through HTTP POST method and I am getting the following error message "System.Net.WebException: The remote server returned an error:...
5
by: ayaz.usman | last post by:
Hi, I've built a web services proxy server, in C# using wsdl.exe, by importing wsdl. Howeever, when I go to : http://localhost/sample.asmx?wsdl, they wsdl there does not match the wsdl I fed...
2
by: =?Utf-8?B?TWlndWVsIElzaWRvcm8=?= | last post by:
Hi, I've built an ASP.NET 1.1 web service and an ASP.NET 1.1 application that calls it is throwing the following exception: System.Web.Services.Protocols.SoapException: Server did not...
4
by: gcharbon | last post by:
Hi community, I have a problem with a Soap client written in php. I have a local server (coded in c and a client in c too, it works fine), but i want to test client in php, and i have an error...
1
by: moorcroft | last post by:
OK I have java code which creates the following XML SOAP message: <?xml version="1.0" encoding="UTF-8"?> <soap-env:Envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/">...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.