Windows XP
FoxPro 6 sp5


Hi,

I need to know if this is possible in Foxpro 6 (the code is Csharp)

using System;
using System.IO;
using System.Net;
using System.Xml;
using System.Text;
using System.Windows.Forms;
using System.ComponentModel;

using java.io;
using java.util.zip;

namespace MISI.Sapiens.Client {

public partial class Main : Form {

public Main() {
InitializeComponent();
}

private void _btSend_Click(object sender, EventArgs e) {
// validate the xml
XmlDocument xml = new XmlDocument();

try {
xml.LoadXml(_tXml.Text);
}
catch(Exception) {
MessageBox.Show("Invalid Xml.");
return;
}

// get an array of bytes from this xml
byte[] buffer = Encoding.UTF8.GetBytes(xml.OuterXml);

// compress the xml into a memory stream
MemoryBuffer memory = new MemoryBuffer();
ZipOutputStream zip = new ZipOutputStream(memory);

// create the zip file entry
ZipEntry entry = new ZipEntry("XPTO.xml");
entry.setMethod(ZipEntry.DEFLATED);

zip.putNextEntry(entry);
for(int i = 0; i < buffer.Length; i ++) {
zip.write(buffer[i]);
}
zip.closeEntry();
zip.close();

// read the compressed bytes from the memory stream
memory.Stream.Position = 0;
buffer = new byte[memory.Stream.Length];

int bytes = memory.Stream.Read(buffer, 0, buffer.Length);

Prototype.Prototype ws = new Prototype.Prototype();
ws.PreAuthenticate = true;
ws.Url =
String.Format("http://{0}/XPTO.sapiens.webservices/prototype.asmx",
_tServer.Text);
ws.Credentials = new NetworkCredential(_tUser.Text.Split('\\')[1],
_tPwd.Text, _tUser.Text.Split('\\')[0]);

MessageBox.Show(ws.Upload(buffer));

memory.Stream.Close();
}

}
}

TIA,

ATSP

Re: WSDL ... SOAP .. Fox 6 by Mike

Mike
Tue Oct 24 21:01:12 CDT 2006

If you can use the .NET framework, you can make your class a COM object and
call it from VFP. I believe that VFP6 can call COM objects.

"ATSPSoft" <atspsoft@netvisao.pt> wrote in message
news:newscache$5imn7j$m8o$1@newsfront4.netvisao.pt...
> Windows XP
> FoxPro 6 sp5
>
>
> Hi,
>
> I need to know if this is possible in Foxpro 6 (the code is Csharp)
>
> using System;
> using System.IO;
> using System.Net;
> using System.Xml;
> using System.Text;
> using System.Windows.Forms;
> using System.ComponentModel;
>
> using java.io;
> using java.util.zip;
>
> namespace MISI.Sapiens.Client {
>
> public partial class Main : Form {
>
> public Main() {
> InitializeComponent();
> }
>
> private void _btSend_Click(object sender, EventArgs e) {
> // validate the xml
> XmlDocument xml = new XmlDocument();
>
> try {
> xml.LoadXml(_tXml.Text);
> }
> catch(Exception) {
> MessageBox.Show("Invalid Xml.");
> return;
> }
>
> // get an array of bytes from this xml
> byte[] buffer = Encoding.UTF8.GetBytes(xml.OuterXml);
>
> // compress the xml into a memory stream
> MemoryBuffer memory = new MemoryBuffer();
> ZipOutputStream zip = new ZipOutputStream(memory);
>
> // create the zip file entry
> ZipEntry entry = new ZipEntry("XPTO.xml");
> entry.setMethod(ZipEntry.DEFLATED);
>
> zip.putNextEntry(entry);
> for(int i = 0; i < buffer.Length; i ++) {
> zip.write(buffer[i]);
> }
> zip.closeEntry();
> zip.close();
>
> // read the compressed bytes from the memory stream
> memory.Stream.Position = 0;
> buffer = new byte[memory.Stream.Length];
>
> int bytes = memory.Stream.Read(buffer, 0, buffer.Length);
>
> Prototype.Prototype ws = new Prototype.Prototype();
> ws.PreAuthenticate = true;
> ws.Url =
> String.Format("http://{0}/XPTO.sapiens.webservices/prototype.asmx",
> _tServer.Text);
> ws.Credentials = new NetworkCredential(_tUser.Text.Split('\\')[1],
> _tPwd.Text, _tUser.Text.Split('\\')[0]);
>
> MessageBox.Show(ws.Upload(buffer));
>
> memory.Stream.Close();
> }
>
> }
> }
>
> TIA,
>
> ATSP
>
>
>
>



Re: WSDL ... SOAP .. Fox 6 by ATSPSoft

ATSPSoft
Wed Oct 25 02:37:11 CDT 2006

Hi Mike,

Well the idea is to have sme example.. because i don't understand nothing
about soap... wsdl.. xml...

i need to send some xml and wait for response from server...

Thanks.

ATSP

"Mike McCann" <mcsoft@cox.net> escreveu na mensagem
news:O5xJAl99GHA.3256@TK2MSFTNGP02.phx.gbl...
> If you can use the .NET framework, you can make your class a COM object
> and call it from VFP. I believe that VFP6 can call COM objects.
>
> "ATSPSoft" <atspsoft@netvisao.pt> wrote in message
> news:newscache$5imn7j$m8o$1@newsfront4.netvisao.pt...
>> Windows XP
>> FoxPro 6 sp5
>>
>>
>> Hi,
>>
>> I need to know if this is possible in Foxpro 6 (the code is Csharp)
>>
>> using System;
>> using System.IO;
>> using System.Net;
>> using System.Xml;
>> using System.Text;
>> using System.Windows.Forms;
>> using System.ComponentModel;
>>
>> using java.io;
>> using java.util.zip;
>>
>> namespace MISI.Sapiens.Client {
>>
>> public partial class Main : Form {
>>
>> public Main() {
>> InitializeComponent();
>> }
>>
>> private void _btSend_Click(object sender, EventArgs e) {
>> // validate the xml
>> XmlDocument xml = new XmlDocument();
>>
>> try {
>> xml.LoadXml(_tXml.Text);
>> }
>> catch(Exception) {
>> MessageBox.Show("Invalid Xml.");
>> return;
>> }
>>
>> // get an array of bytes from this xml
>> byte[] buffer = Encoding.UTF8.GetBytes(xml.OuterXml);
>>
>> // compress the xml into a memory stream
>> MemoryBuffer memory = new MemoryBuffer();
>> ZipOutputStream zip = new ZipOutputStream(memory);
>>
>> // create the zip file entry
>> ZipEntry entry = new ZipEntry("XPTO.xml");
>> entry.setMethod(ZipEntry.DEFLATED);
>>
>> zip.putNextEntry(entry);
>> for(int i = 0; i < buffer.Length; i ++) {
>> zip.write(buffer[i]);
>> }
>> zip.closeEntry();
>> zip.close();
>>
>> // read the compressed bytes from the memory stream
>> memory.Stream.Position = 0;
>> buffer = new byte[memory.Stream.Length];
>>
>> int bytes = memory.Stream.Read(buffer, 0, buffer.Length);
>>
>> Prototype.Prototype ws = new Prototype.Prototype();
>> ws.PreAuthenticate = true;
>> ws.Url =
>> String.Format("http://{0}/XPTO.sapiens.webservices/prototype.asmx",
>> _tServer.Text);
>> ws.Credentials = new NetworkCredential(_tUser.Text.Split('\\')[1],
>> _tPwd.Text, _tUser.Text.Split('\\')[0]);
>>
>> MessageBox.Show(ws.Upload(buffer));
>>
>> memory.Stream.Close();
>> }
>>
>> }
>> }
>>
>> TIA,
>>
>> ATSP
>>
>>
>>
>>
>
>



Re: WSDL ... SOAP .. Fox 6 by ATSPSoft

ATSPSoft
Fri Oct 27 04:52:11 CDT 2006

Hi,

Can anyone help me?!?!


Thanks.

"ATSPSoft" <atspsoft@netvisao.pt> escreveu na mensagem
news:newscache$5imn7j$m8o$1@newsfront4.netvisao.pt...
> Windows XP
> FoxPro 6 sp5
>
>
> Hi,
>
> I need to know if this is possible in Foxpro 6 (the code is Csharp)
>
> using System;
> using System.IO;
> using System.Net;
> using System.Xml;
> using System.Text;
> using System.Windows.Forms;
> using System.ComponentModel;
>
> using java.io;
> using java.util.zip;
>
> namespace MISI.Sapiens.Client {
>
> public partial class Main : Form {
>
> public Main() {
> InitializeComponent();
> }
>
> private void _btSend_Click(object sender, EventArgs e) {
> // validate the xml
> XmlDocument xml = new XmlDocument();
>
> try {
> xml.LoadXml(_tXml.Text);
> }
> catch(Exception) {
> MessageBox.Show("Invalid Xml.");
> return;
> }
>
> // get an array of bytes from this xml
> byte[] buffer = Encoding.UTF8.GetBytes(xml.OuterXml);
>
> // compress the xml into a memory stream
> MemoryBuffer memory = new MemoryBuffer();
> ZipOutputStream zip = new ZipOutputStream(memory);
>
> // create the zip file entry
> ZipEntry entry = new ZipEntry("XPTO.xml");
> entry.setMethod(ZipEntry.DEFLATED);
>
> zip.putNextEntry(entry);
> for(int i = 0; i < buffer.Length; i ++) {
> zip.write(buffer[i]);
> }
> zip.closeEntry();
> zip.close();
>
> // read the compressed bytes from the memory stream
> memory.Stream.Position = 0;
> buffer = new byte[memory.Stream.Length];
>
> int bytes = memory.Stream.Read(buffer, 0, buffer.Length);
>
> Prototype.Prototype ws = new Prototype.Prototype();
> ws.PreAuthenticate = true;
> ws.Url =
> String.Format("http://{0}/XPTO.sapiens.webservices/prototype.asmx",
> _tServer.Text);
> ws.Credentials = new NetworkCredential(_tUser.Text.Split('\\')[1],
> _tPwd.Text, _tUser.Text.Split('\\')[0]);
>
> MessageBox.Show(ws.Upload(buffer));
>
> memory.Stream.Close();
> }
>
> }
> }
>
> TIA,
>
> ATSP
>
>
>
>



Re: WSDL ... SOAP .. Fox 6 by josepe

josepe
Wed Nov 01 12:00:28 CST 2006

You can try first (another machine) using the adds of VFP9+.NET
framework (free for download from Microsoft). I think the guys of the
Spanish VFP group can you a lot.

microsoft.public.es.vfoxpro