I'm trying to forward calls from few Plivo numbers to my Asterisk server. In Plivo documentation specified, that i have to build Inbound trunk application and return to plivo XML code below:
<Response>
<Dial callerId="18004321321">
<User>sip:yoda12312312#phone.plivo.com</User>
</Dial>
</Response>
But the problem is that i need to add information about destination phone number (cause i have few of them), but can't find the way to do this.
Have you tried this:
<Response>
<Dial callerId="18004321321">
<User>sip:yoda12312312#phone.plivo.com</User>
<Number>180012345678</Number>
</Dial>
</Response>
I am trying to test my SOAP webservice running on weblogic 12c (which is not installed locally) using SoapUI as a client. Without authorization everything works fine, but when I implement very simple UserToken on server and do every step described here:
https://www.soapui.org/soap-and-wsdl/authenticating-soap-requests.html
then I've got following error:
<faultcode>wsse:InvalidSecurityToken</faultcode>
<faultstring>Security token failed to validate. weblogic.xml.crypto.wss.SecurityTokenValidateResult#211ca945[status: false][msg UNT Error:Message Created time past the current time even accounting for set clock skew]</faultstring>
Also I've looked to the http log of SoapUI and I've noticed something strange there:
Tue Mar 20 09:15:52 CET 2018:DEBUG:>>
<soapenv:Header>
<wsse:Security soapenv:mustUnderstand="1" xmlns:wsse="..." xmlns:wsu="...">
<wsse:UsernameToken wsu:Id="UsernameToken-374B6AAD9B07D377D515215337525091">
<wsse:Username>user</wsse:Username>
<wsse:Password Type="...#PasswordText">password</wsse:Password>
<wsse:Nonce EncodingType="...#Base64Binary">urRvoAYbjjovfD0OQqvJ6g==</wsse:Nonce>
<wsu:Created>2018-03-20T08:15:52.464Z</wsu:Created>
</wsse:UsernameToken>
</wsse:Security>
</soapenv:Header>
The time of log (which is current one) is different then in <wsu:Created> tag. I don't know if it is important, but I am in UTC+01:00 time zone.
EDIT
I've give up with SoapUI and I've implemented my own Java client with authorization using CredentialProvider:
((BindingProvider) port).getRequestContext().put(WSSecurityContext.CREDENTIAL_PROVIDER_LIST, credentialProviders);
And then it was the same! So probably it isn't SoapUI problem, but something else.
Exception in thread "main" com.sun.xml.ws.fault.ServerSOAPFaultException:
Client received SOAP Fault from server: Security token failed to validate. weblogic.xml.crypto.wss.SecurityTokenValidateResult#37b70a09[status: false]
[msg UNT Error:Message Created time past the current time even accounting for set clock skew] Please see the server log to find more detail regarding exact cause of the failure.
at com.sun.xml.ws.fault.SOAP11Fault.getProtocolException(SOAP11Fault.java:193)
at com.sun.xml.ws.fault.SOAPFaultBuilder.createException(SOAPFaultBuilder.java:131)
at com.sun.xml.ws.client.sei.StubHandler.readResponse(StubHandler.java:253)
at com.sun.xml.ws.db.DatabindingImpl.deserializeResponse(DatabindingImpl.java:203)
at com.sun.xml.ws.db.DatabindingImpl.deserializeResponse(DatabindingImpl.java:290)
at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:119)
at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:92)
...
When I've looked to the message using Wireshark, time in header was also decrease by one hour. That is really strange and I have no idea what is going on. How am I supposed to test my webservice using authorization? Locally I am using Windows 7, but my Weblogic is running on CentOS 7. As I said both are set to UTC+01:00.
OK, I finally menage to solve this issue. It turns out that server time is late for 2 minutes comparing to the local machine time. Webservice requires time between client and server cannot be larger then few seconds. When I adjusted time everything is working properly.
Additionally, current time in log Mar 20 09:15:52 CET 2018 and time in message 2018-03-20T08:15:52.464Z are equal, but just in different format.
Its bit strange, am getting this error "The request sent by the client was syntactically incorrect" with Pentaho Kettle's HTTP Post step in only Unix box. My development machine is Windows 7 and there I never faced this issue. But when I deploy my ETL job at Unix box and execute, will get this error.
I had figured-out the issue. Here, the SOAP request XML includes Unicode characters; if I replace this with normal alphabets, will get executed properly.
But my question is, why this issue is only in Unix (Red hat) box? Why not in Windows7 not even in SOAP UI? Do I have to configure Unix to handle Unicode? or have to change my XML request for Unix?
My XML Request format is as follows:
<?xml version='1.0' encoding='UTF-8' ?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:bul="http://www.uidai.gov.in/bulkseed">
<soapenv:Header/>
<soapenv:Body>
<bul:bulkSeedRequest>
<bul:bulkSeedDetails>
<bul:userLoginId>WS_USER_ID</bul:userLoginId>
<bul:uid>123456789</bul:uid>
<bul:benificiaryId>ABC123</bul:benificiaryId>
<bul:deptId>1</bul:deptId>
<bul:schemeId>2</bul:schemeId>
<bul:districtId>3</bul:districtId>
<bul:talukaId>4</bul:talukaId>
<bul:benificiaryName>ಕೃಷ್ಣಮಣಿ</bul:benificiaryName>
<bul:benificiaryGender>F</bul:benificiaryGender>
<bul:benificiaryDOB/>
<bul:benificiaryAge>030</bul:benificiaryAge>
<bul:benificiaryAddress>House Address</bul:benificiaryAddress>
<bul:familyMemberId>2</bul:familyMemberId>
<bul:action>ADD</bul:action>
</bul:bulkSeedDetails>
</bul:bulkSeedRequest>
</soapenv:Body>
</soapenv:Envelope>
This will be caused by the default encoding in java. On Windows it is NOT UTF-8. On unix it is UTF-8. And I guess those chars don't work in UTF-8?
you can configure it like so:
Setting the default Java character encoding?
I suspect if you set PDI to UTF-8 on windows (as above) then you'll be able to reproduce in Windows too.
I'm having a heck of a time calling SetPolicies() (API ref) using the 2010 SSRS WSDL (on SQL Server 2008R2 SSRS Server). When I POST with the following payload, I get a 200 response, a well formed SOAP response with an empty body, but no policy actually created for the given folder.
I'm making other calls successfully, so I'm not worried about auth problems. Additionally, I've made the same calls via Powershell with success.
I'm trying to use the raw SOAP API (called from Ruby actually)...anybody have any suggestions on what to try next?
Here's my XML:
<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:tns="http://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer"
xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
<env:Body>
<tns:SetPolicies>
<tns:ItemPath>/mydir</tns:ItemPath>
<tns:Policies>
<tns:groupUserName>mydomain\someuser</tns:groupUserName>
<tns:roles>
<tns:role>
<tns:name>Content Manager</tns:name>
<tns:description>stuff</tns:description>
</tns:role>
<tns:role>
<tns:name>Browser</tns:name>
<tns:description>stuff here too</tns:description>
</tns:role>
</tns:roles>
</tns:Policies>
</tns:SetPolicies>
</env:Body>
</env:Envelope>
Solved. I was able to catch the POST powershell is using (via wireshark) and look at the XML...the tags are identical, except for casing...
Looks like the reportServer API is sensitive to the case of the XML tags...when POSTing this, I get a 200, and the policies are actually set:
<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:tns="http://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer"
xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
<env:Body>
<tns:SetPolicies>
<tns:ItemPath>/mydir</tns:ItemPath>
<tns:Policies>
<tns:GroupUserName>mydomain\someuser</tns:groupUserName>
<tns:Roles>
<tns:Role>
<tns:Name>Content Manager</tns:name>
<tns:Description>stuff</tns:description>
</tns:Role>
<tns:Role>
<tns:Name>Browser</tns:name>
<tns:Description>stuff here too</tns:description>
</tns:Role>
</tns:Roles>
</tns:Policies>
</tns:SetPolicies>
</env:Body>
</env:Envelope>
I'm developing a web app using GWT and am seeing a crazy problem with caching of the app.nocache.js file in the browser even though the web server sent a new copy of the file!
I am using Eclipse to compile the app, which works in dev mode. To test production mode, I have a virtual machine (Oracle VirtualBox) with a Ubuntu guest OS running on my host machine (Windows 7). I'm running lighttpd web server in the VM. The VM is sharing my project's war directory, and the web server is serving this dir.
I'm using Chrome as the browser, but the same thing happens in Firefox.
Here's the scenario:
The web page for the app is blank. Accorind to Chrome's "Inspect Element" tool, it's because it is trying fetch 6E89D5C912DD8F3F806083C8AA626B83.cache.html, which doesn't exist (404 not found).
I check the war directory, and sure enough, that file doesn't exist.
The app.nocache.js on the browser WAS RELOADED from the web server (200 OK), because the file on the server was newer than the browser cache. I verified that file size and timestamp for the new file returned by the server were correct. (This is info Chrome reports about the server's HTTP response)
However, if I open the app.nocache.js on the browser, the javascript is referring to 6E89D5C912DD8F3F806083C8AA626B83.cache.html!!! That is, even though the web server sent a new app.nocache.js, the browser seems to have ignored that and kept using its cached copy!
Goto Google->GWT Compile in Eclipse. Recompile the whole thing.
Verify in the war directory that the app.nocache.js was overwritten and has a new timestamp.
Reload the page from Chrome and verify once again that the server sent a 200 OK response to the app.nocache.js.
The browser once again tries to load 6E89D5C912DD8F3F806083C8AA626B83.cache.html and fails. The browser is still using the old cached copy of app.nocache.js.
Made absolutely certain in the war directory that nothing is referring to 6E89D5C912DD8F3F806083C8AA626B83.cache.html (via find and grep)
What is going wrong? Why is the browser caching this nocache.js file even when the server is sending it a new copy?
Here is a copy of the HTTP request/response headers when clicking reload in the browser. In this trace, the server content hasn't been recompiled since the last GET (but note that the cached version of nocache.js is still wrong!):
Request URL:http://192.168.2.4/xbts_ui/xbts_ui.nocache.js
Request Method:GET
Status Code:304 Not Modified
Request Headersview source
Accept:*/*
Accept-Charset:ISO-8859-1,utf-8;q=0.7,*;q=0.3
Accept-Encoding:gzip,deflate,sdch
Accept-Language:en-US,en;q=0.8
Cache-Control:max-age=0
Connection:keep-alive
Host:192.168.2.4
If-Modified-Since:Thu, 25 Oct 2012 17:55:26 GMT
If-None-Match:"2881105249"
Referer:http://192.168.2.4/XBTS_ui.html
User-Agent:Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.4 (KHTML, like Gecko) Chrome/22.0.1229.94 Safari/537.4
Response Headersview source
Accept-Ranges:bytes
Content-Type:text/javascript
Date:Thu, 25 Oct 2012 20:27:55 GMT
ETag:"2881105249"
Last-Modified:Thu, 25 Oct 2012 17:55:26 GMT
Server:lighttpd/1.4.31
The best way to avoid browser caching is set the expiration time to now and add the max-age=0 and the must-revalidate controls.
This is the configuration I use with apache-httpd
ExpiresActive on
<LocationMatch "nocache">
ExpiresDefault "now"
Header set Cache-Control "public, max-age=0, must-revalidate"
</LocationMatch>
<LocationMatch "\.cache\.">
ExpiresDefault "now plus 1 year"
</LocationMatch>
your configuration for lighthttpd should be
server.modules = (
"mod_expire",
"mod_setenv",
)
...
$HTTP["url"] =~ "\.nocache\." {
setenv.add-response-header = ( "Cache-Control" => "public, max-age=0, must-revalidate" )
expire.url = ( "" => "access plus 0 days" )
}
$HTTP["url"] =~ "\.cache\." {
expire.url = ( "" => "access plus 1 years" )
}
We had a similar issue. We found out that timestamp of the nocache.js was not updated with gwt compile so had to touch the file on build. And then we also applied the fix from #Manolo Carrasco Moñino. I wrote a blog about this issue. http://programtalk.com/java/gwt-nocachejs-cached-by-browser/
We are using version 2.7 of GWT as the comment also points out.
There are two straightforward solutions (second is modified version of first one though)
1) Rename your *.html file which has a reference to *.nocache.js to i.e. MyProject.html to MyProject.jsp
Now search the location of you *.nocache.js script in MyProject.html
<script language="javascript" src="MyProject/MyProject.nocache.js"></script>
add a dynamic variable as a parameter for the JS file, this will make sure actual contents are being returned from the server every time. Following is example
<script language="javascript" src="MyProject/MyProject.nocache.jsp?dummyParam=<%= "" + new java.util.Date().getTime() %>"></script>
Explanation: dummyParam will be of no use BUT will get us our intended results i.e. will return us 200 code instead of 304
Note: If you will use this technique then you will need to make sure that you are pointing to right jsp file for loading your application (Before this change you was loading your app using HTML file).
2) If you dont want to use JSP solution and want to stick with your html file then you will need java script to dynamically add the unique parameter value on the client side when loading the nocache file. I am assuming that should not be a big deal now for you given the solution above.
I have used first technique successfully, hope this will help.
The app.nocache.js on the browser WAS RELOADED from the web server (200 OK), because the file on the server was newer than the browser cache. I verified that file size and timestamp for the new file returned by the server were correct. (This is info Chrome reports about the server's HTTP response)
I wouldn't rely on this. I've seen a bit of strange behaviour in Chrome's dev tools with the network tab in combination with caching (at least, it's not 100% transparent for me). In case of doubt, I usually still consult Firebug.
So probably Chrome still uses the old version. It may have decided long ago, that it will never have to reload the resource again. Clearing the cache should resolve this. And then make sure to set the correct caching headers before reloading the page, see e.g. Ideal HTTP cache control headers for different types of resources.
Open the page in cognito mode just to get-rid of cache issue and unblock yourself.
You need to configure cache time as mentioned in others comments.
After unsuccessfully preventing caching via Apache I created a bash script that root runs every minute in a cron job on my Linux Tomcat server.
#!/bin/bash
#
# Touches GWT nocache.js files in the Tomcat web app directory to prevent caching.
# Execute this script every minute in a root cron job.
#
cd /var/lib/tomcat7/webapps
find . -name '*nocache.js' | while read file; do
logger "Touching file '$file'"
touch "$file"
done