I am working with a program that is meant to publish to and read from an existing TIBCO EMS hosted on a server separate from the program. I have referenced the sample code provided with the TIBCO installation, resulting in a big chunk of the program. Here is the code snippet that I am having troubles with:
1 QueueConnectionFactory factory = new TIBCO.EMS.QueueConnectionFactory(serverUrl);
2 QueueConnection connection = factory.CreateQueueConnection(username,password);
3 QueueSession session = connection.CreateQueueSession(false, Session.AUTO_ACKNOWLEDGE);
When line 1 runs, it goes through alright. When line 2 runs, it goes through alright, however, the connection object is null, resulting in an error during line 3 where a NullReferenceException occurs.
I would have at least expected that line 2 would return some sort of error to show that the request timed out, the credentials were wrong, the url is inaccessible, or at least something to let me know what the issue is, but there is nothing like that, until it hits line 3.
Does it have to do with the configuration of my application? All I have done to get this working is include the TIBCO.EMS.dll as a reference and worked with the code from there.
Could it have something to do with the fact that I am connected to a VPN that requires a proxy? If so, how can I set up that proxy in my code?
Any help would be greatly appreciated. Thank you.
The issue was that I was using the wrong version of the .NET framework to work with the Tibco integration. The version I was using was farther along than the original.
It would think that your server URL is incorrect.
try different urls maybe like tcp://localhost:7222 (where localhost can be the IP/Name of the remote server)
install EMS locally on you workstation and see if you can connect to it. (Default admin with no password)
Related
I found out that the unity remote config was unstable where sometime the remote config will stop working and return "curl error 28: Connection timed out after 10005 milliseconds" (as attached image here). Where some other time it was working just fine.
What I am trying to do is try to fetch remote config's data, in my case I check the "isMaintenance" bool every 5 second and if it return true, the game will block/sign out the player from playing the game.
I am not sure is the unity remote config will get affect by the connection type (wifi connection or mobile data), as me and my team tested that every time we used mobile data will not have the above issue, while using wifi will caused the error. Did anyone know what is the reason behind the issue?
What we found even strange is that some of the pc does not have this issue while the others will see this inside unity editor while we are all using the same project with the same version of Unity and Remote Config.
We had also make android build to test out too, and wifi connection will always have the error while mobile data connection seems fine and able to retrieve the data from remote config successfully when we called ConfigManager.FetchConfigs() every few seconds.
We added "if (configResponse.status == ConfigRequestStatus.Success)" to checkup the state too, when the error occurs, it always return false in this checking.
We am using Remote Config Version 1.4.0, in Unity 2020.3.19f1
Any suggestion will be much appreciated!
I managed solved it by upgrading the unity remote config version from 1.4.0 to 2.1.2. To anyone come across the same issue, refer to the link below for more detail.
https://forum.unity.com/threads/remote-config-unstable-return-curl-error-28-connection-timed-out-after-10005-milliseconds.1320753/#post-8352144
image
disabling the automatically initialize unity gaming services in IAP button catalog works for me.
First of all, I have been started to studying the C# from 6 months ago and I'm not good at English.
So I'm sorry if I say something that you cannot understand.
Now, I'm developing the application with C# that ONLY connect to MySQL server(both of remote and local).
And I use a MySql.Data.Client package, it's version 8.0.12.
This ONLY means "I don't send any queries. I want to find that I can connect to server using a UserName and Password.".
Then, I wrote this code. And I have two questions, and I want to get any advises.
sendCommand = string.Format("host={0}; userid={1}; password={2}; SslMode=none;", pIPAddress.ToString(), mOption1, mOption2);
MySqlConnection mysqlConnention = new MySqlConnection(sendCommand);
mysqlConnention.Open();
if (mysqlConnention.State.ToString() == "Open")
{
result = true;
}
mysqlConnention.Close();
Q1
The application should not send unnecessary packets to server.
However I found it from WireShark and it's "show variable" command.
I tried to change some properties about ConnectionString(in this code, it's called "send Command") because I want not to send "show variable" command. (for example, ChacheServerProperties=true, AllowBatch=false, and so on...)
Can I connect without "show variable" command?
Q2
(It's soloved but I cannot find the causion)
When I started developing this application, I used MySql.Data.Client 8.0.11.
But in that time, the MySqlConnection.Open Method was taken a long time for connection to server.(It was about 7~10 second.)
The network problems was none, and I was able to connect using cmd.exe without a long time.(It was not taken a second.)
I tried any patterns, changed server to connect, restarted OS(both of the application side and server side), changed ConnectionString properties).
MySQL server was not dying and It looked like the cause is not in MySQL server and network.(Getting the application "ServerGreeting" packet from server was no time but next action that the application send "LoginRequest" packet to server was taken a long time.)
However I was not able to slove this problem. But I updeted MySql.Data.Client version to 8.0.12, I can slove!
Is this problem caused by MySql.Data.Client 8.0.11?
And have I any solution?
The application should not send unnecessary packets to server. … Can I connect without "show variable" command?
You can, by using an alternative ADO.NET library: MySqlConnector. It sends a lot fewer packets when opening the connection (but it may not send the absolute minimum possible).
But in that time, the MySqlConnection.Open Method was taken a long time for connection to server.(It was about 7~10 second.) … Is this problem caused by MySql.Data.Client 8.0.11?
This sounds very much like MySQL bug 80030, which is a bug in 8.0.11. That case says it's going to be fixed in 8.0.13, not 8.0.12, but perhaps Oracle changed their release plans after making that comment.
This could also be fixed by using MySqlConnector, which never used an inefficient WMI query that was causing the performance problem in MySql.Data.
I've seen loads post on this forum about exchange API, but I've never found something like I have.
I' m trying to connect to Exchange using Exchange API in order to get all room's meetings.
My problem : Sometimes, it's working, I can connect and get all my informations. And 5m later, impossible to connect. I got Unauthorized.
It's not an error on code because it's working, I think it's a problem with exchange server, but I really don't know what it is...
On the next picture, there are traces.
On the left, when it's working, And the same 30m later (same identification, same room) which is not working.
http://hpics.li/2d9b216
If you have any ideas ? I really don't know what to do.
thanks (and sorry for my english !)
I notice that the working request comes from server A (look at the value of X-FEServer header), and the failing one comes from server B. Perhaps there is a configuration problem on server B.
thx for this.
I've done some tests : I've modified my host file in my computer. when the url is pointing to serveur A, it's working. When it's on the other server, not working. It's the same configuration on both, cannot find what's wrong. So I will conserve my actual host file (pointing always on serveur A).
I had an XMLDocument loading a document from a server with no problems till, almost randomly, I started getting a connection refused error.
It also doesn't matter what host I put in, whether it's a legit one or unresolvable. It always gives the same result.
Here's the code:
XmlDocument doc = new XmlDocument();
doc.Load("http://doesnotmatterifIresolveornot.com");
And here is the error:
{"No connection could be made because the target machine actively refused it 127.0.0.1:8888"}
I've turned off any applicable firewalls I can find in Win7, but it's weird cause it happened while I was testing it.
Find out why it's trying to go to 127.0.0.1:8888.
My guess is that for some reason, it thinks that's your HTTP proxy. Did you run something like Fiddler recently? Fiddler runs on 8888 and changes your default proxy settings - maybe they got stuck incorrectly?
Look in Control Panel, or in the Internet Explorer settings.
Are you serving your XML document using IIS? If so, you may need to add a mime-type definition to IIS to serve XML files. This article should help with that (if it is indeed the problem).
you may also try the HTTP loader to get a more detailed picture of what the server is responding with (HTTP headers, in particular, could be useful for troubleshooting).
I suspect the primary issue is that you're trying to connect to a socket (server + port) that the server isn't configured to listen on -- that means you'll get this error regardless of whether or not the URL resolves, since the server isn't configured to deal with a socket connection of the sort you're sending it.
I have a WCF client (running on Win7) pointing to a WebSphere service.
All is good from a test harness (a little test fixture outside my web app) but when my calls to the service originate from my web project one of the calls (and only that one) is extremely slow to deserialize (it takes minutes VS seconds) and not just the first time.
I can see from fiddler that the response comes back quickly but then the WCF client hangs on the response itself for more than a minute before the next line of code is hit by the debugger, almost if the client was having trouble deserializing. This happens only if in the response I have a given pdf string (the operation generates a pdf), base64 encoded chunked. If for example the service raises a fault (thus the pdf string is not there) then the response is deserialized immediately.
Again, If I send the exact same envelope through Soap-UI or from outside the web project all is good.
I am at loss - What should I be looking for and is there some config setting that might do the trick?
Any help appreciated!
EDIT:
I coded a stub against the same service contract. Using the exact same basicHttpBinding and returning the exact same pdf string there is no delay registered. I think this rules out the string and the binding as a possible cause. What's left?
Changing transferMode="Buffered" into transferMode="Streamed" on the binding did the trick!
So the payload was apparently being chunked in small bits the size of the buffer.
I thought the same could have been achieved by increasing the buffersize (maxBufferSize="1000000") but I had that in place already and it did not help.
I have had this bite me many times. Check in your WCF client configuration that you are not trying to use the windows web proxy, that step to check on the proxy (even if there is not one configured) will eat up a lot of time during your connection.
If the tips of the other users don't help, you might want to Enable WCF Tracing and open it in the Service Trace Viewer. The information is detailed, but it has enabled me to fix a number of hard-to-identity problems in the past.
More information on WCF Tracing can be found on MSDN.
Two thing you can try:
Adjust the readerQoutas settings for your client. See http://msdn.microsoft.com/en-us/library/ms731325.aspx
Disable "Just My Code" in debugging options. Tools -> Options -> Debugging -> General "Enable Just My Code (Managed only)" and see if you can catch interal WCF exceptions.
//huusom
I had the very same issue... The problem of WCF, IMO, is in the deserialization of the base64 string returned by the service into a byte[] client side.
The easiest to solve this if you may not change your service configuration (Ex.: use a transferMode="Streamed") is to adapt your DataContract/ServiceContract client side. Replace the type "byte[]" with "string" in the Response DataContract.
Next simply decode the returned string yourself with a piece of code such as:
byte[] file = Convert.FromBase64String(pdfBase64String);
To download a PDF of 70KB, it used to required ~6 sec. With the suggested change here above, it takes now < 1 sec.
V.
PS.: Regarding the transfer mode, I did try to only change the client side (transferMode="StreamedResponse") but without improvement...
First things to check:
Is the config the same in the web project and the test project?
When you test from SOAP UI are you doing it from the same server and in the same security context as when the code is running from the web project.
-Is there any spike in the memory when the pdf comes back?
Edit
From your comments the 1 min wait, appears that it is waiting for a timeout. You also mention transactions.
I am wondering if the problem is somewhere else. The call to the WCF service goes OK, but the call is inside a transaction, and there is no complete or dispose on the transaction (I am guessing here), then the transaction / code will hang for 1 min while it waits to timeout.
Edit 2
Next things to check:
Is there any difference in the code is the test and in the web project, on how the service is being called.
Is there any differnce in the framework version, for example is one 3.0 and the other 3.5
Can it be that client side is trying to analyse what type of content is coming from server side? Try to specify mime type of the service response explicitly on the server side, e.g. Response.ContentType = "application/pdf" EDIT: By client side I mean any possible mediator like a firewall or a security suite.