"Error getting session" in websphere but working fine in jboss - web-services

I am calling a RestfulWebservice present in Websphere server from a javascript or browser by adding Authorization in the request header but getting "Error getting session". After digging into the code I found that Authorization header values are getting extracted from the header and it is showing error while connecting to a URL. This URL contains a call to another Rest webservice in the same server and is confirmed to be correct. The app is working only when it is already logged in that server from another tab and calling the webservice.
Now, this app is working as expected when a Jboss server is used.
My question is - Is there any settings in the websphere server which can resolve this issue?

The issue is resolved. I have an AuthenticationFilter to call first and I was passing wrong parameter in the request header. After passing correct parameter in the request header which is verified by AuthenticationFilter, I am getting expected result. Thanks.

Related

HTTP Failure , An error occured during URL invocation. ORA-12535: TNS:operation timed out

There is a REST web service that I can successfully call from POSTMAN (just as a side note, I have to include a bearer token for it to work.)
I was doing research on how to call a rest web service from Oracle APEX, and found I can do that by creating a WEB SOURCE MODULE. This is the first screen where I add the URL of the endpoint
However when I click on NEXT, it takes a while before giving me this error:
Again, on POSTMAN I can successfully make the GET request, but I haven't figured out how to do it in Oracle APEX
Note that for Oracle APEX the database is actually doing the HTTP request. A "TNS Timeout" error typically indicates that the database cannot reach the internet.
Did you specify a proxy server for your application (Shared Components > Application Definition Attributes > Proxy Server)?

org.apache.cxf.interceptor.Fault: Unexpected element / WebSphere-Liberty Migration from WebSphere-7

The code that is working in WebSphere-7 is giving the following error in WebSphere Liberty:
javax.xml.ws.soap.SOAPFaultException: Unexpected element {http://example.com/service/Quoting/v2}SubmitRateScenarioResponse found.
Expected {http://example.com/esb/header/v3}ESBHeader.
at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:156)
Caused by:
org.apache.cxf.interceptor.Fault: Unexpected element {http://example.com/service/Quoting/v2}SubmitRateScenarioResponse found.
Expected {http://example.com/esb/header/v3}ESBHeader.
at org.apache.cxf.interceptor.DocLiteralInInterceptor.validatePart(DocLiteralInInterceptor.java:275)
Any help is appreciated.
So, the problem seems to be that the SOAP Message received by the Service contains unexpected content. The client is building a SOAP Message that is violating the contract between the Service and Client. Sorry, I can't give you a better answer without more information.
Understanding what the Service is expecting compared to what the client is sending is key, and finding that would be possible with some more work. To start, I would compare what the Soap Message looks like when sent by the client on v7 to what the client is sending on Liberty by using a tool like tcpmon or fiddler to capture the message.
Were both the client and service migrated to Liberty from WebSphere V7? If you migrated the Service, was it migrated as a binary or rebuilt from a WSDL? If it was rebuilt, comparing the original WSDL from v7 to the rebuilt WSDL might tell you something about how the Service's expectations have changed.
Go through below url . may be you will find your solution
i was getting same error when i tried to hit rest api using postman client .
http://camel.465427.n5.nabble.com/i-am-getting-exception-org-apache-cxf-interceptor-Fault-org-apache-camel-CamelContext-td5742012.html#a5742016
Root cause is - camel-core jar is missed . put jar file on server->lib or apache/lib

Postman rest client is giving 404 error every time in response

When I am running same url("http://localhost:4047/webServicesDemo/webapi/injectdemo/context") in tomcat configured in eclipse it it working fine. While getting 404 error every time in postman rest client.
Please put some light on it.
Thanks.enter image description here
Sometimes Apache does not work with other ports. You need to set the port of your google chrome in httpconfig file of Apache Server.

SoapUI 4.6.4 error: Server returned HTTP response code: 401 for URL

I am trying to add a New SOAP Project in SoapUI 4.6.4. When I create a new soap project and type the Initial WSDL url: http://xx.xxx.x.xxx/Structure/DataEx?wsdl, I get the following error.
Error loading [http://xx.xxx.x.xxx/Structure/DataEx?wsdl]:
org.apache.xmlbeans.XmlException: java.io.IOException: Server returned
HTTP response code: 401 for URL:
http://xx.xxx.x.xxx/Structure/DataEx?wsdl
When I access the URL via a browser, it prompts me to enter username and password. After I enter that information, I am able to access the WSDL. I looked at the request header and the authorization of type Digest.
My question is, where in SoapUI 4.6.4 do I get to enter the authentication/authorization information so that I can get the WSDL into SoapUI.
This was a bug in the 4.6.4 version but was solved in the maintenance build which is available # http://www.soapui.org/Downloads/soapui-pro-nightly-builds.html
This information is available on soapUI form where a user asked the same question.
Additionally, to handle authentication in your subsequent service requests you should check out soapUI's guide on the same.

Web service returns error “The remote server returned an unexpected response: (400) Bad Request”

I am calling Web Service in my windows application(Web service is in same project). It works fine when I use it with test database, but when I change database schema to QA in web Service. It gives me error " “The remote server returned an unexpected response: (400) Bad Request”
The web service is same but still gets error when I change schema.This is Web Service, not WCF service and I am using VS2010. I am not understanding what is happening wrong here. Any help would be greatly appreciated. Thanks.
There is error in paramters you supply to webpage (webservice) of website. Check what you supply in headers of your request object.
Actually, one of the values in the DTO which was passed to webmethod was having some bad data(say, memberid="H00001\0\0\0\0"). I corrected this value and assigned to DTO before passing to webmehtod. And it worked fine. Thanks kostas ch. and Salahuddin for your help!