473,398 Members | 2,404 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

A Question about using SOAP in REALbasic

Not sure if this is the appropriate place to ask a question about
soap.
If you think you know a better news group to discuss this please
point
me there.
I wrote a UPnP Internet Gateway Device Class in C++ with raw tcp/ip
and udp calls.

I want to now port that code to a high level interpreter that
supplies
SOAP methods.
I need some help 'filling in the blanks' in this high level language.

Here is the C++ method:

//This code sends a message to the gateway to inquire about the
external IP address. It builds up the soap envelope and message then
posts //it and gets the response, parses it to extract the desired
value.

void IGD::getExternalIPAddress(std::string & NewExternalIPAddress) {
tcpclient poster;
std::string htmlpost, xml;
char buffer[2048];

poster.connect((char *) gatewayIPAddress.c_str(), gatewayPort);

xml += "<?xml version=\"1.0\"?>\r\n";
xml += "<s:Envelope xmlns:s=\"http://schemas.xmlsoap.org/soap/
envelope/\" s:encodingStyle=\"http://schemas.xmlsoap.org/soap/
encoding/
\">\r\n";
xml += " <s:Body>\r\n";
xml += " <u:GetExternalIPAddress xmlns:u=
\"urn:schemas-upnp-
org:service:WANIPConnection:1\"/>\r\n";
xml += " </s:Body>\r\n";
xml += "</s:Envelope>\r\n";

htmlpost += "POST /control?WANIPConnection HTTP/1.1\r\n";
htmlpost += "HOST: ";
htmlpost += gatewayIPAddress;
htmlpost += ":";
htmlpost += itoa(gatewayPort, buffer, 10);
htmlpost += "\r\n";
htmlpost += "CONTENT-LENGTH: ";
htmlpost += itoa(xml.length(), buffer, 10);
htmlpost += "\r\n";
htmlpost += "CONTENT-TYPE: text/xml ; charset=\"utf-8\"\r\n";
htmlpost += "SOAPACTION: \"urn:schemas-upnp-
org:service:WANIPConnection:1#GetExternalIPAddress \"\r\n";
htmlpost += "\r\n";
htmlpost += xml;

poster.send(htmlpost.c_str(), htmlpost.length());
int rc = poster.recv(buffer, sizeof(buffer));
buffer[rc] = '\0';

HtmlMsg serverResp(buffer);

checkResponse(serverResp);

std::string xmlText = serverResp.getXml();

xmlObj xmlO(xmlText);
std::cout << xmlO;
xmlEntry e = xmlO.get("s:Envelope/s:Body/
u:GetExternalIPAddressResponse/NewExternalIPAddress");
NewExternalIPAddress = e.getValue();

}

The REALbasic interpreter provides a brief example of a soap call and
I'm trying to use it, but I don't understand the parameters its
asking
for.
Dim sm as SoapMethod
Dim sr as SOAPResult
// create the soap method and set the parameter(s)
sm = New SoapMethod
sm.parameter("USZip") = "12345"

// set soap method properties
sm.methodNamespace = "http://www.webserviceX.NET"
sm.action = "http://www.webserviceX.NET/GetInfoByZIP"
sm.url = "http://www.webserviceX.NET/uszip.asmx"

// execute the method
sr = sm.invoke("GetInfoByZIP")

// display the Area_Code portion of the result
MsgBox sr.result("Area_Code")

The sm object has these attributes that can be set:
action
connection
inputParams
methodName
methodNamespace
namespaces
paramTypes
timeout
url
wsdl

Sep 14 '07 #1
0 2920

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Michiel | last post by:
Hello, I am not sure this is the right place to ask. I tried the ZSI mailing list, but got no response there. My goal is to write some web services with ZSI to be used by a client written in...
4
by: jm | last post by:
I understand how an XML formatted SOAP message is used to request items from a web service and how the XML formatted SOAP response is used. I am still missing the big picture, however. When is...
6
by: Guest | last post by:
Hi, I unerstand that if you choose IIS to host your .Net Remotingcomponents with HTTP channel and SOAP formatter, you get thebuilt-in security and configuraion features of IIS. Also we canexpose it...
1
by: m.tang | last post by:
Hi, I'm developing a stand alone program using VB accessing Ms Access database. I use NJStar to key in Chinese characters into the system. But I found that certain characters are not able to write...
0
by: Peter Conrey | last post by:
I have a perl web service (using SOAP::Lite) with a method called "Detail" that returns a strucure (hash reference to be exact). It works fine when consumed by a Perl client, but when I try to...
31
by: Jim Hubbard | last post by:
I am downloading the REALbasic 5.5 demo and was just wondering if anyone else had tried it. I am tired of Microsoft constantly changing things and breaking backward compatibility ON PURPOSE. ...
2
by: D H | last post by:
Hi, Hi, I was looking for your opinion on VB.NET - its long-term prospects, etc. Sorry this is vague, but it's not meant to be a troll. It's a pro-VB.NET post actually. I haven't used VB or...
5
by: David Lozzi | last post by:
Howdy, I wrote a web service in .Net for my customer. My customer has another vendor who now has to consume it but they are not using Visual Studio. Most of their pages are jsp, and they said...
0
by: SpreadTooThin | last post by:
This is a capture with ethereal of a SOAP Message to my UPnP Router.. POST /uuid:dynsvc/WANIPConnection:1 HTTP/1.1 HOST: 192.168.1.1:5431 SOAPACTION:...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.