我刚刚开始使用Web Service,SOAP消息和端点,而我尝试发送的肥皂消息有一个小问题。 我使用此代码连接到wsdl端点
public class MessageProcessorTestClient : IMessageProcessorServiceContract {
#region Implementation of IMessageProcessorServiceContract
public void SubmitDocument(string documentXml, IcisNetSecurityToken token, MessageTypeIcisNet type) {
//Test enviroment force TLS 1.2
ServicePointManager.SecurityProtocol = (SecurityProtocolType)3072;
ServicePointManager.ServerCertificateValidationCallback += (se, cert, chain, sslerror) => {
return true;
};
ServicePointManager.Expect100Continue = false;
using (MessageProcessorPortTypeClient client = new MessageProcessorPortTypeClient()) {
ServicePointManager.SecurityProtocol = (SecurityProtocolType)3072;
client.ClientCredentials.UserName.UserName = "username";
client.ClientCredentials.UserName.Password = "password";
MessageSubmissionRequest req = new MessageSubmissionRequest {
DigitallySignedMessage = new SubmittedXMLMessageInfo {
isXmlString = true,
messageType = MessageHelper.GetTestMessageType(type),
xmlMessage = documentXml
},
traderID = token.Afm,
wsUserID ="wsUsername",
wsPass = "wsPass"
};
client.Open();
MessageSubmissionRequestResult result = client.processIncomingMessage(req);
if (result.resultState.status != RequestState.OK) {
throw new MessageException(ResultToString(result.resultState),
ErrorsToString(result.ProcessingErrors));
}
}
}
}
我还使用代码对XSD创建位于以下位置的XML: https://portal.gsis.gr/icisnetcms/getFile?ClazzName=com.unisystems.icisnet.cms.ProdcompAttachments&UID=10579260&MemberName=Upload&language=GR
我已经成功连接了端点,但是返回了错误。
RulesConditionasError:SubmittingTraderIdentification([SubmittingTraderIdentification:null]必须与交易者ID(120087250)相同
在我的肥皂消息中,我已经声明了SubmittingTraderIdentification
<SubmittingOperator>
<SubmittingOperatorIdentification>120087250</SubmittingOperatorIdentification>
<SubmittingTraderIdentification>128892649</SubmittingTraderIdentification>
</SubmittingOperator>
端点位置是: https://www2.gsis.gr/wsicisnet/MessageProcessorService?wsdl
有人可以告诉我我发错了什么吗? 他们提供的文档确实很差,当我通过电话与他们联系时,他们说他们看到的消息似乎是正确的,但是他们不知道我为什么收到此回复。
我不知道是否应该添加其他任何东西,这样有人可以帮我吗。