Here you can find the WSDL for my Jobs.asmx webService. http://recpushdata.cyndigo.com/jobs.asmx
The Thing is I have created a HTML page at http://bugmusic.cyndigo.com/CallWebService.html
and its returning an Error Server did not recognize the value of HTTP Header SOAP.
I am not able to find the bug.
add or remove the httppost, httpget protocols. like below:
in your Web.config
<webServices><br>
<protocols><br>
<add name="HttpPost"/> <br>
<add name="HttpGet"/> <br>
</protocols><br>
</webServices><br>
in your machine.config:<br>
<system.web><br>
...<br>
<webServices><br>
<protocols><br>
<add name="HttpSoap"/><br>
<add name="HttpPost"/><br>
<add name="HttpGet"/><br>
<add name="Documentation"/><br>
<add name="HttpPostLocalhost"/><br>
</protocols><br>
</webServices><br>
...<br>
</system.web<br>
Related
We have an application that is run in a virtual folder in IIS. We don't want the virtual folder name to be part our links though (primarily to preserve original link names for SEO reasons).
So here is one example of a rewrite rule we're using:
<rule name="Rewrite Account controller to UI">
<match url="/Account(.*)"/>
<action type="Rewrite" url="ui/Account{R:1}"/>
<conditions>
<add input="{URL}" pattern="\.axd$" negate="true" ignoreCase="true"/>
</conditions>
</rule>
The problem with this rule is that it would also match "~/someothercontroller/258642/Accounting-Essentials" and turn it into "/ui/Accounting-Essentials". And I don't want to include the host because the host is different in each environment.
What would this need to look like to match only if the expression is the first thing after the host?
Edit:
Sorry, I guess my post wasn't as clear as I thought it was. An example would be http://x/Account. This should rewrite to http://x/ui/Account. The x could be any host name with any number of periods but it's only the host name so it wouldn't contain any slashes.
You can see in the rule I have above that I want it to include anything that comes after Account however I realize that's not quite right either because it shouldn't match "http://x/Accounting", but it should match "http://x/Account/whatever".
So essentially, you want to make sure that Account comes right after the host, and also that Account is the full name of the directory. You can achieve this like so:
<rule name="Rewrite Account controller to UI">
<match url="^Account(/.*)?"/>
<action type="Rewrite" url="ui/Account{R:1}"/>
<conditions>
<add input="{URL}" pattern="\.axd$" negate="true" ignoreCase="true"/>
</conditions>
</rule>
The ^ ensures that this is the beginning of the string that you are evaluating.
The / after Account ensures that you only rewrite the url if "Account" is the full name of the directory.
It appears from the documentation that the inital / will not be included in the string you're evaluating (which is why I removed it), but you can test it both ways to be sure.
Also note that I added a / before {R:1}.
Edit: Another way
You could also add a rule that verifies that the whole URL matches a certain pattern. This might actually be an easier way:
<rule name="Rewrite Account controller to UI">
<match url="/Account(.*)"/>
<action type="Rewrite" url="ui/Account{R:1}"/>
<conditions>
<add input="{URL}" pattern="\.axd$" negate="true" ignoreCase="true"/>
<add input="{REQUEST_URI}" pattern="^/Account(/.*)?" ignoreCase="true"/>
</conditions>
</rule>
The Microsoft docs give this example of the server variable values:
For example, if a request was made for this URL:
http://www.example.com/content/default.aspx?tabid=2&subtabid=3, and a rewrite rule was defined on the site level then:
The rule pattern gets the URL string content/default.aspx as an input.
The QUERY_STRING server variable contains tabid=2&subtabid=3.
The HTTP_HOST server variable contains www.example.com.
The SERVER_PORT server variable contains 80.
The SERVER_PORT_SECURE server variable contains 0 and HTTPS contains OFF.
The REQUEST_URI server variable contains /content/default.aspx?tabid=2&subtabid=3.
The PATH_INFO server variable contains /content/default.aspx.
we have a IIS reverse proxy response rule, which modifies Location HTTP header.. I am trying to decode the logic and planning to write same logic in xslt, can someone explain below logic. how match pattern works and action rewrite and value works and what is R:1, R:2 , R:3 here ?
<rule name="Change Location Header" enabled="true">
<match serverVariable="RESPONSE_LOCATION" pattern="^http(s)?://([^/]+)/(.*)" />
<conditions logicalGrouping="MatchAny" trackAllCaptures="true">
<add input="{RESPONSE_STATUS}" pattern="^301" />
<add input="{RESPONSE_STATUS}" pattern="^302" />
</conditions>
<action type="Rewrite" value="http{R:1}://{R:2}/{R:3}" />
</rule>
Your rule is changing the domain in the HTTP location header for redirect responses
How is working match condition and what is R:1,R:2,R:3
RESPONSE_LOCATION variable has full lik url. For example:
https://demo.cloudimg.io/s/width/300/sample.li/boat.jpg
In this case, after match operation with regexp: ^http(s)?://([^/]+)/(.*)
Mathces will be like that:
{R:0} https://demo.cloudimg.io/s/width/300/sample.li/boat.jpg
{R:1} s
{R:2} demo.cloudimg.io
{R:3} s/width/300/sample.li/boat.jpg
I have searched high and low for an example implementation or blog post on how to use Mass Transit's Quartz integration (https://github.com/MassTransit/MassTransit-Quartz).
At the moment I have to make do with just looking at the unit tests that come with the code base and I'm not making much progress.
Are there any examples or good blog posts out there to help me get started with Mass Transit and Quartz Scheduling?
This example lets you persist a MassTransit scheuled message in a SQL database. Out of the box, MassTransit only persists in memory without some config changes.
First of all you need a subtle change to your app/web.config file to include the following 2 blocks:
<configSections>
<section name="quartz" type="System.Configuration.NameValueSectionHandler, System, Version=1.0.5000.0,Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<quartz>
<add key="quartz.scheduler.instanceName" value="MassTransit-Quartz" />
<add key="quartz.scheduler.instanceId" value="AUTO" />
<add key="quartz.threadPool.type" value="Quartz.Simpl.SimpleThreadPool, Quartz" />
<add key="quartz.threadPool.threadCount" value="4" />
<add key="quartz.threadPool.threadPriority" value="2" />
<add key="quartz.jobStore.misfireThreshold" value="60000" />
<add key="quartz.jobStore.type" value="Quartz.Impl.AdoJobStore.JobStoreTX, Quartz" />
<add key="quartz.jobStore.useProperties" value="false" />
<add key="quartz.jobStore.driverDelegateType" value="Quartz.Impl.AdoJobStore.SqlServerDelegate, Quartz" />
<add key="quartz.jobStore.clustered" value="true" />
<add key="quartz.jobStore.tablePrefix" value="QRTZ_" />
<add key="quartz.jobStore.dataSource" value="quartzDS" />
<add key="quartz.dataSource.quartzDS.connectionString" value="Server=(local);Database=Quartz;Integrated Security=SSPI" />
<add key="quartz.dataSource.quartzDS.provider" value="SqlServer-20" />
Then, in your local SQL, create a new database named "Quartz", download the quartz.net source and locate the database script
"tables_sqlServer.sql"
run this against your Quartz local database to create the schema.
Now you have everything ready to persist scheduled messages in the database, you need to subscribe these two consumers from the MassTransit Quartz integration library:
var scheduler = CreateScheduler();
sb.SubscribeConsumer(() => new ScheduleMessageConsumer(scheduler));
sb.SubscribeConsumer(() => new CancelScheduledMessageConsumer(scheduler));
Where scheduler is an IScheduler:
static IScheduler CreateScheduler()
{
ISchedulerFactory schedulerFactory = new StdSchedulerFactory();
return schedulerFactory.GetScheduler();
}
and sb is your servicebus of type IServiceBus.
Finally, in your code call:
Bus.ScheduleMessage(SchedulePeriodInSecondsFromNow, MessageToSchedule);
And have a consumer for the "MessageToSchedule" type.
If you open up the database and query the QRTZ_TRIGGERS table, you will see jobs appearing there and in QRTZ_JOB_DETAILS.
Hope this helps!
I am using ColdFusion 9.0.1
I have a new site that is accessible through a few domains such as:
mydomain.com
www.mydomain.com
foo.mydomain.com
For SEO and tracking purposes, I want to make sure that only "mydomain.com" is indexed and accessed. So, every request that tries to access my site through other domains will be 301 directed to "mydomain.com".
I want to make sure that I capture and preserve the query string so that I don't just send people to the home page.
I will also make sure that I can access the site locally at 127.0.0.1
I wondering where in the code is the best place to do this SPECIFIC type of redirect. My guess it's in application.cfc near the top, in the onRequestStart() method.
Is this best place to put the code and does is this code complete? Is there a better way to code this?
<cfscript>
ThisHost = CGI.HTTP_HOST;
QString = CGI.QUERY_STRING;
GoToURL = "http://mydomain.com?" & QString;
if (ThisHost != "mydomain.com" && ThisHost != "127.0.0.1") {
writeOutput("<cfheader statuscode='301' statustext='Moved permanently'>");
writeOutput("<cfheader name='location' value='#GoToURL#'>");
abort;
}
</cfscript>
UPDATE
I know this isn't the best way to accomplish what I need, because this task is much better suited to the web server's skill set. Here's my code till I can implement this on the web server:
<cfscript
ThisHost = CGI.HTTP_HOST;
QString = CGI.QUERY_STRING;
GoToURL = "http://flyingpiston.com/?" & QString;
if (ThisHost != "flyingpiston.com" && ThisHost != "127.0.0.1:8500") {
location(GoToURL, false, 301);
}
<cfscript
I agree with other comments and answers that doing this at the web server is a better solution. I would also point out that if you want to use the script syntax, this is entirely wrong and will simply return a string to the browser:
writeOutput("<cfheader name='location' value='#GoToURL#'>");
In ColdFusion 9, you would instead use the location() function:
location("url", addtoken, statusCode);
In your case:
location(GoToURL, false, 301);
Your GoToURL variable is also missing the page name, so you'd need to add CGI.SCRIPT_NAME into the mix just before the ? to get the full URL being called.
With the tag syntax (as of ColdFusion 8 I believe), there is no need to use the CFHEADER tag for a 301 redirect. The CFLOCATION tag now supports a statuscode attribute which can be set to 301 as needed.
If you are on IIS 7.0 the you may be able configure your web.config file for a canonical redirect like so:
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Redirect to WWW" stopProcessing="true">
<match url=".*" />
<conditions>
<add input="{HTTP_HOST}" pattern="^domain.com$" />
</conditions>
<action type="Redirect" url="http://www.domain.com/{R:0}"
redirectType="Permanent" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
Check out this link for additional options.
The previous answer shows how to redirect domain.com to www.domain.com. If you want to redirect www.domain.com to 'domain.com', you will need a web.config file that looks like this:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<location path="" overrideMode="Inherit">
<system.webServer>
<rewrite>
<rules>
<rule name="remove www" patternSyntax="Wildcard" stopProcessing="true">
<match url="*" />
<conditions logicalGrouping="MatchAny">
<add input="{HTTP_HOST}" pattern="www.*" />
<add input="{HTTP_HOST}" pattern="foo.*" />
</conditions>
<serverVariables />
<action type="Redirect" url="http://{C:1}" />
</rule>
</rules>
</rewrite>
</system.webServer>
</location>
</configuration>
The above web.config file was created on IIS 7.5 (Windows Server 2008 R2).
Your host will need to install the URL Rewrite Module as mentioned above in order for this to work.
The web.config file is stored in the root folder of your site.
The above example will redirect 'www' and 'foo' sub-domains to the domain.
This 10 URL Rewriting Tips and Tricks article has been a good reference for me.
Have a IIS7 URL rewrite rule which uses friendly url so for example regEx is ([A-Za-z]+)/([A-Za-z]+)
www.mysite.com/genetics/overview
gets rewritten to
www.mysite.com/genetics/default.aspx?a=overview
Now I need to change the RegEx so it excludes the Content folder and any subdirectory in this folder. Been trying a few examples with no luck so far it either gives me back a 404 or no improvement to the current page (which loses all it's images and styles). Anyone have or know a RegEx that will select any folder other than a certain Named folder like Content?
Never mind found that in IIS for a directory you can ignore the rule. Applied that now all is working good.
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true"/>
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true"/>
<add input="{URL}" pattern="WebResource.axd" negate="true"/>
</conditions>