1

I have a project in SoapUI and my request works there and I get the expected response. In my Java (Axis2) code I'm sending a request, however this time I get this error

java.net.SocketTimeoutException: Read timed out.

The strange thing is I can copy the output from my Java code (Which I am sending and doesn't work) into soapUI and it works.

I've looked into things like upping the timeout, setting some different properties and looked for differences between the setup of soapUI and my Java code but I can't seem to find anything

Does anyone have any ideas on what could be causing this issue? I know it's very general but any help is greatly appreciated, thanks.

Jordan
  • 35
  • 10

1 Answers1

0

There may be a proxy problem.

You can use the following properties to use it in your java application :

systemProp.http.proxyPort
systemProp.http.proxyUser
systemProp.http.proxyPassword
systemProp.http.proxyHost
Ludo
  • 333
  • 3
  • 15
  • Hi Ludo, Thanks for that. I've just looked into SoapUI to see the proxy settings that was using but it doesn't seem to use any. Do you know of a way to find what proxy settings SoapUI is using, so I can just copy from that and see if I can progress? – Jordan May 19 '17 at 08:46
  • OK, so maybe you don't need proxy settings... Are you sure to contact the right endpoint in Axis ? – Ludo May 19 '17 at 08:52
  • Yeah, I think anyway. Would I be able to copy the request from my logs into soapUI and successfully get a response if the endpoint wasn't correctly set? – Jordan May 19 '17 at 08:55
  • In soapui, you set the endpoint in a selectBar on the top. I don't think that information appears int the xml request. Do you see it in yours ? Where is your endpoint is set ? In your WSDL ? – Ludo May 19 '17 at 09:15
  • I thought I could set the endpoint in Java by using _operationClient.getOptions().setProperty(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, "endpoint"); – Jordan May 19 '17 at 09:31
  • Oh, I also did try _operationClient.getOptions().setProperty(MessageContextConstants.TRANSPORT_URL, "endpoint"); This seemed to change where the request was being sent, however, this code is deprecated now. – Jordan May 19 '17 at 09:32
  • Of course you can ! Having it in the WSDL is another way... The Timeout means that your server cannot havec any response of your service. If the request is OK with Soapui, I'd like to say it's a configuration problem... Don't you have any firewall ? What's the server you're running on ? – Ludo May 19 '17 at 09:40
  • Well at the moment it's from my local machine which is osx. I just had a chat with someone about the firewalls and they say that nothing should be blocking it. It is very odd though, with it working in one application and the not another, the only difference must be the config, as you've said. – Jordan May 19 '17 at 10:46
  • You confirm that the endpoint used in saopui is exactly the same as in your java code ? same URI, same PORT ? Wich java server do you use ? Tomcat ? (I don't know if there is a specific one on MacOS) – Ludo May 19 '17 at 12:41
  • Ah, yeah, tomcat is being use. As far as the endpoint yes it's the same. I've had a look into soapUI and what port that uses, I can't find what port it's using but I used google to figure out the defaults and attempted to post to that. Still the same result – Jordan May 19 '17 at 13:06