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

RE: SOAPAction error



Chris, 

Does the debug listing show anything suspicious? (wrklnk '/tmp/*.*')

Someone with a similar problem had an issue with exact capitalization.
Perhaps visit the SOAP message and make sure it is exactly what is expected?

Mike 

-----Original Message-----
From: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
[mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Chris RENTON
Sent: Tuesday, July 24, 2007 10:11 AM
To: ftpapi@xxxxxxxxxxxxxxxxxxxxxx
Subject: SOAPAction error


   Hi All,

   I have this strange situation, i've managed to successfully get web
   services to run on my iSeries without any trouble. I have now however
   tried writing a call to a service which is on another network but has
   routes through to the iSeries. I can run this webservice fine via its
   test page but with the iSeries I get a "Unable to handle request
   without a valid action parameter. Please supply
     a valid soap action."

   All the calls are virtuallly the same, here is the code I am having
   the issues with.

    *  This is an example of calling a SOAP Web service w/HTTPAPI.
    *
   H DFTACTGRP(*NO) BNDDIR('HTTPAPI':'QC2LE')

   D SAPTEST4        PR                  ExtPgm('SAPTEST4')
   D   cname                       20A   const
   D   cname2                      20A   const
   D   cname3                      20A   const
   D   cname4                      20A   const
   D   ccity                       20A   const
   D   cpost                        7A   const
   D   ccntry                       2A   const
   D   clang                        2A   const
   D   ctel                        15A   const
   D   cfax                        15A   const
   D   cemail                      40A   const
   D   ccurr                        3A   const
   D   csalorg                      4A   const
   D   cdistri                      2A   const
   D   cdivi                        2A   const
   D   crefcus                     10A   const
   D SAPTEST4        PI
   D   cname                       20A   const
   D   cname2                      20A   const
   D   cname3                      20A   const
   D   cname4                      20A   const
   D   ccity                       20A   const
   D   cpost                        7A   const
   D   ccntry                       2A   const
   D   clang                        2A   const
   D   ctel                        15A   const
   D   cfax                        15A   const
   D   cemail                      40A   const
   D   ccurr                        3A   const
   D   csalorg                      4A   const
   D   cdistri                      2A   const
   D   cdivi                        2A   const
   D   crefcus                     10A   const

    /copy httpapi_h

    ******************************************************************
    * DEFINE XML READ FUNCTIONS
    * (for reading the headers and details for each element)
    ******************************************************************
   D StartElement    PR
   D   UserData                      *   value
   D   depth                       10I 0 value
   D   name                      1024A   varying const
   D   path                     24576A   varying const
   D   attrs                         *   dim(32767)
   D                                     const options(*varsize)

   D EndElement      PR
   D   UserData                      *   value
   D   depth                       10I 0 value
   D   name                      1024A   varying const
   D   path                     24576A   varying const
   D   value                    32767A   varying const
   D   attrs                         *   dim(32767)
   D                                     const options(*varsize)

   D SOAP            s          32767A   varying
   D rc              s             10I 0
   D price           s          32767A
   D fault           s          32767A

    /free
     if ( %parms < 1 );
        http_comp('Please pass all customer details');
        return;
     endif;

     SOAP =
      '<?xml version="1.0" encoding="utf-8"?>'
      '<?xml version="1.0" encoding="utf-8"?>'
     +'<soap:Envelope '
     +'xmlns:xsi="[1]http://www.w3.org/2001/XMLSchema-instance"; '
     +'xmlns:xsd="[2]http://www.w3.org/2001/XMLSchema"; '
     +'xmlns:soap="[3]http://schemas.xmlsoap.org/soap/envelope/";>'
     +'<soap:Body>'
     +'<CreateNewCustomer xmlns="[4]http://10.186.194.2/SAPWebService";>'
     +'  <Cust_Name>'+ %trim(cname) +'</Cust_Name>'
     +'  <Cust_Name_2>'+ %trim(cname2) +'</Cust_Name_2>'
     +'  <Cust_Name_3>'+ %trim(cname3) +'</Cust_Name_3>'
     +'  <Cust_Name_4>'+ %trim(cname4) +'</Cust_Name_4>'
     +'  <Cust_City>'+ %trim(ccity) +'</Cust_City>'
     +'  <Cust_Postcode>'+ %trim(cpost) +'</Cust_Postcode>'
     +'  <Cust_Country>'+ %trim(ccntry) +'</Cust_Country>'
     +'  <Cust_Language>'+ %trim(clang) +'</Cust_Language>'
     +'  <Cust_Telephone>'+ %trim(ctel) +'</Cust_Telephone>'
     +'  <Cust_Faxnumber>'+ %trim(cfax) +'</Cust_Faxnumber>'
     +'  <Cust_Email>'+ %trim(cemail) +'</Cust_Email>'
     +'  <Cust_Currency>'+ %trim(ccurr) +'</Cust_Currency>'
     +'  <Cust_Salesorg>'+ %trim(csalorg) +'</Cust_Salesorg>'
     +'  <Cust_Distrib>'+ %trim(cdistri) +'</Cust_Distrib>'
     +'  <Cust_Division>'+ %trim(cdivi) +'</Cust_Division>'
     +'  <Cust_RefCust>'+ %trim(crefcus) +'</Cust_RefCust>'
     +'</CreateNewCustomer>'
     +'</soap2:Body>'
     +'</soap2:Envelope>';

     http_debug(*ON);

     rc = http_url_post_xml(
                'http://10.186.194.2/SAPWebService/Service1.asmx'
                       : %addr(SOAP) + 2
                       : %len(SOAP)
                       : %paddr(StartElement)
                       : %paddr(EndElement)
                       : *NULL );

     if (rc <> 1);
        if (%trim(fault)<>'');
             http_comp(%trim(fault));
        else;
             http_crash();
        endif;
     else;
        http_comp('New customer created with ref: ' + %trim(price));
     endif;

     *inlr = *on;

    /end-free

    *********************************************************************
    * PROCEDURE TO HANDLE WHICH XML NODE WE ARE READING
    *********************************************************************
   P StartElement    B
   D StartElement    PI
   D   UserData                      *   value
   D   depth                       10I 0 value
   D   name                      1024A   varying const
   D   path                     24576A   varying const
   D   attrs                         *   dim(32767)
   D                                     const options(*varsize)

    /free
    /end-free
   P                 E
    *****************************************************************
    * PROCEDURE TO READ XML NODE VALUES TO LOCAL DATA ARRAY
    *****************************************************************

   P EndElement      B
   D EndElement      PI
   D   UserData                      *   value
   D   depth                       10I 0 value
   D   name                      1024A   varying const
   D   path                     24576A   varying const
   D   value                    32767A   varying const
   D   attrs                         *   dim(32767)
   D                                     const options(*varsize)

    /free
     select;
         when name = 'string';
            price = value;
         when name = 'faultstring';
            fault = value;
     endsl;
    /end-free
   P                 E

   thanks in advance

   Chris Renton
   Business Systems Developer
   Sigmakalon
   Ext 4213

   Official Sponsors of the Johnstone's Paint Trophy - Bringing Colour to
   the Beautiful Game
   [5]www.johnstonestrade.com/johnstonespainttrophy

   **************************************
   -----------------------------------------
   SigmaKalon UK Limited, registered in England (number 00436135), with
   its registered office at Huddersfield Road, Birstall, Batley, West
   Yorkshire, WF17 9XA. 

   PRIVATE AND CONFIDENTIAL
   This Email may contain information that is privileged, confidential or
   otherwise protected from disclosure.  It must not be used by, or its
   contents copied or disclosed to persons other than the addressee(s).
   If you have received this Email in error please notify our systems
   administrator on +44 (0)1924 354827 and delete the Email.
   WARNING
   It is the responsibility of the recipient to ensure that the onward
   transmission, opening or use of this message and any attachments will
   not adversely affect its systems or data. Please carry out such virus
   and other checks as you consider appropriate. No responsibility is
   accepted by SigmaKalon UK Limited in this regard
   The contents of this e-mail may not necessarily represent the views or
   policies of SigmaKalon UK Limited.
   No contracts may be concluded on behalf of SigmaKalon UK Limited by
   means of email communication.
   SigmaKalon UK Limited may monitor the content of e-mails, as
   appropriate, to ensure its policies and procedures are being upheld by
   its employees.  
   ----------------------------------------
   **************************************
   

References

   1. http://www.w3.org/2001/XMLSchema-instance
   2. http://www.w3.org/2001/XMLSchema
   3. http://schemas.xmlsoap.org/soap/envelope/";>'
   4. http://10.186.194.2/SAPWebService";>'
   5. http://www.johnstonestrade.com/johnstonespainttrophy
-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------

-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------