Я только начал работать с веб-сервисом, 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] должен совпадать с идентификатором трейдера (120087250)
В своем мыльном сообщении я уже объявил submittingTraderIdentification
<SubmittingOperator>
<SubmittingOperatorIdentification>120087250</SubmittingOperatorIdentification>
<SubmittingTraderIdentification>128892649</SubmittingTraderIdentification>
</SubmittingOperator>
Местоположение конечной точки: https://www2.gsis.gr/wsicisnet/MessageProcessorService?wsdl
Может кто-нибудь сказать мне, что я могу отправить неправильно? Документация, которую они дают, очень плохая, и когда я связался с ними по телефону, они сказали, чтоони видят, что сообщение кажется правильным, но они не знают, почему у меня есть такой ответ.
Я не знаю, стоит ли мне что-то добавить, чтобы кто-нибудь помог мне.