Hi!
I’ve beeen trying to use the HTTP Monitor with some REST Mock Services and had some trouble.
I’m currently using SoapUI 5.1.3.
When I send a request to the service, I usually get te expected response and everything’s fine. However, when I set up the HTTP Monitor and get it running, I receive a 500 — INTERNAL SERVER ERROR and the following stack trace is printed:
java.lang.NullPointerException
at com.eviware.soapui.impl.wsdl.submit.AbstractMessageExchange.<init>(AbstractMessageExchange.java:33)
at com.eviware.soapui.impl.wsdl.submit.AbstractWsdlMessageExchange.<init>(AbstractWsdlMessageExchange.java:36)
at com.eviware.soapui.impl.wsdl.monitor.WsdlMonitorMessageExchange.<init>(WsdlMonitorMessageExchange.java:28)
at com.eviware.soapui.impl.wsdl.monitor.JProxyServletWsdlMonitorMessageExchange.<init>(JProxyServletWsdlMonitorMessageExchange.java:81)
at com.eviware.soapui.impl.wsdl.monitor.jettyproxy.ProxyServlet.service(ProxyServlet.java:143)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:401)
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:766)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
at org.mortbay.jetty.Server.handle(Server.java:326)
at com.eviware.soapui.impl.wsdl.monitor.jettyproxy.JettyServer.handle(JettyServer.java:76)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:945)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:756)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:218)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
at org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:228)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
After going over some of the source code, I finally found what I think is the problem in the class JProxyServletWsdlMonitorMessageExchange.
It looks like in line 81, super() is called with null as an argument. When finally this super call ends up calling the constructor in AbstractMessageExchange, the modelItem is null and at line 33 the call of a get method throws a NullPointerException.
I hope this bug can be fixed soon.
hello i try the soapui and this is the raw response
HTTP/1.1 500 Internal Server Error Server: Apache X-SERVED-BY: l73c001 X-CORRELATION-ID: 1518882632_029_70_l73c001_VDP_ARM X-Cnection: close x-response-time: 9ms v-c-correlation-id: 89d3cecb-0f1a-4aab-adf8-37fa9ea1d605 X-APP-STATUS: 500 X-Frame-Options: SAMEORIGIN X-XSS-Protection: 1; mode=block X-Content-Type-Options: nosniff Strict-Transport-Security: max-age=2592000;includeSubdomains Cache-Control: no-cache, no-store, must-revalidate Pragma: no-cache Expires: -1 Content-Security-Policy-Report-Only: default-src 'self' https://*.v.me https://*.visa.com;script-src 'self' 'unsafe-inline' 'unsafe-eval' https://*.visa.com https://*.v.me;img-src 'self' https://*.v.me https://*.visa.com https://*.unica.com https://ad.doubleclick.net;style-src 'self' 'unsafe-inline' https://*.visa.com;object-src https://*.v.me https://*.visa.com data:;report-uri /logging/logCSPReport; X-Content-Security-Policy-Report-Only: default-src 'self' https://*.v.me https://*.visa.com;script-src 'self' 'unsafe-inline' 'unsafe-eval' https://*.visa.com https://*.v.me;img-src 'self' https://*.v.me https://*.visa.com https://*.unica.com https://ad.doubleclick.net;style-src 'self' 'unsafe-inline' https://*.visa.com;object-src https://*.v.me https://*.visa.com data:;report-uri /logging/logCSPReport; X-WebKit-CSP-Report-Only: default-src 'self' https://*.v.me https://*.visa.com;script-src 'self' 'unsafe-inline' 'unsafe-eval' https://*.visa.com https://*.v.me;img-src 'self' https://*.v.me https://*.visa.com https://*.unica.com https://ad.doubleclick.net;style-src 'self' 'unsafe-inline' https://*.visa.com;object-src https://*.v.me https://*.visa.com data:;report-uri /logging/logCSPReport; Content-Type: application/json;charset=UTF-8 Content-Language: en-US Content-Length: 167 X-Cnection: close X-Cnection: close Date: Sat, 17 Feb 2018 15:50:32 GMT Connection: close {"ID":null,"status":"500","statusInformation":{"reason":"SYSTEM_ERROR","message":"Request failed due to unknown system error."},"submitTimeUTC":"2018-02-17T03:50:32Z"}
the same problem on soapui
this is the request
POST https://sandbox.api.visa.com/cybersource/v2/payments?apikey=6MOLF2TPL0SXGZMPSAKM21LceJzc0zMlOmGA8kaQhowdxH7po HTTP/1.1 Accept-Encoding: gzip,deflate Content-Type: application/json x-pay-token: xv2:1518882483:d8ac075b47e1e27553c1e81e8167d8cb80910e1c07c9778876428623cbb27c4d Content-Length: 0 Host: sandbox.api.visa.com Connection: Keep-Alive User-Agent: Apache-HttpClient/4.5.2 (Java/1.8.0_144)
it say 500: internal server error, thats means is visa server problem?
P/S: when i make the helloworld request i have a correct response
P/S2: the request body is empty
Hi,
Can you enable full logging on your API call and download the HTTP request log file?
Remove sensitive data and if possible, share with us. It will make it easier for us to help you.
How to enable logging:
- Go to the Service Center management console of your OutSystems environment;
- Go to Factory section and open your application;
- Open the module containing your REST API;
- Select the Integrations tab and click on the REST API name to edit it;
- Set the Logging Level to the value you want;
- Click Apply.
Greetings,
Niels F.
Thank you for all reply.
I have added detail.
Hello Ahmet,
Does the web service uses authentication? Like Basic Authentication?
When you expose a rest with basic authentication in OutSystems, the message returned on failed authentication is a 500…
Cheers.
Hello Eduardo,
I have no Authentication at now.
Hello,
You didn’t SET basic authentication. But if the web service requires it, you need to provide it.
This rest is being exposed aldo by an OutSystems application? The method that works is in the same web service?
Are you sure you are passing valid values to the input parameter?
Cheers
Hello,
I wrote a web services using with c# web api. This web services no need to authentication at now. I am calling this web services from outsystem platform. This web api services connect to sap system. So i am using sap .Net connector on web api. There are lots import and export parameters in SAP.
Probably passing invalid values to the input parameters. Sap systems has a TABLES. This tables can import and export. Every tables has more than 100 columns.
it is not easy to check.
Thank you
Hi Ahmet,
If you wrote the REST service you are calling, then it’s your own REST service that produces the 500 and returns this:
So this is not an OutSystems problem, but a problem in your C# code.
That said, may I enquire why you are connecting to SAP through C# code, instead of via OutSystems directly?
Hi Kilian,
When i debug my code on visual studio or When I call web services with url on postman or soap ui. I have no error both.I wrote more than 20 service in this services. There is no wrong except ones.
We have a plans that we will call these services from the other applications in the future. Not only outsystems platform.
I will concantrate parameters.
Regards
When i testing . It works. i can get answers.
Hi Ahmet,
Can’t you debug the C# code while you are calling from OS? That allows you to see what’s going on. Also, as you can see from the debug trace, the only thing you send is a language code:
EDIT: You Ninja’d me with your last post. In there, you send much more than just the language. So you are not passing the right input when calling it from your code. Also, perhaps you can change your C# code so that it sends better error messages than «an error has occured» :).
Hello,
i will ask questions. I consume rest api (i have added attachment as jsonTest.txt).
You can give attention ZERO_DISABLE field
I have added pictures
ORDER_CONDITION_EX has no ZERO_DISABLE field but program created automatically.
Hi Ahmet,
When consuming a REST API, Service Studio sometimes merges overlapping JSON structures. E.g. when you have something like this:
{ "item":"string", "name":"string" }
Service Studio will create a Structure with two Text Attributes named «Item» and «Name». When it encounters another JSON definition like this:
{ "item":"string", "description":"string" }
it might well merge the two, and add a «Description» Attribute to the Structure already containing «Item» and «Name». This is pretty annoying sometimes, but that’s what SS does, so you should be aware of it.
Hi Ahmet.
I had the same problem. I got the token and in the second API call, I started receiving the «500 internal server error» one morning. In my case I think was a thing of connection:
I deformed the token and then receive the «401 Unauthorized error». I just corrected the token again and all was solved. As I say, in my case I think was a thing of connection on the server-side.
Regards!