A SOAP Question? - TCP-IP

This is a discussion on A SOAP Question? - TCP-IP ; 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++ ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: A SOAP Question?

  1. A SOAP Question?

    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 += "\r\n";
    xml += " envelope/\" s:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/
    \">\r\n";
    xml += " \r\n";
    xml += " org:service:WANIPConnection:1\"/>\r\n";
    xml += "
    \r\n";
    xml += "
    \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


  2. Re: A SOAP Question?

    SpreadTooThin wrote:
    > 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.


    The following groups might be more appropriate:
    comp.text.xml
    microsoft.public.xml.soap
    microsoft.public.xml.soapsdk

+ Reply to Thread