on 09-13-2017 1:41 PM
Hi Experts,
i need your help. I use this blog Reading Messages from PI System to read all Messages from PI with a c# application.
at the moment i can read a single message by using getMessageByteJavaLangStringBooloean and the messagekey
var base64 = client.getMessageBytesJavaLangStringBoolean(MessageKey, false);
But when i try to get the whole message list i get no respone from PI
this is my code
BasicHttpBinding binding = new BasicHttpBinding();
binding.Security.Mode = BasicHttpSecurityMode.TransportCredentialOnly;
binding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Basic;
EndpointAddress endpoint = new EndpointAddress("http://sapq13:50000/AdapterMessageMonitoring/basic?style=document");
AdapterMessageMonitoringViClient client = new AdapterMessageMonitoringViClient(binding, endpoint);
client.ClientCredentials.UserName.UserName = "";
client.ClientCredentials.UserName.Password = "";
AdapterFilter filter = new AdapterFilter()
{
archive = false,
dateType = 0,
nodeId = 0,
onlyFaultyMessages = false,
retries = 0,
retryInterval = 0,
timesFailed = 0,
wasEdited = false
};
getMessageListResponse resp = new getMessageListResponse(client.getMessageList(filter, 1));
AdapterFrameworkData da = new AdapterFrameworkData(resp.Response);
can someone help me?
Regards,
Alex
i solved the problem, if someone has a question feel free to ask me
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Victor,
yes the code was broken, now i used this one here.
BasicHttpBinding binding = new BasicHttpBinding();
String MessageKey = @"your Messagekey like this \OUTBOUND\<culster node>\<SID>\0\";
binding.Security.Mode = BasicHttpSecurityMode.TransportCredentialOnly;
binding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Basic;
binding.MaxReceivedMessageSize = maxSize;
EndpointAddress endpoint = new EndpointAddress(url);
AdapterMessageMonitoringViClient client = new AdapterMessageMonitoringViClient(binding, endpoint);
client.ClientCredentials.UserName.UserName = "User";
client.ClientCredentials.UserName.Password = "Password";
//Returns byte array
var base64 = client.getMessageBytesJavaLangStringBoolean(messageFromCell + MessageKey, false);
// From byte array to string
string s = System.Text.Encoding.UTF8.GetString(base64, 0, base64.Length);
//Remove PI Conten from Message
String Message = SplitString(s);
XDocument xDocument = XDocument.Parse(Message);
Regards,
Alex
User | Count |
---|---|
84 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.