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

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

Saving SOAP to Database

Posted By:      Posted Date: August 27, 2010    Points: 0   Category :ASP.Net
Hi All, 

Web Services are very new to me and for the life of me I can not find any info on how to save a soap call/response to the database for a web service.

I did find how to trace them but not save it.

Part of my issue may be that, I am not building a soap envelope for the send. The service I am calling uses different methods to post to itself, e.g.  

api.Execute, api.Create, api.Update and api.Retrieve.

I think these methods are building the envelope for me. If I 'Go to definition' on the Execute method it takes me to the References.cs codebehind page in the application web service for this code.

[System.Web.Services.Protocols.SoapDocumentMethodAttribute("Execute", RequestElementName="ExecuteRequestMsg", RequestNamespace="http://exacttarget.com/wsdl/partnerAPI", ResponseElementName="ExecuteResponseMsg", ResponseNamespace="http://exacttarget.com/wsdl/partnerAPI", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
        [return: System.Xml.Serialization.XmlElementAttribute("OverallStatus")

View Complete Post

More Related Resource Links

Does this look correct for saving a file/ new record to a database


So thank you for all your help so far, So I think i got this right,
but would like for you all to look it over to see if there is any
areas I might run into trouble with:

//using asp.net mvc 2
the table (sql server 2005, using entities framework)
table fields
"Pattern_Media_GUID  uniqueid 
"Pattern_GUID  uniqueid
"Media varbinary(max)  
"height int
"Width int
"Media_Type String (50)

the form:
<h2> Add Media to this pattern</h2>
<% Html.EnableClientValidation(); %>
<% Html.BeginForm("AddMedia", "Pattern", new { id= Model.Pattern_Guid} , FormMethod.Post, new {enctype = "multipart/form-data"}); %>
    <%: Html.Label("height") %>
    <%: Html.TextBox("height") %>

    <%: Html.Label("width") %>
    <%: Html.TextBox("width") %>

    <%: Html.Label("Media") %>
    <input type="file" id="Media" name="Media" />
    <input type="submit" name=

Saving textbox data to MySql database in asp.net


Hi dear coders

though a very simple question to ask, but please tell me how to save and retrieve data in/from my textboxes to/from database (MYSQL) on submit button click.

i know its a very simple task but i cant make it done, so i request you to please send me some working example link or post any helpful code here in asp.net

i will be highly thankful for any kind help from you geniuses.



Database Access Using SOAP and REST Web services

Hi Guys, Can anyone post the links regarding DATABASE ACCESS USING BOTH WEB SERVICES. How to query the database using the web service. Suppose i have SQL statement like " Select empID,empName,CName from employee,company where empID=CID;".  How to  send this sql query to database server using REST and SOAP web Services?  Thank You

showing modalpopup and saving data to database simultaneously using ajaxtoolkit and javascript

hi,i have a button ,i want that when i click on that button the data should be saved in the database as well as at the same time a modal popup should display the customerid .i have written the code as <asp:button id="save1" runat="server" onclick="Button4_Click" style=""z-index:" mode="hold" xmlns:asp="#unknown" /> left: 740px; position: absolute; top: 304px" Text="save"/> <asp:panel id="panel" runat="server" xmlns:asp="#unknown">  /asp:Panel> <ajaxtoolkit:modalpopupextender id="MPE" runat="server" targetcontrolid="save1" xmlns:ajaxtoolkit="#unknown"> PopupControlID="panel" DropShadow="true" BackgroundCssClass="modalBackground/> protected void Button4_Click(object sender, EventArgs e) { string id = TextBox1.Text; string name = TextBox2.Text; string cn = "Data Source=hcl;Initial Catalog=mydata;Integrated Security=True"; SqlConnection con = new SqlConnection(cn); SqlCommand cmd = new SqlCommand("insert into customer values (@id,@name)", con); con.Open(); cmd.CommandType = CommandType.Text; cmd.Parameters.Add("@id", id); cmd.Parameters.Add("@name",name); cmd.ExecuteNonQuery(); con.Close(); CUSTID.Text = id.ToString(); MPE.Show(); }

dataset not saving to database - what am I not doing? :((

Hello.  Please help me with this one if you have a few mins.  I think I'm overlooking something silly... I have a "hello world" database project.  A mdf database with 1 table "users", the table has 2 columns userid & username (both varchar(50)).  I added a dataset called Database1Dataset.xsd.  I drag the table onto it and it creates the "users" datatable.  I checked it to see if it created the insert and update commands and it has.   On my form I have 2 buttons, one for read and the other for write/save. The read button works and I can see the test records in the database; Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim da As New Database1DataSetTableAdapters.usersTableAdapter Dim dt As New Database1DataSet.usersDataTable da.Fill(dt) For Each dr In dt TextBox1.Text += dr.userid & " - " & dr.username & vbCrLf Next End Sub   The second button should add a new record and save it down to the database but this does not work.  Somehow the changes are not being commited and saved. Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Dim dt As New Database1DataSet.usersDataTable

Updating the viewstate object before saving it to the database


I have overridden the following methods:


SavePageStateToPersistenceMedium(object viewState) 

in a class that my page derives from, so that the viewstate can be stored in DB.

Now, on page_load of my page, I am checking what control caused a postback & based on that I am forcing execution of 2 button click events in a row (by overloading those click events & calling them explicitely), but the behaviour I want is as if the execution of those 2 button click events went through the regular page life cycle.

Here is the sequence of events that happen in typical page life cycle & notice I want to alter behaviour at step 4 (on load):

1) Initialization

2) LoadViewStateData (here the viewstate is loaded from my database using the overridden LoadPageStateFromPersistenceMedium)

3) LoadPostBackData

4) Load

Here, I would like to force execution of 2 button_click events based on whether a particular control posted back.

       4.1) imgBtnPrev5_Click()

       4.2) imgBtnPrev4_Click()

Now, when the imgBtnPrev5_Click() is executed, the viewstate is already loaded, so we are fine. But after execution of imgBtnPrev5_Click(), I would like to update the viewstate object in memory & then call the o

Saving FrameWork Element into a Database

If I wanted to save the content of something which uses frameworkelement, how could I save this into a database field so it can be loaded later on?

Uploading .pdf files with FIle Upload control and then saving to database


Hi everyone!

I'd like to allow users to upload a .pdf file via the file upload control (if that's the best method), save the file to the db and then retrieve it so they can click on a link and open the .pdf they've uploaded.

I've been looking for a tutorial on how to do this but keep running into methods of saving the file directly on the server in a directory, not in SQL server  (using Linq and VB by the way)

Can someone please point me in the right direction on how to do this?   Thanks!

using System.Reflection to saving to database


Hello guy!


I am having challenges saving multiple row to my database using reflection. Each time I cmd.ExecuteNonQuery(), I get the message 'The variable name '@referenceID' has already been declared. Variable names must be unique within a query batch or stored procedure.'

What should i do to resolve this?

Saving an Access database (Powershell)


Here is a fun one. I was told this is the place I’m supposed to ask so here I am.

 I am making a Powershell script that does a bunch of things. The last step is to connect to an Access Database via ADO.net and make an update. I have the basic script from the scripting guys and tried modifying it to my own needs. The Database section is as follows:


$UH = [int]"149995"
$update = " MM/DD: Add text"

$objConnection = New-Object -comobject ADODB.Connection
$objRecordset = New-Object -comobject ADODB.Recordset
$objConnection.Open("Provider = Microsoft.Jet.OLEDB.4.0; Data Source = c:\scripts\User_Help_BE.mdb")
$objRecordset.Open("Select * from [User Help Main Table]",$objConnection,3,3)


while (!($objRecordset.EOF)){
 if ($objRecordset.Fields.Item("ID").Value -eq $UH) {
   $objRecordset.Fields.Item("Tried").Value = $objRecordset.Fields.Item("Tried").Value + $update
	 $UHT = $objRecordset.Fields.Item("Tried").Value
   break }
if ($objRecordset.EOF 

How to handle Daylight Saving Time issues in sql server Database


Hi We have users across the globe and have issues everytime the Daylight Savings change occur. Is there a way to handle this issue in sql server?


Saving database connections


I am trying to save connections in management studio so I don't have to re-enter them every time.  I have to connect to multiple servers and I just want to be able to open management studio and have them already in there.  Is there anyway to do this?


Multiple database support with Entity Framework

One of the features introduced in Entity Framework is being database independent. Which mean each database provider can support Entity Framework by implementing its provider.

This feature allows you build applications independent from the underplaying database provider. In this post I'm going to show how to build an application that support multiple databases using same conceptual model made by Entity Framework.

Export Visio Database Table Names to Excel

If you use the Enterprise Architect edition of Microsoft Visio for data modeling regularly, then there is a good chance that at some point you've wanted to export just the table names into Excel. You might want to do this to map logical ERD entities to physical data model tables, track project status by entity, or track overlap between database versions.

MS SQL Server: Disconnect Users From Database - Kill User Session

If you ever wanted to restore your database from a SQL backup file (.bak), but there are still users connected to your database, the backup operation will fail causing the error: Exclusive access could not be obtained because the database is in use.

Publishing SQL Server Database using Publishing Wizard : Tips & Tricks

We can use SQL Server Publishing Wizard to deploy our local Database to remote hosting server/production server.This feature is available in SQL Server 2008/VWD 2008.

Below is the complete step by step guide of this process.

Adding Rows in GridView without using a Database

This article describes on how to add rows in GridView without using a database. Basically the GridView will be populated with data based on the values entered in the TextBox on Button Click and retain the GridView data on post back.
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