IBM Websphere Datapower Xi52 - ibm-datapower

I really appreciate your response to my following question.
Is there any way I can send SOMA request against xml-mgmt interface to see/check the probe status on different domian? if there are turned on/off?
Thanks

Yes, the "show domain" command shows status of all domains probes.
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:dp="http://www.datapower.com/schemas/management">
<env:Body>
<dp:request domain="default">
<dp:get-status class="DomainStatus" /></dp:request>
</env:Body>
</env:Envelope>
You can then parse the respons as XML and get status from XPath:
//*[local-name()='DomainStatus']/*[local-name()='Domain'][text()='test-domain']/following-sibling::*[local-name()='ProbeEnabled']/text()

Related

Sabre: GetReservation equivalent to TravelItineraryRead

I'm implementing GetReservation because TravelItineraryRead will soon be deprecated.
When creating a PNR, I get successful responses of GetReservation, but when I try to query the previously created PNR, Sabre WS rejects with "Viewership is restricted for the PNR, caused by [Viewership is restricted for the PNR (Unsupported security check), code: 700102, severity: MODERATE"
I'm connecting to Sabre WS via SOAP, in test endpoint https://sws-tls.cert.sabre.com.
The RQ I'm sending is:
<GetReservationRQ xmlns="http://webservices.sabre.com/pnrbuilder/v1_19" Version="1.19.0">
<Locator>XWYZA</Locator>
<RequestType>Stateless</RequestType>
<ReturnOptions PriceQuoteServiceVersion="3.2.0">
<SubjectAreas>
<SubjectArea>FULL</SubjectArea>
</SubjectAreas>
<ViewName>Full</ViewName>
<ResponseFormat>STL</ResponseFormat>
</ReturnOptions>
</GetReservationRQ>
I've tried with others Views and SubjectAreas, but I always get that response, what am I doing wrong?
The problem was that I needed to send RequestType: Stateful instead of Stateless
<GetReservationRQ xmlns="http://webservices.sabre.com/pnrbuilder/v1_19" Version="1.19.0">
<Locator>KDQPNP</Locator>
<RequestType>Stateful</RequestType>
<ReturnOptions PriceQuoteServiceVersion="3.2.0">
<SubjectAreas>
<SubjectArea>FULL</SubjectArea>
<SubjectArea>PRICE_QUOTE</SubjectArea>
</SubjectAreas>
<ViewName>Full</ViewName>
<ResponseFormat>STL</ResponseFormat>
</ReturnOptions>
</GetReservationRQ>

Quectel M66 unable to input the data for HTTP POST

Quectell M66 doesn't let me input the data which I need to send to a LAMP Web Server through HTTP POST method. After entering the AT+QHTTPPOST=10,50 command Quectell outputs: CNNECT and it doesn't let me input the data at all and after sometime gives +CME ERROR:3825 which is timeout error. My codes are:
AT+CGATT=1
AT+QIFGCNT=0
AT+QICSGP=1,"bsnlnet"
AT+QIREGAPP
AT+QIACT
AT+QILOCIP
AT+QHTTPURL=66,30
my_66byte_long_URL
AT+QHTTPPOST=10,50
AT+QIDEACT
Recently, I had found the answer to my own problem and I am posting it here so that it could be of help to others.
enter link description here

Not able to send data on reply channel using tcp-outbound-gateway with ActiveMQ

My Requirement is to get data from TCP, after getting the data from TCP convert into java object and send on ActiveMQ. Post that after doing some processing need to send the acknowledgement/response code on same channel on TCP.
To fulfill this requirement I am using tcp-outbound-gateway as bidirectional communication is required.
Problem is I am not able to send acknowledgement with ActiveMQ. If I comment out ActiveMQ part and write a dummy string on replyChannel it is visible, but the moment I send the object on Active MQ queue it is giving me a message "null reply received for nothing to send".
I am using a new queue to get the acknowledgement and trying to put the response on reply channel of tcp-outbound-gate, but error message is no output-channel or replyChannel header available.
I got the MessageHeaders details via Incoming message and sending it via queue to use copyHeader. I am able to set the headers and see paylod in Message object, verified the same by applying Interceptos on reply channel, but still getting the same error no output-channel or replyChannel header available.
Code is :
<int:gateway id="gw" default-reply-channel="replyChannel" default-reply-timeout="10000" service-interface= "com.telnet.core.integration.connection.ParseTcpConfiguration$SimpleGateway"
default-request-channel="${server.inboundChannel}"/>
<int:channel id="telnetLandingChannel" />
<ip:tcp-connection-factory id="serverFactory" type="server" host="${server.host}" port="${server.port}" single-use="false"
serializer="${server.serializer}" deserializer="${server.serializer}" task-executor="serverFactoryTaskExecutor"/>
<ip:tcp-inbound-gateway id="serverInboundAdpater" request-channel="telnetLandingChannel" reply-channel="replyChannel"
connection-factory="serverFactory" error-channel="errorChannel" reply-timeout="1000000" auto-startup="false"/>
<int:channel id="replyChannel"></int:channel>
<beans:bean id="acknowledgementHandler" class= "com.telnet.core.integration.AcknowledgementHandler">
</beans:bean>
<int:channel id="incidentDispatchMessageChannel" datatype="${incident.interaction.dispatch.response.datatype}"></int:channel>
<int-jms:message-driven-channel-adapter id="incidentDispatchMessageChannelAdapter" error-channel="errorChannel"
connection-factory="mqConnectionFactory"
destination-name="${incident.processing.tcp.dispatch.response.queues}"
channel="incidentDispatchMessageChannel"/>
<int:transformer id="incidentMessageActivator"
input-channel="incidentDispatchMessageChannel"
output-channel="replyChannel"
ref="acknowledgementHandler" method="incidentAck">
</int:transformer>
public Message incidentAck(final DefaultIncidentAcknowledgeMessage defaultIncidentAcknowledgeMessage){
MessageHeaders ms = (MessageHeaders)defaultIncidentAcknowledgeMessage.getProperties().get("MessageHeader");
Message<String> message = MessageBuilder.withPayload("1").copyHeaders(ms).build();
return message;
}
Need to see your Integration configuration though, but let me guess that you are loosing TemporaryReplyChannel object in the replyChannel header because it isn't Serializable. Consider to use:
<int:header-enricher>
<int:header-channels-to-string/>
</int:header-enricher>
somewhere before sending to the ActveMQ.
See Reference Manual for more information.
UPDATE
Looks like this is a continuation of Receive the acknowledgement from TCP server to our application using spring Integration. And I see you still use the same replyChannel for many places. That isn't going to work properly. The replyChannel header from the gateway can accept only one reply. Even if we figure out what to do with the reply from ActiveMQ, the TemporaryReplyChannel will be fulfilled with the reply from the TCP Outbound Gateway.
If I understand you correctly, alongside with the reply from the TCP you need also get some message from ActiveMQ. And send everything as a reply to the gateway call. For this purpose I suggest you to consider to use Aggregator and figure out some custom correlation strategy to match the reply from TCP to that acknowledge from the ActiveMQ. After aggregation you really can just use the existing replyChannel header to reply to the gateway.

My Samsung TV won't respond to some UPNP XML requests to describe its service

I've been reading this UPNP PDF and it says that when a device enters the network, it sends a SSDP message with its LOCATION, which is an address that will describe its services. When I turn my Samsung Smart TV on, I get around 6 or 7 SSDP messages. One of them is the following:
NOTIFY * HTTP/1.1
HOST: 239.255.255.250:1900
CACHE-CONTROL: max-age=1800
LOCATION: http://192.168.1.107:7676/smp_7_
NT: upnp:rootdevice
NTS: ssdp:alive
SERVER: SHP, UPnP/1.0, Samsung UPnP SDK/1.0
USN: uuid:uuid_here::upnp:rootdevice
So when I try to connect to the LOCATION in this SSDP message, I get this:
<?xml version="1.0"?>
<root xmlns='urn:schemas-upnp-org:device-1-0' xmlns:sec='http://www.sec.co.kr/dlna' xmlns:dlna='urn:schemas-dlna-org:device-1-0'>
<specVersion>
<major>1</major>
<minor>0</minor>
</specVersion>
<device>
<deviceType>urn:dial-multiscreen-org:device:dialreceiver:1</deviceType>
<friendlyName>[TV]Samsung LED40</friendlyName>
<manufacturer>Samsung Electronics</manufacturer>
<manufacturerURL>http://www.samsung.com/sec</manufacturerURL>
<modelDescription>Samsung TV NS</modelDescription>
<modelName>UN40HU7000</modelName>
<modelNumber>1.0</modelNumber>
<modelURL>http://www.samsung.com/sec</modelURL>
<serialNumber>serialNumberHere</serialNumber>
<UDN>uuid:uuid_here</UDN>
<sec:deviceID>EXCNHA5ILPT66</sec:deviceID>
<sec:ProductCap>Resolution:1920X1080,Y2014</sec:ProductCap>
<serviceList>
<service>
<serviceType>urn:dial-multiscreen-org:service:dial:1</serviceType>
<serviceId>urn:dial-multiscreen-org:serviceId:dial</serviceId>
<controlURL>/smp_9_</controlURL>
<eventSubURL>/smp_10_</eventSubURL>
<SCPDURL>/smp_8_</SCPDURL>
</service>
</serviceList>
<sec:Capabilities>
<sec:Capability name='samsung:multiscreen:1' port='8001' location='/ms/1.0/'></sec:Capability>
</sec:Capabilities>
</device>
</root>
The UPNP PDF says that I must connect to the controlURL in the service described above, but when i GET http://192.168.1.107/smp_9_ I get no response. It simply does not respond. I though it was something related to the service being not activated at the moment, but for example, this post teaches how to send a SOAP message to the RenderingControl1 service to change the volume. This service should be active when I'm using the TV to watch something. So I tried to respond to the SSDP message related to RenderingControl1:
NOTIFY * HTTP/1.1
HOST: 239.255.255.250:1900
CACHE-CONTROL: max-age=1800
LOCATION: http://192.168.1.107:7676/smp_3_
NT: urn:samsung.com:device:RemoteControlReceiver:1
NTS: ssdp:alive
SERVER: SHP, UPnP/1.0, Samsung UPnP SDK/1.0
USN: uuid:uuid_here::urn:samsung.com:device:RemoteControlReceiver:1
When I GET 192.168.1.107:7676/smp_3_ the response is:
<?xml version="1.0"?>
<root xmlns='urn:schemas-upnp-org:device-1-0' xmlns:sec='http://www.sec.co.kr/dlna' xmlns:dlna='urn:schemas-dlna-org:device-1-0'>
<specVersion>
<major>1</major>
<minor>0</minor>
</specVersion>
<device>
<deviceType>urn:samsung.com:device:RemoteControlReceiver:1</deviceType>
<friendlyName>[TV]Samsung LED40</friendlyName>
<manufacturer>Samsung Electronics</manufacturer>
<manufacturerURL>http://www.samsung.com/sec</manufacturerURL>
<modelDescription>Samsung TV RCR</modelDescription>
<modelName>UN40HU7000</modelName>
<modelNumber>1.0</modelNumber>
<modelURL>http://www.samsung.com/sec</modelURL>
<serialNumber>serialNumberHere</serialNumber>
<UDN>uuid:uuid_here</UDN>
<sec:deviceID>EXCNHA5ILPT66</sec:deviceID>
<sec:ProductCap>Resolution:1920X1080,ImageZoom,ImageRotate,Y2014,ENC</sec:ProductCap>
<serviceList>
<service>
<serviceType>urn:samsung.com:service:MultiScreenService:1</serviceType>
<serviceId>urn:samsung.com:serviceId:MultiScreenService</serviceId>
<controlURL>/smp_5_</controlURL>
<eventSubURL>/smp_6_</eventSubURL>
<SCPDURL>/smp_4_</SCPDURL>
</service>
</serviceList>
<sec:Capabilities>
<sec:Capability name='samsung:multiscreen:1' port='8001' location='/ms/1.0/'></sec:Capability>
</sec:Capabilities>
</device>
</root>
but when I try to GET 192.168.1.107:7676/smp_5_ I also get no response. I also tried to GET 192.168.1.107:7676/smp_3_/smp_5_ because /smp_5_ is a 'subset' of /smp_3_ I get BAD Request, which tells that my TV is ignoring /smp_5_ but explictly tells that /smp_3_/smp_5_ is wrong, so /smp_3_ is quite rigth, but I don['t know what's happening. According to the UPNP PDF,
GET 192.168.1.107:7676/smp_5_ should retrieve the description for the service... How to get the description of the RenderingControl?
According to UPnP Specification,
http://192.168.1.107:7676/smp_7_ from SSDP is called DeviceDescription URL, so you could get XML via HTTP GET
while URLs in
<controlURL>/smp_9_</controlURL>
<eventSubURL>/smp_10_</eventSubURL>
<SCPDURL>/smp_8_</SCPDURL>
http://192.168.1.107:7676/smp_9_ is control URL, you need to do SOAP action with HTTP Post and necessary parameters.
http://192.168.1.107:7676/smp_10_ is event subscription URL, but you need to do SUBSCRIBE with necessary parameters not GET.
http://192.168.1.107:7676/smp_8_ is ServiceDescription URL, you can do GET and get XML file.
More in: http://upnp.org/specs/arch/UPnP-arch-DeviceArchitecture-v1.1.pdf
Give this a shot. Maybe it will prove useful. It is the decompiled source for the Smart View windows application
https://drive.google.com/open?id=0B4rFn8xXaiKsZ3lCNFBpcklDRE0

IBM Worklight adapter using security tests

I'm using Workilight version 6.0 and I'm trying to use a security test with Workilght's adapter.
First of all, I developed a login page and home page where I'll display some informations after the user will be authenticated.
The authentication seems to be OK because I'm getting the user information and session Id which I'll sent in the cookie of the next HTTP adapter using the security test.
The problem is that I'm getting NullPointerException from the specified adapter but when I execute the request with RestClient, I get the response so the WS is OK.
Any body have an idea about how to that ?
PS: my code was working on worklight V5.0 but not with V6.0
I resolved this issue by deleting non useful Security Test like "MobileSecurityTest".
So before testing your adapter make sure that your declaration in the "authenticationConfig.xml" file is well done.
For more information about that, you can visit this URL :
http://public.dhe.ibm.com/software/mobile-solutions/worklight/docs/v600/08_03_Adapter_based_authentication.pdf
In addition, you have to figure out the root response in the adapter response to see first how looks your received data, otherwise you may be will receive a "NullPointerException" as response if you attempt to get for example "response.result" and the attribut "result" doesn't exist.
Hope that help you for future issues like I got.

Resources