Is anyone here good with web services?
I have a server set up and can run the coveted TempConvert web service so I know the server is set up correct for VB/ASP 4.5 web services and has a good webconfig file.
I added two web methods to the shell. One to create a temp file on the server and the other to append the data from the incoming XML to the temp file. I figure once the XML is saved then I can parse it, validate, and write code to save what I need out of it to a DB.
The issue is I have a company that needs to send XML docs to me via a web service and I have never written a web service before and don't know how to call it without a button. This is my aspx page. I have searched and searched but can't seem to find what I need which makes me think I have a terminology issue.
I have a server set up and can run the coveted TempConvert web service so I know the server is set up correct for VB/ASP 4.5 web services and has a good webconfig file.
I added two web methods to the shell. One to create a temp file on the server and the other to append the data from the incoming XML to the temp file. I figure once the XML is saved then I can parse it, validate, and write code to save what I need out of it to a DB.
Code:
<WebMethod()> Public Function GetTempFileName() As String
Dim g As Guid = New Guid
Dim fs As FileStream = New FileStream(Server.MapPath(g.ToString()), FileMode.Create)
fs.Close()
Return g.ToString()
End Function
<WebMethod()> Public Sub AppendToTempFile(ByVal filename As String, ByVal data As Byte)
Try
Dim fs As FileStream = New FileStream(Server.MapPath(filename), FileMode.Append)
Dim bw As BinaryWriter = New BinaryWriter(fs)
bw.Write(data)
bw.Close()
fs.Close()
Catch ex As Exception
Throw New Exception("Append to TempFile " + ex.ToString)
End TryCode:
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Default.aspx.vb" Inherits="WebService6._Default" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<script type="text/vb" runat="server">
</script>
</body>
</html>