.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Soap exception problem

Posted By:      Posted Date: September 13, 2010    Points: 0   Category :SharePoint
Hello, I'm having a problem with the web service soap exception that im facing. In my if else statement, the web service keeps on throwing soap exception when name was not found. SoapException was caught A user with the account name test.name could not be found --> User Not Found: Could not load profile data from the database. My question is.. Is it possible to handle that in if else statement? Basically the web service returns profile data (ex. name, age, address, in xml format) What i want is if just like this.. If _result isnot nothing then _str = _result else 'do nothing end if Is that possible?    Ã‚®Â©T½¼

View Complete Post

More Related Resource Links

REST and SOAP headers problem

Hi!   I'm trying to expose a service and, particularly, an operation that has an input that has been "tagged" as [MessageHeader]. When I try to run the service, I'm given an InvalidOperationException.    The full message is: Operation 'X' in contract 'Y' uses a MessageContract that has SOAP headers. SOAP headers are not supported by the None MessageVersion.   Unfortunately that MessageContract has to use headers so I haven't got the possibility to "dispose" the headers altogether. Does anyone know how I can correctly expose my service to both a SOAP and Web client (btw, I've already tried the "How to: Expose a Contract to SOAP and Web Clients" in the MSDN documentation) under these circumstances?   Thanks in advance!

OutOfMemory Exception on 64 bit machines (Interop Problem)

Hello Our application needs to display the printer settings dialog. This works fine in 32bit windows systems, but results in a System.OutOfMemoryException at System.Runtime.InteropServices.Marshal.AllocHGlobal(IntPtr cb) when it is running under 64bit (Windows 2008 Server). The problem can easily be reproduced in a winform app. You need to set the platform target to x86 to experience the problem.Unfortuantely, our application needs to be built fox x86 for other reasons. Any ideas why this happens? Kind Regards Mat Source Code: using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Drawing.Printing; using System.Runtime.InteropServices; using System.Text; using System.Windows.Forms; namespace WindowsFormsApplication8 {     public partial class Form1 : Form     {         [DllImport("kernel32.dll")]         static extern IntPtr GlobalLock(IntPtr hMem);         [DllImport("kernel32.dll")]         [return: MarshalAs(UnmanagedType.Bool)]         static extern bool GlobalUnlock(IntPtr hMem);         [DllImport("kernel32.dll")]   &n

problem with calling soap service written (most probably in java)

Hi evebody, I'm experiencing problem calling third-party service written in java (mostprobably). When i call service i get following response: <env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'> <env:Header></env:Header> <env:Body> <env:Fault xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'> <faultcode>env:Server</faultcode> <faultstring>Content root name does not match element name: {http://foo.bar/}arg0 != arg0</faultstring> </env:Fault> </env:Body> </env:Envelope> I've used command line java utility provided by service provider and found following difference: soap request, generated by wcf (similar results with webservices)   <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"> <s:Body> <baz xmlns="http://foo.bar/"> <arg0 xmlns="">string value</arg0> <arg1 xmlns="">string value</arg1> <arg2 xmlns="">string value</arg2> </baz> </s:Body> </s:Envelope> request, generated by java utility: <S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"> <S:Body> <ns2:baz xmlns:ns2="http://foo.bar/"> <arg0>string value</arg0> <arg

WCF: Problem throwing FaultException after touching Exception.Data collection



My client code receives a CommunicationException if my server code touches the Exception.Data collection.  If my server code avoids the Exception.Data collection, then my client code works (i.e. it receives my custom exception as expected). 


I have reduced this problem down to two simple examples (see below)..one that works (A), one that does not (B).  The only difference between the two examples is that in example B, the code looks at the Exception.Data.Count property.


Why would touching the Exception.Data collection cause my client code to receive the CommunicationException? 

Is there any way to avoid this?


Thank you in advance for an consideration you may give to this question. 


A: Working Example: Client Receives CustomException
  throw new CustomException("This is a custom exception.");
 catch (CustomException ex)
  throw new FaultException<CustomException>(ex, new FaultReason(ex.Message), new FaultCode("Receiver"));


B: Non-working Example: Clien

Problem with create SOAP clinet...



I have problem with create soap client. I get WebApi documentation and find example in PHP:

try {
// access key to WebAPI
$accessKey = "ABSDFB34FI651N4MJAXY564F";
// create client object Soap
$soapClient = new SoapClient("http://beta.otodom.pl/webapi2/?wsdl");
// login to WebAPI.  Method  doLogin returned session key
$sessionKey = $soapClient->doLogin($accessKey,"twojemail@domena.pl","twojehaslo" );
echo "Login OK. Session key : $sessionKey.\n";
} catch (SoapFault $fault) {
echo "login is not success. Error code: [{$fault->faultcode}]

how to translate it in ASP.NET to C# ????



How to remove .NET Remoting Fatal problem :Exception



I am implementing Publisher/Subscriber pattern via .NET Remoting. My publisher is waiting for incoming requests on its url. At its side remoting environment configures properly and no problem at all.

At subscriber's end when I make some subscriptions from its side to publisher, it hangs out. I mean program hangs and console shows nothing , and it gone away, no exception here. When I disconnect publisher it now it resume's and follow processing and throws exceptions with stack Trace:

Will try again to add a subscription.System.Net.Sockets.SocketException (0x80004

005): An existing connection was forcibly closed by the remote host


Server stack trace:

   at System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size,

 SocketFlags socketFlags)

   at System.Runtime.Remoting.Channels.SocketStream.Read(Byte[] buffer, Int32 of

fset, Int32 size)

   at System.Runtime.Remoting.Channels.SocketHandler.ReadFromSocket(Byte[] buffe

r, Int32 offset, Int32 count)

List does not exist (0x82000006) SOAP Exception in SP 2010




I am using a web service call to update an List created on subsite.

I have added a web reference List Service by discovering the services available on the main site.


            myListService.UseDefaultCredentials = true ;
            myListService.PreAuthenticate = true ;

            // this will be local to the server we are running ... I should be using properties

            myListService.Url = "http://localhost:8081/_vti_bin/Lists.asmx" ;

            XmlNode  myListView = myListService.GetListAndView("Customers" ,&nb

SOAP response XML Exception



   I am using C#.Net 3.5 to consume a Web Service (http://www.ncbi.nlm.nih.gov/entrez/eutils/soap/v2.0/efetch_seq.wsdl) which has been working for me for years. About a week ago I started getting XML errors (see below for exception details) from the XML deserializer before I can even see the response from the Web Service. I used "snoop" (http://msdn2.microsoft.com/en-us/library/ms176041.aspx) to look at the XML being returned and it looks fine to me. I can even load that XML using XmlDocument.Load and I get no errors that way. Could .Net have different validation for SOAP than other xml documents? I am guessing that there is something bad happening before "snoop" can get it hands on the XML. Any idea what or what to do about

WCF client, svcutil and SOAP array problem


Hi, everyone. I hope someone will be able to help me about this issue:
I am trying to generate WCF client by issuing following command:
svcutil testingWsdl.wsdl /ser:XmlSerializer (/ser option has nothing with problem, I've just tried with it also)
I am getting following error:

Error: Cannot import wsdl:portType
Detail: An exception was thrown while running a WSDL import extension: System.ServiceModel.Description.XmlSerializerMessageContractImporter
Error: The datatype 'http://schemas.xmlsoap.org/soap/encoding/:Array' is missing.

Here is complete WSDL:

<?xml version="1.0"?>
<definitions xmlns="http://schemas.xmlsoap.org/wsdl/" 
<import namespace="soap" location="http://schemas.xmlsoap.org/wsdl/soap/"/>
 <portType name="SoapInPort">
 <operation name="SoapIn">

Soap cs code from WSDL encoding response problem


I have created a client proxy from a WSDL file with WSDL.exe

i can both send and recieve data fine.

The xmlfile i recieve contains Nordic char data (i see that in fiddler).

ex: <mydata>øæå</mydata>

The problem occurs when the data goes into my client proxy. It looks like they are in utf-8 format (and that will not work with nordic chars).

so the nordic chars are just scrambled.

any way to override this ?

 object[] response = this.Invoke("Query", new object[] { message });
 message = ((elements)(response[1]));
 return (string)(response[0]);




SOAP Mismatch exception



I had an issue with the webservice execution.

Here is my code and am getting an exception SOAP mismatch Exception at ReadProject() method..

wpSvsProject.Project proj= new wpSvsProject.Project();
proj.Url = ConfigurationManager.AppSettings["WebServiceURL"].ToString();
proj.Credentials = CredentialCache.DefaultCredentials;
proj.ProjectDataSet prjDataSet = proj.ReadProject(projGUID, proj.DataStoreEnum.WorkingStore);

My webservice reference url is ....[<add key="WebServiceURL" value="http://server/site/_vti_bin/PSI/Project.asmx?wsdl"/>]

I tried changing the url without '?wsdl' also, but then am getting 401 error (unauthorized error).

Can anyone suggest me on this? Thanks.


webBrowser exception problem


I'm writing a C# program that makes use of the webBrowser control. Generally I've been successful in using it but have encountered a problem I can't figure out.

I intercept the DocumentCompleted event from my webBrowser control. During the processing of that event I create an additional webBrowser control and  call its Navigate function to tell it to navigate to a specific URL. When I do that it throws an exception : "IWebBrowser2 get from the native ActiveX control did not succeed", and I can see that the axIWebBrowser2 property of the control is null.

My code is approximately like this:

webBrowser otherWebBrowser = new webBrowser(); 

private void webBrowser_DocumentCompleted(object sender, WebBrowserDocumentCompletedEventArgs e)
   MessageBox.Show("Excption was thrown!");

Is it possible that you can't instantiate and call the Navigate method for a webBrowser


Every self-respected programmer should include exception handling techniques. Sometimes your application will generate an error. Regardless of who was responsible for this error, the programmer or the user, it is up to the first to include the necessary exception handling techniques to keep his/her program from crashing. The .Net environment provides useful techniques for avoiding disastrous errors such as try-catch statements and user-defined exceptions.

Global Exception Handling with ASP.NET

After your global exception handler has done its work, you'll want to redirect the users of your website to a friendly page that tells them that something has gone wrong, and then provide them with customer support information as well as a link back to your web application's home page.

Problem to group radio button across gridview rows

In general no one can easily group or make a single selection from radio button list inside gridview rows. There are a lot of way to make a single or unique selection from list. Here i want to share how i can address this problem in the most easiest way. Googling the problem most of the cases i saw the grouping in horizontal way. Thats why i tried to group the radio buttons in vertical manner. Let i have a requirement like below:

Regrading Sharpoint 2010 problem and solutions

We can write your question and problem on this blogger.you get ans.use.

This sharpoint 2010 problem solving threads

Hi friend,

you can use this thread to solving problem and solutions.
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend