473,698 Members | 2,643 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

C# Consuming webservice

26 New Member
i'm consuming a Webservice (created in java) in .Net 2003 (in C#)... whenever i invoke the webmethod, i'm getting below error message

"Additional information: Client found response content type of 'text/html;
charset=ISO-8859-1', but expected 'text/xml'."

but when the same webservice is called from SOAPUI (an open source
application from www.soapui.org) or XMLSpy - it just works fine...

so i'm confused about this, any suggestions??

Cheers
Venu
Jan 30 '08 #1
3 3268
Plater
7,872 Recognized Expert Expert
Hmm that java webservices seems a little funny.
the text/html with charset spec I believe fits the standard, that the java rejects it seems incorrect.
Not sure if you can remove/edit the line in your code, but it might be possible to change the contenttype.
How do you call this method?
Jan 30 '08 #2
bharadwajrv
26 New Member
Hmm that java webservices seems a little funny.
the text/html with charset spec I believe fits the standard, that the java rejects it seems incorrect.
Not sure if you can remove/edit the line in your code, but it might be possible to change the contenttype.
How do you call this method?
In .Net application i have created the Webreference and created the 'Request' and 'Response' object.... below the the code (i have changed Namespace, Request object name to make it easy to understand)

Expand|Select|Wrap|Line Numbers
  1. WebSrvc.MyWebservice_Service objWS = new WebSrvc.MyWebservice_Service();
  2.  
  3. WebSrvc.SubmitRequest objRequestData = new WebSrvc.SubmitRequest();
  4. WebSrvc.submitResponse objResponse = new WebSrvc.submitResponse ();
  5.  
  6. string sRequestXML;
  7.  
  8. //Load the original XML
  9. StreamReader sr = new StreamReader(txtXMLFile.Text.ToString());
  10. sRequestXML = sr.ReadToEnd() ;
  11. sr.Close();
  12.  
  13.  
  14. //remove any 'return' and 'newline' characters
  15. sRequestXML = sRequestXML.Replace ("\r", "");
  16. sRequestXML = sRequestXML.Replace ("\n", "");
  17.  
  18. //Create the request object and fill in the XML data as string
  19. objRequestData.strRequestData = sRequestXML;
  20.  
  21.  
  22. //invoke the webmethod
  23. objResponse = objWS.Function1(objRequestData);
  24.  

Let me know if i'm doing anything wrong...
(project compiles well, but it is a runtime error )

Cheers
Venu
Jan 31 '08 #3
Plater
7,872 Recognized Expert Expert
Part of the HTTP protocol includes using a standard set of headers. In this case the "Content-Type", somewhere, someone is using microsoft's usage which would be the "Content-Type: text/html; charset..." which I believe fits the standards but I guess it wants JUST "Content-Type: text/html"
So, somewhere there has to be the call that goes out over the internet and somewhere it automatically inserts that line. If you can find where that happens (or where it validates that header line) you might be able to edit it.
Jan 31 '08 #4

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

Similar topics

0
1231
by: kamig | last post by:
Hi! Scenario: Consuming my webService in a windows application give denied acces! Explanation: I have to say a moveTo fn. which move one file/dir from one drive to another, <authorization>
0
1567
by: plmanikandan | last post by:
I need to develop a application to consume a webservice. For consuming web service i tried a example in Consuming a Web Service in C# in http://www.csharphelp.com.But i am uanble to use that webservices in http://upload.eraserver.net/circle24/worldtime/worldtime.asmx?WSDL.Can anybody give me simple example(website link) for consuming webservice(other than local host). Mani
5
17120
by: Preben Zacho | last post by:
Anyone that has a link or description that simply as possible shows how to add a web reference to a class library in C# and consuming it? TIA PZ
0
1235
jeffbroodwar
by: jeffbroodwar | last post by:
hi, i need help about consuming webservice created in java with vb6. i've created the webservice in netbeans with sun java server bundle and used MS Soap toolkit 3.0 on the client side. i've attached the sample client source code in vb6 : __________________________________________________________________ '********************* Created procedure ***************************** Private Sub Connect() strClient =...
2
2787
jeffbroodwar
by: jeffbroodwar | last post by:
hi, i need help about consuming webservice created in java with vb6. i've created the webservice in netbeans with sun java server bundle and used MS Soap toolkit 3.0 on the client side. i've attached the sample client source code in vb6 : __________________________________________________ ________________ '********************* Created procedure ***************************** Private Sub Connect() strClient =...
0
1224
jeffbroodwar
by: jeffbroodwar | last post by:
hi, i need help about consuming webservice created in java with vb6. i've created the webservice in netbeans with sun java server bundle and used MS Soap toolkit 3.0 on the client side. i've attached the sample client source code in vb6 : __________________________________________________ ________________ '********************* Created procedure ***************************** Private Sub Connect() strClient =...
5
5550
jeffbroodwar
by: jeffbroodwar | last post by:
hi, i need help about consuming webservice created in java with vb6. i've created the webservice in netbeans with sun java server bundle and used MS Soap toolkit 3.0 on the client side. i've attached the sample client source code in vb6 : __________________________________________________ ________________ '********************* Created procedure ***************************** Private Sub Connect() strClient =...
4
5994
by: Boni | last post by:
I want consuming a webserivce trough a proxy. I use this code. myService s = new myService (); System.Net.WebProxy proxyObject = new System.Net.WebProxy("http://proxyhost:8080"); s.Proxy = proxyObject; It doesn't works, it returns a error HTTP 407: Proxy Authentication Required ( Access is denied. ). But my proxy don't need a user Authentication.
1
9095
by: Thomas Mueller | last post by:
Hi, I'm currently working on C# code consuming a PHP-webservice (soapserver-class of PHP5). A PHP test-client worked fine and achieved the requested data from the service's server. Using the wsdl-file of the webservice, wsdl.exe generated a C#-proxy class errorlessly. I then tried to instantiate the proxy class to access the service: waClient.waService was = new waClient.waService();
2
4798
by: arnomarga | last post by:
I am trying to consuming a .NET web service from a standard (classic) ASP, but having not so much luck as I dont have much experience about SOAP. Here is the webservice url: http://test.webservices.superbreak.com/SoapEndpoint.asmx I have been advised that i need to use this through MSSOAP Toolkit or through soap envelope. Could someone advise about some coding pattern to access this service?
0
8683
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8611
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9170
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8904
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8876
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7741
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5867
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
3052
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2007
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.