我正在开发与Siebel EAI webservice的集成,我不知道认证是如何工作的。
下面的请求通常适用于SoapUi:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:cus="http://siebel.com/CustomUI">
<soapenv:Header>
<UsernameToken xmlns="http://siebel.com/webservices">BRBD</UsernameToken>
<PasswordText xmlns="http://siebel.com/webservices">2015</PasswordText>
</soapenv:Header>
<soapenv:Body>
<cus:GetTransactionForDays_Input>
<cus:Program_spcName>Loyalty Program – Agroservice</cus:Program_spcName>
<cus:Days>10</cus:Days>
</cus:GetTransactionForDays_Input>
</soapenv:Body>
</soapenv:Envelope>我需要的是将此请求复制为WCF客户端。我的代码如下所示:
PartnersWs.BCS_spcLOY_spcPeriod_spcTransactionClient tran =
new BCS_spcLOY_spcPeriod_spcTransactionClient("myCustomBinding",
"http://[server]/start.swe?SWEExtSource=WebService&SWEExtCmd=Execute&WSSOAP=1");
GetTransactionForDays_Input inp = new GetTransactionForDays_Input();
inp.Days = "1";
inp.Program_spcName = "Loyalty Program - Puntos Poderosos";
GetTransactionForDaysRequest req = new GetTransactionForDaysRequest(inp);
tran.ClientCredentials.UserName.UserName = "BRBD";
tran.ClientCredentials.UserName.Password = "2015";
tran.GetTransactionForDays(inp);我的自定义绑定配置(因为我不想使用https,所以我需要指定allowInsecure):
<customBinding>
<binding name="myCustomBinding">
<transactionFlow />
<security
authenticationMode="SecureConversation"
messageSecurityVersion="WSSecurity11WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11BasicSecurityProfile10"
allowInsecureTransport="true" allowSerializedSigningTokenOnReply="true" >
<secureConversationBootstrap
authenticationMode="UserNameForSslNegotiated"
messageSecurityVersion="WSSecurity11WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11BasicSecurityProfile10" />
</security>
<textMessageEncoding />
<httpTransport decompressionEnabled="true" useDefaultWebProxy="true"/>
</binding>
</customBinding>服务器的响应是:
The content type text/xml;charset=utf-8 of the response message does not match the content type of the binding (application/soap+xml; charset=utf-8). If using a custom encoder, be sure that the IsContentTypeSupported method is implemented properly. The first 756 bytes of the response were: '<?xml version="1.0" encoding="utf-8"?><SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Client</faultcode>**<faultstring>
Error Code: 10944642 Error Message: Error: Inbound SOAP Message - Session Token is missing or invalid or has expired</faultstring>**<detail><siebelf:errorstack xmlns:siebelf="http://www.siebel.com/ws/fault"><siebelf:error><siebelf:errorsymbol /><siebelf:errormsg>Error: Inbound SOAP Message - Session Token is missing or invalid or has expired</siebelf:errormsg></siebelf:error></siebelf:errorstack></detail></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>'.有什么想法吗?tks
发布于 2015-07-09 11:18:55
根据Siebel书架,WS-Security (您正在绑定中实现)和Siebel SOAP WS服务中使用的安全头是两个完全不同的东西。
请更正您的绑定不包括WS-安全模型-相反,处理标题字段与任何其他字段(但包含正确的名称空间)。
对Siebel的身份验证也有不同的方法(您可能也想了解这一点):
https://stackoverflow.com/questions/31079574
复制相似问题