Tag Archive for web

Llamar a servicio web WSDL

Function llamadaServicioWEB(xmlSOAP)
Dim oSOAPprov
Dim strURL, SoapServer, SoapPath

strURL = "https://www.proveedor.com/carpetaServ/axis/ElServicio?wsdl"
SoapServer = "www.proveedor.com"
SoapPath = "/carpetaServ/axis/ElServicio?wsdl"

Set oSOAPprov = Server.CreateObject("MSXML2.ServerXMLHTTP")

oSOAPprov.Open "POST", strURL, False

oSOAPprov.setRequestHeader "Man", "POST " & SoapPath & " HTTP/1.1"
oSOAPprov.setRequestHeader "Host", SoapServer
oSOAPprov.setRequestHeader "Content-Type", "text/xml; charset=utf-8"
oSOAPprov.setRequestHeader "SOAPAction", "https://www.proveedor.com/carpetaServ/axis/ElServicio"

oSOAPprov.Send(xmlSOAP)
Set xmlSOAP = nothing

Dim xmlRespuesta, strRespuesta
If oSOAPprov.status = 200 Then '200 = STATUS OK
Set xmlRespuesta = Server.CreateObject("Microsoft.XMLDOM")
xmlRespuesta.loadXML(oSOAPprov.ResponseText)

' ==== ANALIZAR RESPUESTA SEGUN CADA CASO ====

Set xmlRespuesta = nothing
Else
'Si status <> 200 no puede analizar la respuesta
strRespuesta = "Error " & oSOAPprov.status & ": " & errServerXMLHTTP(oSOAPprov.status)
End If
Set oSOAPprov = nothing

llamadaServicioWEB = strRespuesta
End Function

source

XHTML 1.1 Web Standards Template — Fixed

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" dir="ltr">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>title goes here » Site title here</title>

<base href="" />
<meta name="Author" content="#" />
<meta name="Description" content="#" />
<meta name="Copyright" content="#" />
<meta name="Robots" content="#" />
<meta name="Generator" content="#" />
<meta name="Keywords" content="#" />
<meta http-equiv="Expires" content="#" />
<meta http-equiv="Cache-Control" content="#" />
<meta http-equiv="imagetoolbar" content="false" />
<link rel="Shortcut Icon" href="/favicon.ico" type="image/x-icon" />
<link href="/script/javascript.js" type="text/javascript"  />
<style type="text/css" xml:space="preserve">
/*<![CDATA[*/
@import url(/css/style.css) all;
/*]]>*/
</style>
<link rel="stylesheet" href="/css/screen.css" type="text/css" media="screen, projection" />
<link rel="stylesheet" href="/css/print.css" type="text/css" media="print" />

<!--[if IE]>
<link rel="stylesheet" href="/css/win-ie-all.css" type="text/css" media="screen, projection" />
<![endif]-->

</head>
<body>

</body>
</html>

source

XML HTTP request Weather

<%
Dim StrUrl, strCorpo, strTemperatura, StrSensacao, StrImagem, StrClima, StrCidade
Dim arr, arrTemperatura, ArrClima, ArrImagem, ArrSensacao, ArrCidade
Dim objXMLHTTP, strXmlHttp
StrUrl = "http://br.weather.com/weather/local/BRXX0109" 'url da cidade desejada
Set objXMLHTTP = CreateObject("Microsoft.XMLHTTP")
objXMLHTTP.open "get", StrUrl,false
objXMLHTTP.send
strXmlHttp = objXMLHTTP.responseText
set objXMLHTTP = nothing

function limpa(str)
Dim var
var = replace(trim(str),"""","")
var = replace(var,">","")
var = replace(var,"xt","")
var = replace(var,"TeT","T")
var = replace(var,"Text","")
var = replace(var,"OP","")
var = replace(var,"Sensa&ccedil;&atilde;o de&nbsp;","")
limpa=var
end function

'Array global para pegar apenas a tabela que contem as informações desejadas
arr=split(strXmlHttp,"<!-- insert reported by and last updated info -->")
strCorpo = mid(arr(1),1,6300)

source

HTML LI Images

<style type="text/css">
ul.orangearrow li {
list-style-image: url(http://0--0.us/0067_circular_arrow.png);
}
</style>

<ul class="orangearrow">
<li>meat</li>
<li>potatoes</li>
<li>water</li>
</ul>

source

Web Sprachen CheatSheet

XML

<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>

DTD

<?xml version="1.0" standalone="no"?>
<!DOCTYPE hallo SYSTEM "hallo.dtd">
<hallo>Hallo Welt!</hallo>

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE example [
<!ENTITY copy "&#xA9;">
<!ENTITY copyright-notice "Copyright &copy; 2006, XYZ Enterprises">
]>
<example>
&copyright-notice;
</example>

XSLT
<?xml version="1.0" ?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="xml" indent="yes"/>

<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="hello.xsl"?>
<hello-world> <greeter>An XSLT Programmer</greeter> <greeting>Hello, World!</greeting></hello-world>

GWT
<module>
<!-- Inherit the core Web Toolkit stuff.                  -->
<inherits name='com.google.gwt.user.User'/>
<inherits name='com.qrist0ph.gwtWidgets.WidgetLibrary'/>
<!-- Specify the app entry point class.                   -->
<entry-point class='org.qrist0ph.client.HelloWorld'/>
<stylesheet src="HelloWorld.css" />
</module>

public class VerticalTabPanel extends Composite implements HistoryListener{
initWidget(panel);

HTML

<head>
<style type="text/css">
body {background-color: white}
table.sample td { border-width: 1px 1px 1px 1px; }
</style>
<link rel="stylesheet" type="text/css" href="style.css" />
<script type="text/javascript" src="ticker.js" />
<script type="text/javascript">
function myfunction()
{
document.getElementById("mydiv").innerHTML = "Button clicked"
}
</script>
</head>

source

Using a Data URL to Embed an Image in an HTML Page

<img src="data:image/png;base64,Qk12BQAAAAAAADYAAAAoAAAAFQAAABUAAAABABgAAAAAAEAFAAAAAAAAAAAAAAAAAAAAAAAAO6qp KqOiKqOiKqOiKqOiKqOiKqOiKqOiKqOiKqOiKqOiO6qpTLGwTLGwTLGwTLGwTLGwTLGwTLGwTLGw TLGwAEyxsDuqqSqjoiqjoiqjoiqjoiqjoiqjoiqjoiqjoiqjoiqjojuqqUyxsEyxsEyxsEyxsEyx sEyxsEyxsEyxsABMsbBMsbA7qqkqo6Iqo6Iqo6Iqo6Iqo6Iqo6Iqo6Iqo6Iqo6Iqo6I7qqlMsbBM sbBMsbBMsbBMsbBMsbBMsbAATLGwTLGwTLGwO6qpKqOiKqOiKqOiKqOiKqOi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qOi KqOiO6qpTLGwTLGwTLGwTLGwTLGwTLGwTLGwTLGwTLGwO6qpKqOiKqOiKqOiKqOiKqOiACqjoiqj oiqjoiqjoiqjoiqjojuqqUyxsEyxsEyxsEyxsEyxsEyxsEyxsEyxsEyxsDuqqSqjoiqjoiqjoiqj ogAqo6Iqo6Iqo6Iqo6Iqo6Iqo6Iqo6I7qqlMsbBMsbBMsbBMsbBMsbBMsbBMsbBMsbBMsbA7qqkq o6Iqo6Iqo6IAKqOiKqOiKqOiKqOiKqOiKqOiKqOiKqOiO6qpTLGwTLGwTLGwTLGwTLGwTLGwTLGw TLGwTLGwO6qpKqOiKqOiACqjoiqjoiqjoiqjoiqjoiqjoiqjoiqjoiqjojuqqUyxsEyxsEyxsEyx sEyxsEyxsEyxsEyxsEyxsDuqqSqjogAqo6Iqo6Iqo6Iqo6Iqo6Iqo6Iqo6Iqo6Iqo6Iqo6I7qqlM sbBMsbBMsbBMsbBMsbBMsbBMsbBMsbBMsbA7qqkA" />

source

XHTML 1.0 Transitional Layout

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>

<title>untitled</title>

</head>

<body>

</body>
</html>

source

Rails CSV Export

# require 'rubygems' if using this outside of Rails
require 'fastercsv'

def dump_csv
@users = User.find(:all, <img src='http://www.snippetsmania.com/wp-includes/images/smilies/icon_surprised.gif' alt=':o' class='wp-smiley' /> rder => "lastname ASC")
@outfile = "members_" + Time.now.strftime("%m-%d-%Y") + ".csv"

csv_data = FasterCSV.generate do |csv|
csv << [
"Last Name",
"First Name",
"Username",
"Email",
"Company",
"Phone",
"Fax",
"Address",
"City",
"State",
"Zip Code"
]
@users.each do |user|
csv << [
user.lastname,
user.firstname,
user.username,
user.email,
user.company,
user.phone,
user.fax,
user.address + " " + user.cb_addresstwo,
user.city,
user.state,
user.zip
]
end
end

send_data csv_data,
:type => 'text/csv; charset=iso-8859-1; header=present',
:disposition => "attachment; filename=#{@outfile}"

flash[:notice] = "Export complete!"
end

source

iPhone Web Applications base styles

/*
iPhoneUI.css

Base styles for iPhone Web applications, based on Apple's
recommended user interface styles.

<a href="http://developer.apple.com/iphone/designingcontent.html" >http://developer.apple.com/iphone/designingcontent.html</a>
*/

body {
font-family: Helvetica, Arial, sans-serif;
margin: 0;
padding: 0;
}

.edgeToEdge {
background-color: #fff;
border-spacing: 0;
border-width: 0;
font-size: 20px;
font-weight: bold;
margin: 0;
padding: 0;
}

.edgeToEdge.formButtons {
margin: 0;
padding: 10px;
}

.edgeToEdge .formList {
font-weight: normal;
}

.edgeToEdge.formFields textarea,
.roundedRect.formFields textarea,
.roundedRect .formFields textarea {
clear: left;
display: block;
width: 296px;
}

dl.edgeToEdge.formFields dd,
dl.roundedRect.formFields dd,
.roundedRect .formFields dd {
border-bottom: 1px solid rgb(217,217,217);
padding: 10px;
margin: 0;
text-align: right;
}

dl.edgeToEdge.formFields dd.last,
dl.roundedRect.formFields dd.last,
.roundedRect .formFields dd.last {
border-bottom-width: 0;
}

dl.edgeToEdge.formFields dt,
dl.roundedRect.formFields dt,
.roundedRect .formFields dt {
clear: left;
float: left;
padding: 10px 10px 0 10px;
margin: 0;
}

p.edgeToEdgeLast {
border-bottom-width: 0;
}

form {
margin: 0;
}

.formButtons {
text-align: right;
}

.formList {
list-style-type: none;
margin: 0 0 -.33em 0;
padding: 0;
}

.formList li {
margin-bottom: .33em;
}

.formResults {
background-color: #fff;
-webkit-border-radius: 8px;
color: #900;
font: normal normal bold 17px/normal Helvetica, Arial, sans-serif;
margin: 1em 10px;
padding: 10px;
text-align: center;
}

.iphone-preview-landscape,
.iphone-preview-portrait {
background-color: #A3A3A3;
border: 1px solid #000;
margin: 1em auto;
min-height: 320px;
width: 356px;
}

.iphone-preview-portrait {
min-height: 356px;
width: 320px;
}

.roundedRect {
background-color: #fff;
border-width: 0;
font-family: Helvetica, Arial, sans-serif;
font-size: 17px;
font-weight: bold;
margin: 10px;
-webkit-border-radius: 8px 8px;
}

body.roundedRect,
body.roundedRect .iphone-preview-landscape {
background-color: #C5CCD3;
}

body.roundedRect {
font: normal normal bold 17px/normal Helvetica, Arial, sans-serif;
}

div.roundedRect {
margin: .6em 10px 1em 10px;
padding: 1px 10px;
}

p.roundedRect {
padding: 10px;
}

.roundedRectHead,
.roundedRect legend {
color: rgb(76,86,108);
font: normal normal bold 17px/normal Helvetica, Arial, sans-serif;
margin: 0;
}

.roundedRectIntHead {
font: normal normal normal 21px/normal Helvetica, Arial, sans-serif;
margin: 1em 0 -.75em 0;
}

fieldset.roundedRect {
margin: 2em 10px 1em 10px;
padding: 0 0 1px 0;
}

fieldset.roundedRect p {
margin: 1em 10px;
}

.roundedRect legend {
padding-left: 10px;
position: relative;
top: -.8em;
}

.roundedRectHead {
margin: 1em 20px -.5em 20px;
}

source

meyerweb.com – css reset

html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, font, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td {
margin: 0;
padding: 0;
border: 0;
outline: 0;
font-weight: inherit;
font-style: inherit;
font-size: 100%;
font-family: inherit;
vertical-align: baseline;
}
/* remember to define focus styles! */
:focus {
outline: 0;
}
body {
line-height: 1;
color: black;
background: white;
}
ol, ul {
list-style: none;
}
/* tables still need 'cellspacing="0"' in the markup */
table {
border-collapse: separate;
border-spacing: 0;
}
caption, th, td {
text-align: left;
font-weight: normal;
}
blockquote:before, blockquote:after,
q:before, q:after {
content: "";
}
blockquote, q {
quotes: "" "";
}

source