Can't get Yahoo Weather XML file - Server Hangups - yahoo-weather-api

I am using yahoo weather for a while now.
Last week I started getting server hangups - I'm using the same link, sometimes It works, sometimes it doesn't.
Does anyone know whether there is an issue with Yahoo servers?
Here is the link I'm using:
Yahoo! Weather for Auckland
This is the XML it returns:
<query xmlns:yahoo="http://www.yahooapis.com/v1/base.rng" yahoo:count="0" yahoo:created="2017-05-16T07:46:48Z" yahoo:lang="en-US">
<diagnostics>
<publiclyCallable>true</publiclyCallable>
<url execution-start-time="1" execution-stop-time="1337" execution-time="1336" http-status-code="502" http-status-message="Server Hangup">
<![CDATA[
http://weather-ydn-yql.media.yahoo.com:4080/v3/public/weather/rss?u=c&w=2348079
]]>
</url>
<user-time>1339</user-time>
<service-time>1336</service-time>
<build-version>2.0.118</build-version>
</diagnostics>
<results/>
</query>
<!-- total: 1339 -->
<!--
prod_bf1_1;paas.yql;queryyahooapiscomproductionbf1;a9411888-2c54-11e7-b972-d4ae52974741

Related

Tally instance running mode

I am using vb.net to connect to Tally Erp9. Using xml requests I am exporting information from tally. But before exporting I would like to know in which mode the connected tally instance is running.
I would like to know if the tally is running in licensed or educational mode.
Is there any xml/TDL request that can be used to get the information?
Is it possible to get information about connected tally running in which mode?
There is no Default Report in Tally that exposes license Info,
So we need to create it using TDL
Using below xml you can get license info and some other info from tally
This xml creates custom object which contains license info
<ENVELOPE>
<HEADER>
<VERSION>1</VERSION>
<TALLYREQUEST>Export</TALLYREQUEST>
<TYPE>Collection</TYPE>
<ID>LicenseInfo</ID>
</HEADER>
<BODY>
<DESC>
<STATICVARIABLES />
<TDL>
<TDLMESSAGE>
<OBJECT NAME="LicenseInfo">
<LOCALFORMULA>IsEducationalMode: $$LicenseInfo:IsEducationalMode</LOCALFORMULA>
<LOCALFORMULA>IsSilver: $$LicenseInfo:IsSilver</LOCALFORMULA>
<LOCALFORMULA>IsGold: $$LicenseInfo:IsGold</LOCALFORMULA>
<LOCALFORMULA>PlanName: If $$LicenseInfo:IsEducationalMode Then "Educational Version" ELSE If $$LicenseInfo:IsSilver Then "Silver" ELSE If $$LicenseInfo:IsGold Then "Gold" else ""</LOCALFORMULA>
<LOCALFORMULA>SerialNumber: $$LicenseInfo:SerialNumber</LOCALFORMULA>
<LOCALFORMULA>AccountId:$$LicenseInfo:AccountID</LOCALFORMULA>
<LOCALFORMULA>IsIndian: $$LicenseInfo:IsIndian</LOCALFORMULA>
<LOCALFORMULA>RemoteSerialNumber: $$LicenseInfo:RemoteSerialNumber</LOCALFORMULA>
<LOCALFORMULA>IsRemoteAccessMode: $$LicenseInfo:IsRemoteAccessMode</LOCALFORMULA>
<LOCALFORMULA>IsLicClientMode: $$LicenseInfo:IsLicClientMode</LOCALFORMULA>
<LOCALFORMULA>AdminMailId:$$LicenseInfo:AdminEmailID</LOCALFORMULA>
<LOCALFORMULA>IsAdmin:$$LicenseInfo:IsAdmin</LOCALFORMULA>
<LOCALFORMULA>ApplicationPath:$$SysInfo:ApplicationPath</LOCALFORMULA>
<LOCALFORMULA>DataPath:##SVCurrentPath</LOCALFORMULA>
<LOCALFORMULA>UserName:$$cmpusername</LOCALFORMULA>
<LOCALFORMULA>UserLevel:$$cmpuserlevel</LOCALFORMULA>
</OBJECT>
<COLLECTION NAME="LicenseInfo">
<OBJECTS>LicenseInfo</OBJECTS>
</COLLECTION>
</TDLMESSAGE>
</TDL>
</DESC>
</BODY>
You can find more xmls here - https://documenter.getpostman.com/view/13855108/TzeRpAMt
you can create a tdl to extract license number. which will determine if tally is running in licensed mode else, it is in educational mode.

Unable to send messages to a MUC room

When I try to send a message to an XMPP MUC Room such as:
<message to="room#conference.chat.example.com" type="groupchat">
<body>TEST</body>
</message>
The message will not be delivered to other participants in the room and I get this response from the server:
<message
xmlns="jabber:client" lang="en" to="karim#chat.example.com/resource" from="room#conference.chat.example.com" type="error">
<error code="503" type="cancel">
<service-unavailable
xmlns="urn:ietf:params:xml:ns:xmpp-stanzas">
</service-unavailable>
<text
xmlns="urn:ietf:params:xml:ns:xmpp-stanzas" lang="en">User session not found
</text>
</error>
<body>TEST</body>
Im using ejabberd Community Server v20.07 installed into Docker using the official image.
The full ejabberd.yml configuration file that Im using can be found here.
The full server log can be found here.
The above error happen with different clients and not only one.
You have configured this, and this is completely wrong:
hosts:
- chat.example.com
- conference.chat.example.com
modules:
mod_muc:
...
I guess you didn't notice the option HOSTS in the MOD_MUC documentation: https://docs.ejabberd.im/admin/configuration/modules/#mod-muc
Try something like this:
hosts:
- chat.example.com
modules:
mod_muc:
hosts:
- conference.#HOST#
...

Openfire server pep based avatars , Android client

I have setup openfire server and my android clients works well with it except that I am unable to publish avatars , the problem is that the server simply ignores the publish avatar iq packet , no errors , nothing in the log files. I am using standard XMPP pep avatar stanza , please hep
Thankyou for your replies everyone, I found that the issue is with openfire server 3.10 which does not parse the standard XEP 0084 stanza well, infact I found the logs and server was crashing so i modified the IQ as , for example this should be the standard IQ for publishing avatar
<iq type='set' from='juliet#capulet.lit/chamber' id='publish1'>
<pubsub xmlns='http://jabber.org/protocol/pubsub'>
<publish node='urn:xmpp:avatar:data'>
<item id='111f4b3c50d7b0df729d299bc6f8e9ef9066971f'>
<data xmlns='urn:xmpp:avatar:data'>
qANQR1DBwU4DX7jmYZnncm...
</data>
</item>
</publish>
</pubsub>
</iq>
but as you can see there is no "to" address in the standard IQ , openfire server would create the pubsub node in DB and crash and would not reply with result asking the user to now publish metadata ,so what i had to do is send this packet and then the standard metadata packet , but then send meta data packet again with a "to" address which would be replied by the server as result that the metadata notification succeded as
standard meta data to be sent to server for the first time ,
<iq type='set' from='juliet#capulet.lit/chamber' id='publish2'>
<pubsub xmlns='http://jabber.org/protocol/pubsub'>
<publish node='urn:xmpp:avatar:metadata'>
<item id='111f4b3c50d7b0df729d299bc6f8e9ef9066971f'>
<metadata xmlns='urn:xmpp:avatar:metadata'>
<info bytes='12345'
id='111f4b3c50d7b0df729d299bc6f8e9ef9066971f'
height='64'
type='image/png'
width='64'/>
</metadata>
</item>
</publish>
</pubsub>
</iq>
and then again like this with addition of "to" address
<iq type='set' from='juliet#capulet.lit/chamber' to="mydomain.com" id='publish2'>
<pubsub xmlns='http://jabber.org/protocol/pubsub'>
<publish node='urn:xmpp:avatar:metadata'>
<item id='111f4b3c50d7b0df729d299bc6f8e9ef9066971f'>
<metadata xmlns='urn:xmpp:avatar:metadata'>
<info bytes='12345'
id='111f4b3c50d7b0df729d299bc6f8e9ef9066971f'
height='64'
type='image/png'
width='64'/>
</metadata>
</item>
</publish>
</pubsub>
</iq>
in the above way avatar publishing is working and Im successfully issuing a notification to other users also
and here is the server crash log incase
2016.03.02 10:41:02 ERROR [socket_c2s-thread-3]: org.jivesoftware.openfire.handler.IQHandler - Internal server error
java.lang.NullPointerException
at org.jivesoftware.openfire.pubsub.PubSubEngine.createNodeHelper(PubSubEngine.java:1165)
at org.jivesoftware.openfire.pubsub.PubSubEngine.publishItemsToNode(PubSubEngine.java:340)
at org.jivesoftware.openfire.pubsub.PubSubEngine.process(PubSubEngine.java:98)
at org.jivesoftware.openfire.pep.PEPServiceManager.process(PEPServiceManager.java:215)
at org.jivesoftware.openfire.pep.IQPEPHandler.handleIQ(IQPEPHandler.java:423)
at org.jivesoftware.openfire.handler.IQHandler.process(IQHandler.java:66)
at org.jivesoftware.openfire.IQRouter.handle(IQRouter.java:372)
at org.jivesoftware.openfire.IQRouter.route(IQRouter.java:115)
at org.jivesoftware.openfire.spi.PacketRouterImpl.route(PacketRouterImpl.java:78)
at org.jivesoftware.openfire.net.StanzaHandler.processIQ(StanzaHandler.java:342)
at org.jivesoftware.openfire.net.ClientStanzaHandler.processIQ(ClientStanzaHandler.java:99)
at org.jivesoftware.openfire.net.StanzaHandler.process(StanzaHandler.java:307)
at org.jivesoftware.openfire.net.StanzaHandler.process(StanzaHandler.java:199)
at org.jivesoftware.openfire.nio.ConnectionHandler.messageReceived(ConnectionHandler.java:181)
at org.apache.mina.core.filterchain.DefaultIoFilterChain$TailFilter.messageReceived(DefaultIoFilterChain.java:690)
at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:417)
at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1200(DefaultIoFilterChain.java:47)
at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:765)
at org.apache.mina.core.filterchain.IoFilterAdapter.messageReceived(IoFilterAdapter.java:109)
at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:417)
at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1200(DefaultIoFilterChain.java:47)
at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:765)
at org.apache.mina.filter.codec.ProtocolCodecFilter$ProtocolDecoderOutputImpl.flush(ProtocolCodecFilter.java:407)
at org.apache.mina.filter.codec.ProtocolCodecFilter.messageReceived(ProtocolCodecFilter.java:236)
at org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:417)
at org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1200(DefaultIoFilterChain.java:47)
at org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:765)
at org.apache.mina.core.filterchain.IoFilterEvent.fire(IoFilterEvent.java:74)
at org.apache.mina.core.session.IoEvent.run(IoEvent.java:63)
at org.apache.mina.filter.executor.OrderedThreadPoolExecutor$Worker.runTask(OrderedThreadPoolExecutor.java:769)
at org.apache.mina.filter.executor.OrderedThreadPoolExecutor$Worker.runTasks(OrderedThreadPoolExecutor.java:761)
at org.apache.mina.filter.executor.OrderedThreadPoolExecutor$Worker.run(OrderedThreadPoolExecutor.java:703)
at java.lang.Thread.run(Unknown Source)

PubSub module returning error

I'm working on getting Jappix running. I'm using ejabberd as my XMPP server and I've got everything working except comments and viewing attachments - group chat, single chat, external authentication, private messages, friend lists, presence and other works as intended.
My configuration is the same as the one the Jappix project provides on their jappix/jappix-tools github repository. I have no errors in my ejabberd log, the only thing I got while debugging and digging everything up is that this is an example stanza sent to the server:
<iq xmlns="jabber:client" type="get" id="get_31-30" to="pubsub.mydomain.com" xml:lang="en">
<pubsub xmlns="http://jabber.org/protocol/pubsub">
<items node="urn:xmpp:microblog:0:comments/3aca5f972fe7198805bdd1a20f502f35"/>
</pubsub>
</iq>
And this is the response I get from the server:
<iq xmlns="jabber:client" from="pubsub.mydomain.com" to="arqu#mydomain.com/jappix (1378149270017)" type="error" id="get_31-30" xml:lang="en" xmlns:xml="http://www.w3.org/XML/1998/namespace">
<pubsub xmlns="http://jabber.org/protocol/pubsub">
<items node="urn:xmpp:microblog:0:comments/3aca5f972fe7198805bdd1a20f502f35"/>
</pubsub>
<error code="503" type="cancel">
<service-unavailable xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/>
</error>
</iq>
And in Jappix I just get the usual "Service Unavailable" error message.
Additional info:
My BOSH is the internal one of ejabberd and works fine as far as i know, I've setup the reverse proxy and everything else to make it work. Still could be something related to this and not reaching the service on some other port maybe?
It looks like you do not have pubsub enabled/installed on your server.
Have you tried any other pubsub request?

Stumped with trying to consume a SOAP API using ColdFusion

I am working with an API that has two different URLs for specific types of functions. The first, is a transactional API that supports either JSON or SOAP requests. I have called all of the functions I need within this API using exclusively JSON calls and everything appears to be working perfectly fine.
The second is a reporting API used to locate and/or download reports. This API works exclusively with SOAP. I have not been able to get any function in this API working properly. I have attempted to contact the company's support group, but they do not have anybody who can assist me with API calls in ColdFusion. I have attempted two different ways to interface with this API and get access to the functions and have come up empty. Below are my examples and as much information as I can provide; our service provider's API and associated documentation are confidental, but I can answer some questions related to specific things that have to do with my code.
Way 1: Creating a webservice object.
The first way I tried to create this SOAP call was through a webservice object. Using the metadata exchange point URL, I passed it into the createObject function like this:
<cfset argStruct = structNew() />
<cfset argStruct['username'] = 'myusername' />
<cfset argStruct['password'] = 'mypassword' />
<cfset testSvc = createObject('webservice','https://brandnameapi.sandbox.serviceprovider.com/vernum/ReportingAPI.svc/mex',argStruct) />
When I run this code, I get the following error message:
Cannot generate stub objects for web service invocation. Name: https://brandnameapi.sandbox.serviceprovider.com/vernum/ReportingAPI.svc/mex. WSDL: https://brandnameapi.sandbox.serviceprovider.com/vernum/ReportingAPI.svc/mex. javax.wsdl.WSDLException: WSDLException (at /wsdl:definitions/wsdl:import): faultCode=OTHER_ERROR: Unable to resolve imported document at 'https://brandnameapi.sandbox.serviceprovider.com/vernum/ReportingAPI.svc/mex?wsdl=wsdl1', relative to 'brandnameapi.sandbox.serviceprovider.com/vernum/ReportingAPI.svc/': java.io.IOException: Server returned HTTP response code: 401 for URL: https://brandnameapi.sandbox.serviceprovider.com/vernum/ReportingAPI.svc/mex?wsdl=wsdl1
Since 401 errors are typically bad authorizations, I double-checked the address by calling the URL directly in the browser, where I was prompted with a UN/PW. I entered in my values, and was allowed to access the URL, recieving this XML in return:
<?xml version="1.0" encoding="utf-8"?>
<wsdl:definitions name="ReportingAPI" targetNamespace="https://https://brandnameapi.serviceprovider.com/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsa10="http://www.w3.org/2005/08/addressing" xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/08/addressing/policy" xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:tns="https://https://brandnameapi.serviceprovider.com" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:i0="https://https://brandnameapi.serviceprovider.com/ReportingAPI/soapBinding" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
<wsdl:import namespace="https://https://brandnameapi.serviceprovider.com/ReportingAPI/soapBinding" location="https://https://brandnameapi.sandbox.serviceprovider.com/vernum/ReportingAPI.svc/mex?wsdl=wsdl1"/>
<wsdl:types/>
<wsdl:service name="ReportingAPI">
<wsdl:port name="BasicHttpBinding_IReportingAPI" binding="i0:BasicHttpBinding_IReportingAPI">
<soap:address location="https://https://brandnameapi.sandbox.serviceprovider.com/vernum/ReportingAPI.svc/soap"/>
</wsdl:port>
</wsdl:service>
This is about as far as I've gotten. When I call the URL with my browser and pass the authentication information, I'm allowed to access the XML. When I try to do so with ColdFusion, I get 401 errors.
Way 2: cfhttp request calls
When I switched to using cfhttp, I seemed to get a little further. When I use this:
<cfhttp url="https://brandnameapi.sandbox.serviceprovider.com/vernum/ReportingAPI.svc/mex"
username="myusername" password="mypassword" method="get" result="httpResponse"
timeout="300">
</cfhttp>
httpResponse return appropriate page information, and httpResponse.filecontent returns the same XML I recieved when I called it directly in my browser.
Going one step further, I took the SOAP URL and attempted to call a function in the API that returns a list of available report files. I used the same known-working process I used for all of my JSON calls in the transaction API:
<cfhttp url="https://brandnameapi.sandbox.serviceprovider.com/vernum/ReportingAPI.svc/soap/queryAvailableReportFiles"
username="myusername" password="mypassword" method="post"
result="httpResponse" timeout="300">
<cfhttpparam type="formfield" name="typeOfReport" value="DailyCSVFile" />
</cfhttp>
When I run this code, I get a status code of 415 and an error of, 'Cannot process the message because the content type 'application/x-www-form-urlencoded' was not the expected type 'multipart/related; type="application/xop+xml"'
When I add this line between my cfhttps:
<cfhttpparam type="header" name="Content-Type" value='multipart/related; type="application/xop+xml"' />
I get the same error as directly above, but the status code changes to 400. I have not included everything I've tried to do, only where I'm at right now. I will answer as many questions as I can and will reperform steps as directed to find a solution to this problem.
Update: As requested, I have changed the cfhttp call to attempt to pass XML instead of a form field. My XML code is ripped directly from the API documentation that has an example of a raw data for a request from the API for a different function:
<cfsavecontent variable="soapBody">
<cfoutput>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<queryAvailableReportFiles
xmlns="https://brandnameapi.sandbox.serviceprovider.com/contract">
<fileName>DailyCSVFile</fileName>
</queryAvailableReportFiles>
</s:Body>
</s:Envelope>
</cfoutput>
</cfsavecontent>
<cfhttp url="https://prismproapi.sandbox.koretelematics.com/4/ReportingAPI.svc/soap/queryAvailableReportFiles" username="vfapi" password="bPzqQyK3" method="post" result="httpResponse" timeout="300">
<cfhttpparam type="xml" value="#trim(soapBody)#" />
</cfhttp>
To be fair, I have no idea if I'm doing that right. The error message that returns from it is, "The message with To https://prismproapi.sandbox.koretelematics.com/4/ReportingAPI.svc/soap/queryAvailableReportFiles cannot be processed at the receiver, due to an AddressFilter mismatch at the EndpointDispatcher. Check that the sender and receiver's EndpointAddresses agree." I also get a 500 error.
Here is an example of how I typically compose and execute my SOAP requests. Note that you will need to modify the SOAP body to fit your API's needs. Hopefully this will help lead you in the right direction.
By the way, Ben Nadel has an excellent right up on Making SOAP Web Service Requests With ColdFusion And CFHTTP
Here is my sample code:
<!--- Compose SOAP message to send to Web Service --->
<cfsavecontent variable="soapRequest">
<?xml version="1.0" encoding="UTF-8" ?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:example="http://www.domain.com/soap/example/">
<soapenv:Header/>
<soapenv:Body>
<example:ReportAPI>
<typeOfReport>DailyCSVFile</typeOfReport>
</example:ReportAPI>
</soapenv:Body>
</soapenv:Envelope>
</cfsavecontent>
<!--- Send SOAP request to the Web Service --->
<cfhttp url="https://brandnameapi.sandbox.serviceprovider.com/vernum/ReportingAPI.svc/soap/queryAvailableReportFiles" username="myusername" password="mypassword" method="post" result="httpResponse" timeout="300">
<cfhttpparam type="header" name="content-type" value="text/xml" />
<cfhttpparam type="header" name="content-length" value="#Len(Trim(soapRequest))#" />
<cfhttpparam type="header" name="charset" value="utf-8" />
<cfhttpparam type="xml" name="message" value="#Trim(soapRequest)#" />
</cfhttp>
There was a problem with their API. No code change would have addressed this issue.