Please start any new threads on our new site at We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 Other SQL Server 2008 Topics
 SOAP dodger
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Posting Yak Master

United Kingdom
226 Posts

Posted - 11/30/2012 :  10:32:57  Show Profile  Visit theboyholty's Homepage  Reply with Quote
I've been asked to set up a SOAP/XML API to send data directly into a client's system. Its all kind of new to me so here's the thing.

I've been given the web service details so I don't envisage too many problems with that, but I'm having trouble creating the XML as it contains a SOAP header and I've not come accross this before.

Does anyone know how to write a SQL query to produce an XML result like the one provided below? (I've got all the fields they require in a table, I just need to know how to do the XML)

<?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="" xmlns:soap="" xmlns:xsi="" xmlns:xsd="">
-<CreateProposal xmlns=""> 
<account>SWP Users</account> 
	<PostCode>AB1 2CD</PostCode>

I'd be most grateful if someone could point me in the right direction. You know, the annoying thing is that I'm leaving this job next week so if they'd left it for a few more days, it would have been someone else's headache. Doh!

--------------------------------------------------------------------------------- A Bury FC supporters website and forum

Flowing Fount of Yak Knowledge

6065 Posts

Posted - 11/30/2012 :  11:35:01  Show Profile  Reply with Quote
I think what most folks have done for this is have the database just return to the web service the data content as a normal sql result set. The web service code would use that content to construct the xml response including the soap header. At least that is the way we do it.

Be One with the Optimizer
Go to Top of Page

Elizabeth B. Darcy
Starting Member

United Kingdom
39 Posts

Posted - 11/30/2012 :  12:04:37  Show Profile  Reply with Quote
Can you also post the schema of your database tables where the data is sourced from?

-- Yes, I am indeed a fictional character.
Go to Top of Page

Posting Yak Master

United Kingdom
226 Posts

Posted - 12/03/2012 :  09:49:06  Show Profile  Visit theboyholty's Homepage  Reply with Quote
TG - I like the sound of what you're saying there. After many fierce battles of will, I've grown to love web services. I shall give it a go.

Elizabeth, I've dragged the data into a single table to make life simple so it would look something like
SELECT Title, Forename,Surname,DOB,MaritalStatus,MobilePhoneNumber,Postcode FROM AnchorWebSelection

--------------------------------------------------------------------------------- A Bury FC supporters website and forum
Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.03 seconds. Powered By: Snitz Forums 2000