开发者

Getting ParsingError, InvalidSoapActionHeader on SQL Server SOAP request

开发者 https://www.devze.com 2023-03-28 21:54 出处:网络
I am attempting to send a SOAP request to SQL Server 2005, but I am getting a vague error in response. Can anyone interpret for me?

I am attempting to send a SOAP request to SQL Server 2005, but I am getting a vague error in response. Can anyone interpret for me?

Here is my request (linebreaks have been added for readability):

<v:Envelope 
xmlns:i="http://www.w3.org/2001/XMLSchema-instance" 
xmlns:d="http://www.w3.org/2001/XMLSchema" 
xmlns:c="http://www.w3.org/2001/12/soap-encoding" 
xmlns:v="http://www.w3.org/2001/12/soap-envelope">

<v:Header>
<wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
<wsse:UsernameToken>
<wsse:Username>cgtyoder</wsse:Username><wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">SooperSekrit</wsse:Password>
</wsse:UsernameToken>
</wsse:Security>
</v:Header>

<v:Body>
<MyFunction xmlns="http://tempuri.org/" id="o0" c:root="1">
<OutputParam i:nil="true" />
</MyFunction>
</v:Body>
</v:Envelope>

And here is the XML response (linebreaks added):

<?xml version="1.0" encoding="utf-8"?>
<SOAP-ENV:Envelope xml:space="preserve" 
xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" 
xmlns:sql="http://schemas.microsoft.com/sqlserver/2004/SOAP" 
xmlns:sqlsoaptypes="http://schemas.microsoft.com/sqlserver/2004/SOAP/types" 
xmlns:sqlrowcount="http://schemas.microsoft.com/sqlserver/2004/SOAP/types/SqlRowCount" 
xmlns:sqlmessage="http://schemas.microsoft.com/sqlserver/2004/SOAP/types/SqlMessage" 
xmlns:sqlresultstream="http://schemas.microsoft.com/sqlserver/2004/SOAP/types/SqlResultStream" 
xmlns:sqltransaction="http://schemas.microsoft.com/sqlserver/2004/SOAP/types/SqlTransaction" 
xmlns:sqltypes="http://schemas.microsoft.com/sqlserver/2004/sqltypes" 
xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">

<SOAP-ENV:Body>
<SOAP-ENV:Fault xmlns:sqlsoapfaultcode="http://schemas.microsoft.com/sqlserver/2004/SOAP/SqlSoapFaultCode">
<faultcode>SOAP-ENV:Client</faultcode>
<faultstring>There was an error in the incoming SOAP request packet: Client, ParsingError, InvalidSoapActionHeader</faultstring>
<faultactor>http://schemas.microsoft.com/sqlserver/2004/SOAP</faultactor>
<detail xmlns:SOAP-1_2-ENV="http://www.w3.org/2003/05/soap-envelope">
<SOAP-1_2-ENV:Code>
<SOAP-1_2-ENV:Value>SOAP-1_2-ENV:Sender</SOAP-1_2-ENV:Value>
<SOAP-1_2-ENV:Subcode>
<SOAP-1_2-ENV:Value>sqlsoapfaultcode:ParsingError</SOAP-1_2-E开发者_Python百科NV:Value>
<SOAP-1_2-ENV:Subcode>
<SOAP-1_2-ENV:Value>sqlsoapfaultcode:InvalidSoapActionHeader</SOAP-1_2-ENV:Value>
</SOAP-1_2-ENV:Subcode>
</SOAP-1_2-ENV:Subcode>
</SOAP-1_2-ENV:Code>
<SOAP-1_2-ENV:Reason>
<SOAP-1_2-ENV:Text xml:lang="en-US">There was an error in the incoming SOAP request packet: Sender, ParsingError, InvalidSoapActionHeader</SOAP-1_2-ENV:Text>
</SOAP-1_2-ENV:Reason>
<SOAP-1_2-ENV:Node>https://10.199.5.116:444/dt2</SOAP-1_2-ENV:Node>
<SOAP-1_2-ENV:Role>http://schemas.microsoft.com/sqlserver/2004/SOAP</SOAP-1_2-ENV:Role>
<SOAP-1_2-ENV:Detail/>
</detail>
</SOAP-ENV:Fault>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

Here is my SOAP Endpoint definition on the server:

CREATE ENDPOINT [DroidTest2] 
    AUTHORIZATION [cgtyoder]
    STATE=STARTED
    AS HTTP (PATH=N'/dt2', PORTS = (SSL), AUTHENTICATION = (BASIC), SITE=N'*', SSL_PORT = 444, COMPRESSION=DISABLED)
    FOR SOAP (
WEBMETHOD 'DroidFunction'( NAME=N'[pubs].[dbo].[DroidFunction]'
, SCHEMA=DEFAULT
, FORMAT=ROWSETS_ONLY), LOGIN_TYPE=MIXED, BATCHES=DISABLED, WSDL=N'[master].[sys].[sp_http_generate_wsdl_defaultsimpleorcomplex]'
, SESSIONS=ENABLED, SESSION_TIMEOUT=600, DATABASE=N'pubs', NAMESPACE=N'http://tempuri.org/', SCHEMA=STANDARD
, CHARACTER_SET=XML)
GO

The UDF DroidFunction takes no arguments and returns a string (VarChar(30)). I am able to connect to https://10.199.5.116/dt2?wsdl and get the WSDL. Thanks for any pointers here.


See http://social.msdn.microsoft.com/Forums/en-US/sqldataaccess/thread/7619d2e0-a5eb-4379-b027-234103e7f171 for my solution.

0

精彩评论

暂无评论...
验证码 换一张
取 消