473,395 Members | 2,079 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,395 software developers and data experts.

Returning SoapFault as Envelope

Hi All,

I have two web services, where first application receives a request and
sends the request to the second web service. Based on the response
received from second application, the first application, responds to
the client.

It works fine for the normal cases. But when i wanted to check the
error messages, it the client application receives Error 404. But when
the same error is returned from the second application using "return "
statement, the client receives it as "The remote server returned an
error: (500) Internal Server Error."

Both the first app and client use similar codes, but why the second
application receives it with Error code 500?

Here is the code,

try
{

string strg = envelope.InnerXml;

req.Method = "POST";

req.KeepAlive = true;
req.ContentType = "text/xml";
byte[] bytes =
System.Text.Encoding.UTF8.GetBytes(strg);
req.ContentLength = bytes.Length;
req.Headers.Add("SOAPAction: mySoapAction");

System.IO.Stream st = req.GetRequestStream();
st.Write(bytes, 0, bytes.Length);
st.Close();

HttpWebResponse res =
(HttpWebResponse)req.GetResponse();

System.IO.Stream st1 = res.GetResponseStream();
System.IO.StreamReader sr = new
System.IO.StreamReader(st1, System.Text.Encoding.UTF8);
string txt = sr.ReadToEnd();
SoapEnvelope response = new SoapEnvelope();
response.LoadXml(txt);
//this.txtSOAPResponse.Text = txt;
res.Close();
Console.WriteLine(response.Envelope.OuterXml);
return true;
}
catch (WebException exp)
{
Console.WriteLine(exp.Message);
Console.WriteLine(exp.StackTrace);
return false;
}
catch (Exception exp)
{
Console.WriteLine(exp.Message);
Console.WriteLine(exp.StackTrace);
return false;
}
Any help?

Aug 9 '06 #1
0 878

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Stephen Chell | last post by:
I'm using SAAJ 1.2 (from jwsdp-1.3) and JDK 1.4.2_03. I've written a client application that uses the SAAJ api to send a SOAP message to a servlet. The servlet successfully receives the message...
0
by: Markus Stehle | last post by:
Hi all! I need to create an soap envelope that will be sent to an external service using HTTP POST. I created the required classes which are serialized using XmlSerializer. The envelope should...
3
by: Moshe Kravchik | last post by:
Hi! We have a Web Service written in ATL Server and a client written in Java using Axis. When something goes wrong on the server side, it returns an HRESULT of the error which is translated into...
1
by: Ben Crinion | last post by:
I dont think my generated classes are creating a correctly formatted soap envelope I have entered the WSDL into the WebServices Studio app (app is from here...
0
by: Patrick Brunmayr | last post by:
Hello I have a big Problem with validating a Soap Envelope. I have downloaded the xsd for a soap envelope from http://schemas.xmlsoap.org/soap/envelope/ The validation succeeds as lonng as i...
0
by: broersen | last post by:
Hello, Does someone know how to create manually the header for an SOAP message, without having an WSDL? I also use an X509 certificate for connecting to the webservice. Can anyone help me to get...
0
by: robert112 | last post by:
Hi All, I have a .net WSE 3.0 Web Service acting as a client calling a j2EE web Service. The service works when I call it using a client program called soapUI (which is free to download) but when...
0
by: Algobardo | last post by:
Good morning, this is the first time i write on this forum because i googled and i've seen related post with no solution. I will expose briefly the problem. I'm using c# 3.5 and i'm trying using...
1
by: moorcroft | last post by:
I'm sending the following SOAP request to a webservice (I've had to star out some parts of it for privacy purposes): <?xml version="1.0" encoding="UTF-8"?> <soap-env:Envelope...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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,...
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...

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.