[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Help on accessing .Net web service.



Sender: George Kolbe <GEORGEK@xxxxxxxxx>

Hi Scott,

Thank you, Thank you. This is great, IT WORKS!!

-----Original Message-----
From: owner-ftpapi@xxxxxxxxxxxxx [mailto:owner-ftpapi@xxxxxxxxxxxxx]On
Behalf Of Scott Klement
Sent: 03 January 2006 09:12 PM
To: ftpapi@xxxxxxxxxxxxx
Subject: Re: Help on accessing .Net web service.


Sender: Scott Klement <sk@xxxxxxxxxxxxxxxx>


> I am not to sure if I have to send a SOAP package or just the method, 
> but I am not to sure how to do this.

According to the WSDL file you sent, yes, you need to generate a SOAP 
message.  SOAP and WSDL are (IMHO) overly complicated for what they do. 
All WDSL does is tell you which functions are available to call and what 
their parameters are.  Yet, if you look at the WDSL file, you'll see that 
it's done in a way that's very complicated!

Unfortunately, HTTPAPI does not have tools that transform WSDL into SOAP 
messages.  That'd be a nice feature to have, though.


> If I use the http_url_get as below, I get a web page as if I point my
> browser to the web service
> 	url = 'http://ServerIPAddress/Hello/Service1.asmx?op=HelloWorld'
>     		+ http_url_encoder_getstr(Enc);

I don't understand what you're trying to do in this example.  For one 
thing, even if this were a REST webservice (which it's not, if the WSDL is 
to be believed) then you'd need to add an ampersand to between the 
"HelloWorld" and the getstr() from the encoder.

However...  it's not a REST webservice.  You have to generate a SOAP 
message and send it to the server.  It's this SOAP message that contains 
the parameters.

A SOAP message is an XML document that tells the server what the 
parameters are and what to do with them...  I haven't tested this 
(actually, I CAN'T test it, since I don't have your HelloWorld web service 
to test with) but here's a program that I THINK follows the specs in the 
WSDL file that you sent:

      H DFTACTGRP(*NO) BNDDIR('LIBHTTP/HTTPAPI')

       /copy libhttp/qrpglesrc,httpapi_h

      D SOAP            s           8192A   varying
      D rc              s             10I 0
      D errorMsg        s             80A

       /free

        SOAP = '<?xml version="1.0" encoding="UTF-8" standalone="no"?>'
             + '<SOAP-ENV:Envelope'
             + ' xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/";'
             + ' xmlns:http="http://schemas.mlsoap.org/wsdl/http/";'
             + ' xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/";'
             + ' xmlns:s="http://www.w3.org/2001/XMLSchema";'
             + ' xmlns:s0="http://tempuri.org/";'
             + ' xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/";'
             + ' xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/";'
             + ' xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/";'
             + ' xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";'
             + ' xmlns:xsd="http://www.w3.org/2001/XMLSchema"; >'
             + '<SOAP-ENV:Body>'
             + '<s0:HelloWorld xmlns:s0="http://tempuri.org/";>'
             + '</s0:HelloWorld>'
             + '</SOAP-ENV:Body>'
             + '</SOAP-ENV:Envelope>';

        rc = http_url_post( 'http://localhost/Hello/Service1.asmx'
                          : %addr(SOAP) + 2
                          : %len(SOAP)
                          : '/tmp/result.xml'
                          : HTTP_TIMEOUT
                          : HTTP_USERAGENT
                          : 'text/xml'
                          : 'http://tempuri.org/HelloWorld' );

        if rc <> 1;
            errormsg = http_error();
            // show errormsg to user.
        endif;

        *inlr = *on;

       /end-free
-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubsribe from the list send mail
to majordomo@xxxxxxxxxxxxx with the body: unsubscribe ftpapi mymailaddr
-----------------------------------------------------------------------
-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubsribe from the list send mail
to majordomo@xxxxxxxxxxxxx with the body: unsubscribe ftpapi mymailaddr
-----------------------------------------------------------------------