|
I am using VB.NET.
I am new to web services, and have been given the instruction that I am to send an XML document via HTTPS POST and receive a response XML document. The web service address I have been given has no ASMX file, WSDL file or DISCO, so from what I can gather I cannot use dot.NET's built in web service controls. The address I have been given to post these calls to, is in is the following format:
https://www.server.com/WebService
(I have replaced the real server name)
I swear I have read the entire internet on the topic.
I have a couple of questions
1) can it be done with a web service address formatted such as the above (no ASMX WSDL)?? (I presume it must)
2) Are any of the approaches I have attempted below valid / should work?
3) I keep receiving an error "unable to connect to the remote server", are my issues all their fault? (I doubt it) and if not, what am I doing wrong? How can I do this?
Approaches I have tried include:
(don't get too caught up with the fact some are incomplete or some of the data or calls look silly, I'm really trying to illustrate the techniques that have failed)
Dim oRequest As HttpWebRequest = WebRequest.Create("https://www.server.com/WebService")
Dim oStream As Stream = oRequest.GetRequestStream
Dim oXML As Xml.XmlTextWriter = New Xml.XmlTextWriter(oStream, Encoding.GetEncoding("UTF-8"))
address = New Uri("https://www.server.com/WebService")
request = DirectCast(WebRequest.Create(address), HttpWebRequest)
request.Method = "POST"
request.ContentType = "application/x-www-form-urlencoded"
<WebServiceBinding("SomeBindingName", "SomeBindingNS")> _
Public Class CustomProxy
Inherits SoapHttpClientProtocol
<SoapRpcMethod(Action:="urn:AstroIntf-IAstro#GetSunriseInfo", RequestNamespace:="run:AstroIntf-IAstro")> _
Public Function GetSunriseInfo(ByVal Latitude As Double, ByVal Longitude As Double, _
ByVal Year As Integer, ByVal Month As Integer, ByVal Day As Integer, _
ByVal TimeBiasMinutes As Integer) As String
Me.Url = "https://www.server.com/WebService"
Dim ret() As Object
ret = Me.Invoke("GetSunriseInfo", _
New Object() _
{Latitude, Longitude, Year, Month, Day, TimeBiasMinutes})
Return CType(ret(0), String)
End Function
End Class
Dim oClient As New WebClient
Dim oStream As Stream = oClient.OpenWrite("https://www.server.com/WebService", "POST")
Dim oWriter As StreamWriter = New StreamWriter(oStream)
oWriter.WriteLine("Hello world")
oWriter.Close()
and good old fashioned html:
<form target="_blank" action='http://www.server.com/WebService' method="POST">
<table>
<tr>
<td>Enter something:</td>
<td><input type="text" size="30" name="test1" /></td>
</tr>
<tr>
<td></td>
<td align="right"> <input type="submit" value="Submit" /></td>
</tr>
</table>
</form>
|
|
|
|
|
I have a gridview that rows cell's contain a textbox each. In javascript I am trying to set the backgroundColor of one of the textboxes. In the javascript I am able to access the cell itself, see below:
gridViewCtl.rows[1].cells[1]
However, I don't know how to access the textbox that cells[1] contains to set its backgroundColor. Can anyone help?
Thanks,
Steve
|
|
|
|
|
This may not be the best way of doing it; however, it is working for me. See below:
gridViewCtl.rows[1].cells[i].childNodes[0].style.backgroundColor = '#ff0022';
If anyone has a better technique or knows how to do it using css, please let me know.
Thanks,
Steve
|
|
|
|
|
I need to change the value declare in aspx.vb via javascript my code is like this
//// My Custom Image Class /////
Public Class imageClass Inherits System.Web.UI.WebControls.Image
Public imageLabel As String = ""
End Class
/////// Default.aspx.vb ////////
Protected Overrides Sub OnInit(ByVal e As EventArgs)
Dim picture As imageClass = New imageClass
pholder.Controls.Add(picture)
/// THIS SHOULD CHANGE VIA JAVASCRIPT///
picture.imageLabel = "LabelOne"
picture.Attributes.Add("onclick","javascript:click 1('" & picture.ClientID & "')")
End Sub
Protected Sub Submit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Submit.Click
Dim NewImage As imageClass = New imageClass
For Each con As Control In pholder.Controls
If TypeOf con Is imageClass Then
/// SHOW OLD VALUE DECLARE IN ASPX.VB ///
MsgBox(CType(con, imageClass).imageLabel)
end if
Next
End Sub
/////// Default.aspx ////////
<script type="text/javascript" >
function click1(id1){document.getElementById(id1).setAttrib ute("imageLabel","Click");}
</script>
<html>
<body>
<form id="form1" runat="server">
<asp : PlaceHolder ID="pholder" runat="server" ></asp : PlaceHolder>
<asp : Button ID="Submit" Text="Submit" runat="server" />
</form>
</body>
</html>
thanks in advance
|
|
|
|
|
Hey all
i am new with web services and as start i created a web service with small funcion and it was working fine, but when i try to practice it more by connecting it with DB i get the following Error
the XML element "enablethemeing" from namespace "http://tempuri.org/" is already present in the current scope. Use the XML attributes to specify another XML name or namespace for the elemnt
so what i did wrong
all what i do is open an SqlDataReader, return it to another function, then fill it in DataTable
can you help me guys?
PS: I tried to copy the code but i could not and i belive this is one of many problems with IE 8.
thank you in advance
|
|
|
|
|
Hi,
Please provide me code definition about how to include Style Sheets in ASP program
Regards,
Vidhya R
|
|
|
|
|
It's just the same as for an HTML page - you just need to include them in the HEAD part of your page.
|
|
|
|
|
<head>
<link rel="stylesheet" type="text/css" href="stylesheet.css">
</link></head>
The Stifler
--
Bugs can neither be created nor be removed from software by a developer. They can only be converted from one form to another. The total number of bugs in the software always remain constant.
|
|
|
|
|
The topic says it all.
I wish to be able to resize an image using VBScript.
I have been googling for +- 3 hours now - My google dork is down to:
VBScript+Image+Resize -".NET" -"ImageMagick" -"OWC" -"CS3" -"PDFLib" -"imgsz.asp" -"software" -".exe" -"ReDim" -"Javascript" -"CSS" -"MajunX" -"Download"
And so far, all I've found are broken Scripts, broken code, "Visual Resizing" (img height = "250" - Which still has the same prob if it's a 3MB image, as it takes the same time to load...), working examples (With no working code), ActiveX Controls (Not an Option), etc, etc, etc...
I was wondering if anyone could offer any assistance?
Much Appreciated!
- Reelix
-= Reelix =-
modified on Monday, October 20, 2008 5:04 AM
|
|
|
|
|
Although it would be theoritically possible to resize an image using plain VBScript, it's not practically useful. It would simply take too long time for the code to run.
You need a third party component to resize images in VBScript.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
|
I am developing an online test application that lets users take online tests in a class room. During the duration of the test ( ie when the particular test portal is active ) I wish to disable some of the functionality in the browser like the Print, Save, Save As menus as well as prevent opening of new browser windows. The only way to use this functionality after the test is started is by pressing the "Submit" button that indicates the completion of the test and return to normal browser usage. Please can anyone help me with ideas on how that can be made possible. thanX
|
|
|
|
|
If you have access to the physical machines, you can lock them down: disable printing, saving files to disk, throw IE in "kiosk" mode... You can do this, because at that point they are effectively your machines.
If you want to do this on other people's machines, via a web page, then you're barking up the wrong tree. They're not your machines, and so you don't get to have that kind of control over them.
---- You're right.
These facts that you've laid out totally contradict the wild ramblings that I pulled off the back of cornflakes packets .
|
|
|
|
|
I think, you can open the page in a modal window...
Regards,
Vengat P
|
|
|
|
|
I would like to find distance between two addresses using google/map.live. How this can be done silently from my application? My application is desktop application, but connected to internet. If it can be done with ASP.NET. I am using C# for my application. Any idea?
Agha Khan
|
|
|
|
|
|
Even the answer is good, but it did not work well.
http://maps.google.com/maps/mpl?ie=UTF8&moduleurl=http://maps.google.com/help/maps/local_search/mapplet.html&mapclient=google&f=q&hl=en&ie=UTF8&ll=37.76108,-122.435589&spn=0.111961,0.175095&z=12&utm_campaign=en&utm_medium=mapshpp&utm_source=en-mapshpp-na-us-gns-ls&utm_term=landingpage
and added 2 address, but result had no meaning.
Anyway thanks for help.
Best regards
Agha Khan
|
|
|
|
|
(moved to asp.net forum)
<div class="ForumMod">modified on Saturday, October 18, 2008 2:11 PM</div>
|
|
|
|
|
Try the ASP.NET forum.
---- You're right.
These facts that you've laid out totally contradict the wild ramblings that I pulled off the back of cornflakes packets .
|
|
|
|
|
My apologies. Moving post now.... Thank you
|
|
|
|
|
Plz help
i have buttons like homepage, about us, ... on Master page and want not to get master page refreshed when any of these buttons is clicked. is there any way for it. im trying to do it by the use of usercontrols but then i face problem of passing value through querystring.
|
|
|
|
|
Why exactly would you not want the pages to refresh? This is how the majority of the internet works.
|
|
|
|
|
ASP.NET MVC, the model view controller architecture for Web applications based on .NET 3.5 Framework, is now available as a beta release. The release supports both Visual Studio 2008 and Visual Web Developer 2008 Express SP1.
ASP.NET MVC is an alternative, not a replacement, for ASP.NET Web Forms that offers the following benefits:
- Clear separation of concerns
- Testability - support for Test-Driven Development
- Fine-grained control over HTML and JavaScript
- Intuitive URLs
ASP.NET MVC Beta release comes with an explicit "go-live" license that allows you to deploy it in production environments.
Click here to download it. You can also explore tutorials, quickstarts, and videos to learn more.
Scott Guthrie's blog entry, ASP.NET MVC Beta Released, contains a quick summary of some of the new features and changes in this build compared to the previous "Preview 5" release:
|
|
|
|
|
Hi all,
i am working on mobile application , but the thing is in my application userinterface is developed in objective c ,for retrieving data from database for this purpose they want web methods , so we developed webmethods ,after deploying this webservice application we are giving that url, so they created proxy so they are using ,requirement is if anybody capture the url means we will get problem, i searched in google all examples are with username and password , but the requirement is without providing any username and password we need to give security for our web service. how to do this
anybody have idea can u please give me idea
Thanks & Regards
sam
sam
|
|
|
|
|
srinivassam wrote: but the requirement is without providing any username and password we need to give security for our web service.
That's kind of dumb. Take the requirement, roll it up, and smack the person who made that requirement.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|