Altova Mailing List Archives>Archive Index >microsoft.public.xml Archive Home >Recent entries >Thread Prev - Sending SOAP message with XMLHTTP in SQL Server 2000 >Thread Next - Re: Sending SOAP message with XMLHTTP in SQL Server 2000 Re: Sending SOAP message with XMLHTTP in SQL Server 2000To: NULL Date: 8/8/2007 8:11:00 AM Have you tried using NVARCHAR and maybe trying UTF-16 as the content type declaration? -- Joe Fawcett (MVP - XML) http://joe.fawcett.name <n.frantzen@g...> wrote in message news:1186518639.974888.283390@r...... > Hi, > > I want to send a SOAP envelope to a web service from a SQL 2000 stored > procedure using the ServerXMLHTTP object. > > I get an error at the "send" method : The Parameter is incorrect. I > use a tracer utility to see if any message is being to the port 1008. > When I send an empty string i get an error back from my web service > (and i see the messages in the trace utility) but when I try to send > the SOAP message (which has been tested and works fine in a VB app > using XMLHTTP) then i get the "Parameter is incorrect" error. Also i > tried sending the SOAP message without the double quotes in the string > and it went to the web service meaning the double quotes are not > properly handles by the XMLHTTP object (or by SQL Server i don't > really know). > > Does anyone had an idea of what I should try to solve my problem? > > Here is my code: > > ALTER PROCEDURE dbo.sp_CEWS @sName varchar(255) AS > DECLARE @hr int, @hv int > DECLARE @object int > DECLARE @src varchar(255), @desc varchar(255) > DECLARE @soapmessage varchar(8000) > DECLARE @method varchar(8000) > DECLARE @dom int > > > > EXEC @hr=master..sp_OACreate 'MSXML2.ServerXMLHTTP.4.0', @object OUT > > IF (@hr <> 0) > BEGIN > EXEC sp_OAGetErrorInfo @object, @src OUT, @desc OUT > SELECT dbo.PrintToLog('Error',@src+' : '+@desc) > END > ELSE > EXEC @hr = master..sp_OAMethod @object, 'open',null, > 'POST', 'http://localhost:1008/FNCEWS35SOAP/', false > > SET @soapmessage = '<?xml version="1.0" > encoding="UTF-8"?><soap:Envelope xmlns:soap="http:// > schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/ > XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" > xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" > xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss- > wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/ > 2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"> > <soap:Header></soap:Header><soap:Body></soap:Body></soap:Envelope>' > > IF @hr <> 0 > BEGIN > EXEC sp_OAGetErrorInfo @object, @src > OUT, @desc OUT > SELECT dbo.PrintToLog('Error',@src+' : > '+@desc) > END > ELSE > EXEC @hr = master..sp_OAMethod > @object, 'setRequestHeader("Content-Type", "text/xml")', null > IF @hr <> 0 > BEGIN > EXEC sp_OAGetErrorInfo > @object, @src OUT, @desc OUT > SELECT > dbo.PrintToLog('Error',@src+' : '+@desc) > END > > EXEC @hr = master..sp_OAMethod > @object, 'setRequestHeader("SOAPAction", "http://www.filenet.com/ns/ > fnce/2005/02/ws/SOAP#ExecuteChanges")', null > > IF @hr <> 0 > BEGIN > EXEC sp_OAGetErrorInfo > @object, @src OUT, @desc OUT > SELECT > dbo.PrintToLog('Error',@src+' : '+@desc) > END > PRINT @soapmessage > --SET @method = 'send('+@soapmessage > +')' > EXEC @hr = master..sp_OAMethod > @object,'send', null, @soapmessage > IF @hr <> 0 > BEGIN > EXEC sp_OAGetErrorInfo > @object, @src OUT, @desc OUT > SELECT > dbo.PrintToLog('Error',@src+' : '+@desc) > END > EXEC @hr = master..sp_OAMethod > @object, 'readyState()', @hv OUT > WHILE(@hv!=4) > BEGIN > EXEC @hr = > master..sp_OAMethod @object, 'waitForResponse(10)', null > EXEC @hr = > master..sp_OAMethod @object, 'readyState()', @hv OUT > END > IF @hr <> 0 > BEGIN > EXEC sp_OAGetErrorInfo > @object, @src OUT, @desc OUT > SELECT > dbo.PrintToLog('Error',@src+' : '+@desc) > END > | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
