I am trying to use Ignite to store the table in cache using C++. We are using REST API for requesting the data. I have configured the xml like this
<property name="connectorConfiguration">
<bean class="org.apache.ignite.configuration.ConnectorConfiguration">
<property name="host" value="localhost"/>
<property name="port" value="8085"/>
</bean>
</property>
And send a request using curl
curl -X POST http://localhost:8085/ignite?cmd=version
But the response i got like this curl: (52) Empty reply from server .How can i cache the data using REST POST request?
ConnectorConfiguration.port is not responsible for REST API port. You can specify it using JETTY_REST_PORT JVM parameter:
$ JVM_OPTS='-DIGNITE_JETTY_PORT=8085' ignite.sh
It can also be changed in Jetty configuration. Path to Jetty configuration file can be specified using ConnectorConfiguration.jettyPath property.
Related
Using wso2am-2.6.0 we have a backend (external) service, which requires Content-Length header (doesn't support chuking)
Chunking can be easily disabled in a custom request handler
<property name="DISABLE_CHUNKING" value="true" scope="axis2" />
<property name="FORCE_HTTP_1.0" value="true" scope="axis2" />
However - post form parameters are optional and there are cases when no parameters are posted.
When sending a POST request (Content-Type: application/x-www-form-urlencoded) with no parameters (Content-Length: 0), then no request is made to the backend service and the request times out.
Actually - checking with the tcpmon tool - the wso2am creates a tcp connection to the backend edpoint, but no data are sent at all.
If the request contains any parameter/data, all seems to work well. If we use chunking transport, the APIM itself works well, but the backend service requires the Content-Length header.
I tried to update the axis message formatter and builder
<messageFormatter contentType="application/x-www-form-urlencoded"
class="org.wso2.carbon.relay.ExpandingMessageFormatter"/>
...
<messageBuilder contentType="application/x-www-form-urlencoded"
class="org.wso2.carbon.relay.BinaryRelayBuilder"/>
but that had no effect either
I need to make proxy service in wso2 esb, that would be redirect requests to external wsdl service with pre send auth request to separate operation.
I make sequence like this:
clone
payloadFactory (auth xml request)
call (auth operation)
property (value=get-property('transport', 'Set-Cookie'), name=ExtCookie scope=operation)
property (value=get-property('operation', 'ExtCookie') name=Cookie)
Send (target operation)
When I make first call to this proxy service - It's work fine. But on second call I see in tcpdump that there is Cookie HTTP Header in the clone request.
I try add "property remove" with different scope(transport, operation, Synapse, default, axis2, axis2-client), but no one work. Cookie-Header wasn't removed. I need remove it for correct work with ext service.
Try with the following properties.
<property name="EXCESS_TRANSPORT_HEADERS" scope="axis2" action="remove"/>
<property name="Set-Cookie" scope="transport" action="remove"/>
I am relatively new to SOAP web services, and it seems to be a basic thing, but still, I cannot find the way so solve it. I have a SOAP server written using Spring WS with XWS security. These are the relevant beans:
<bean id="wsSecurityInterceptor" class="org.springframework.ws.soap.security.xwss.XwsSecurityInterceptor">
<property name="policyConfiguration"
value="classpath:security-policy.xml"/>
<property name="callbackHandlers">
<list>
<ref bean="passwordValidationHandler"/>
</list>
</property>
</bean>
<bean id="passwordValidationHandler" class="org.springframework.ws.soap.security.xwss.callback.SimplePasswordValidationCallbackHandler">
<property name="users">
<props>
<prop key="user">*****</prop>
</props>
</property>
</bean>
And the following is security-policy.xml:
<xwss:SecurityConfiguration xmlns:xwss="http://java.sun.com/xml/ns/xwss/config">
<xwss:RequireUsernameToken passwordDigestRequired="true" nonceRequired="true"/>
<xwss:UsernameToken digestPassword="true" useNonce="true"/>
</xwss:SecurityConfiguration>
The thing is that I want to extablish a digest authentication using nonce (a one-time token that prevents an intercepted request from being sent again). As far as I know (and it is described here http://www.whitemesa.com/soapauth.html#S4), the server should create a challenge (nonce and timestamp, I think) and then the client should encrypt it with its password and timestamp and send it back to the server for verification. And this it should work for every request. Even if the user sends an empty request, the server should provide a challenge. But in my case it does not work. Am I missing something?
As it turned up, it is not necessarily the server who should generate nonce. I generated it on client, concatenated and hashed it according to the rules and then sent to the server. Frankly speaking, I could only find the root of error by debugging Spring WS sources and looking for where exactly an authentication problem is.
I am using WSO2 ESB 4.0.3 with Java 6 on MAC OSX 10.7.4. I have also installed Data Services Features.
In the typical scenario I have one proxy service which the client calls and I pass one the request to Data Service. Now if I have FAULT message from the Data service back to proxy how do I check in proxy service whether the response from Data Service is Fault or normal valid response?
Currently I am using following filter mediator logic in outsequence of proxy service
<filter xpath="get-property('FAULT')">
<then>
<log category="ERROR" level="custom" separator=",">
<property name="OWCHECK-faultMessage" value="TQS_OWCHECK - Received Fault From OWCHECK Data Service !!!!"/>
<property expression="$body" name="Fault-I-Got-Is"/>
<property name="OWCHECK-Forwading-Error" value="TQS_OWCHECK - Forwarding the Fault to Error Handler !!!!"/>
</log>
<else>
<xslt key="conf:/tqs/owcheck/proxy-output-transform.xslt"/>
<log category="INFO" level="custom" separator=",">
<property name="ValidResponse" value="TQS_OWCHECK - Sending Valid Response Back."/>
</log>
<send/>
</else>
</filter>
But this logic of checking the "FAULT" property works when axis2 has NIO senders & receivers in axis2.xml.
How ever if I switch the receivers & senders in axis2.xml from NIO to standard servlet one's (org.wso2.carbon.core.transports.http.HttpTransportListener / org.wso2.carbon.core.transports.http.HttpTransportListener) I do not get the "FAULT" property set and my error handling does not work.
Is there a standard way of checking if the response from one proxy service to another or response from data service to proxy is FAULT or not? I am looking for something which is independent of transport senders and receivers, at least HTTP ones.
Please help.
thanks
Abhijit
It is not good documentation I believe where none of the samples talk about how to handle the faults from Data service to Proxy service or am I missing something?
I would be thankful if I know the best practices to handle the errors from Data service as well as from one proxy to another proxy service.
Please help. This is big project at very prestigious company.
I think you need to check whether the soap body element has a soap:fault message or not. you can use the filter mediator with some xpath expression to check that.
I am using this bean code to log request and response to the log file
<bean
class="org.springframework.ws.soap.server.endpoint.interceptor.SoapEnvelopeLoggingInterceptor">
<property name="logRequest" value="true" />
<property name="logResponse" value="true" />
</bean>
This works fine in the TOMCAT Application Server for logging SOAP Request and SOAP Response as it enters and leaves the #EndPoint class but not in the case of WebSphere Application Server V8.0. Is there any other method to put SOAP Request and SOAP response to the log file in SPRING-WS.
There is other way. See the documentation.
Anyway, why SoapEnvelopeLoggingInterceptor is not working with WebSphere? I have not experience with WebSphere but it could happen that your log configuration is being overwritten by the server one. Take a look to the server log configuration.