XML SOAP experts, i need a heads up

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Naughty
    Confirmed User
    • Jul 2001
    • 6482

    #1

    XML SOAP experts, i need a heads up

    I have a piece of xml, like this:

    Code:
    <soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:uniface:applic:services:DELAPRBWS">
       <soapenv:Header/>
       <soapenv:Body>
          <urn:CALCULATEPREMIUM soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
           <PL69_IN xsi:type="xsd:string"><![CDATA[<?xml version="1.0" ?>
           <PL69_IN>
              <INPUTBLOK>
                <BERICHTTYPE>PL69</BERICHTTYPE>
                <INITIATOR_ID>ATP</INITIATOR_ID>
                <RESPONDENT_ID>DELA</RESPONDENT_ID>
                <BEDRIJFSCODE>ATP</BEDRIJFSCODE>
              </INPUTBLOK>
              <POLISBLOK>
                <INSCHRIJVERNUMMER>10005</INSCHRIJVERNUMMER>
                <BEREKENING_ID>2</BEREKENING_ID>
                <BETAALPERIODE>1</BETAALPERIODE>
                <COMMERCIEEL_PRODUCT>D</COMMERCIEEL_PRODUCT>
                <INGANGSDATUM_POLISMUTATIE>01-10-2012</INGANGSDATUM_POLISMUTATIE>
                <DEKKINGBLOK>
                  <DEKKING_ID_DEK>1</DEKKING_ID_DEK>
                  <ELEMENTAIR_PRODUCT_ID>400</ELEMENTAIR_PRODUCT_ID>
                  <INGANGSDATUM_DEKKING>01-10-2012</INGANGSDATUM_DEKKING>
                  <KAPITAAL_VERZEKERD>5000</KAPITAAL_VERZEKERD>
                  <VERZEKERDEBLOK>
                    <GEB_DAT>31-01-1981</GEB_DAT>
                    <GESLACHT>V</GESLACHT>
                  </VERZEKERDEBLOK>
                </DEKKINGBLOK>
                <DEKKINGBLOK>
                  <DEKKING_ID_DEK>2</DEKKING_ID_DEK>
                  <ELEMENTAIR_PRODUCT_ID>210</ELEMENTAIR_PRODUCT_ID>
                  <INGANGSDATUM_DEKKING>01-10-2012</INGANGSDATUM_DEKKING>
                  <KAPITAAL_VERZEKERD>5000</KAPITAAL_VERZEKERD>
                  <VERZEKERDEBLOK>
                    <GEB_DAT>31-08-2005</GEB_DAT>
                    <GESLACHT>V</GESLACHT>
                  </VERZEKERDEBLOK>
                </DEKKINGBLOK>
              </POLISBLOK>
             </PL69_IN>]]>
            </PL69_IN>
            <PL69_OUT xsi:type="xsd:string"></PL69_OUT>
          </urn:CALCULATEPREMIUM>
       </soapenv:Body>
    </soapenv:Envelope>
    I need to use the cdata string to calculate some stuff.

    Code:
    $soapparam = new SoapVar($objRequest, XSD_ANYXML);
    
    
    $client->__soapCall("CALCULATEPREMIUM", array($soapparam));

    Its not working at all. I keep getting blank results.

    Is there a function to check if we are getting through at all?

    I keep getting this result, no matter what:
    Code:
    Array
    (
        [return] => 0
        [PL69_OUT] => 
    )
    I'm puzzled.
    seks.ai for sale - ping me
  • Naughty
    Confirmed User
    • Jul 2001
    • 6482

    #2
    And yes, i do call the client first

    Code:
    $client = new SoapClient('http://domain.com/DELAPRBWS?wsdl');
    seks.ai for sale - ping me

    Comment

    • blackmonsters
      Making PHP work
      • Nov 2002
      • 21061

      #3
      The best heads up I can give you is :

      "Don't use SOAP unless you are washing your ass".

      But until then, use this class I wrote :

      PHP Code:
      class soapsender {
      
        function send($params) {
      
          require_once('nusoap-0.9.5/lib/nusoap.php');
      
          $this_php_version = phpversion();
      
      try {
      
      
          if ( ($this_php_version >= "5.1") && ($this_php_version < "5.2") ) {
              // PHP version: 5.1.6 works 
      
              /**********************************************************************
                  Use nusoap-0.9.5 for php version less then 5.2
              **********************************************************************/
              
      
      
              ini_set("soap.wsdl_cache_enabled", "0");
              $soapclient = new SoapClient('http://domain.com/wsdl',true);
              $soapclient->response_timeout = 600; // Set read timeout to 10 minutes
          
              $result = $soapclient->call('send', array('request' => $params));
      
      
          } //endif
      
          if ( ($this_php_version >= "5.2") && ($this_php_version < "5.3") ) {
      
              // PHP version: 5.2.17 works
      
              ini_set("soap.wsdl_cache_enabled", "0");
      
              $client = new SoapClient("http://domain.com/wsdl");
              $result = $client->send($params);
      
      
      
      
          } //endif
      
      
          if ($this_php_version >= "5.3")  {
      
              ini_set("soap.wsdl_cache_enabled", "0");
      
              $client = new SoapClient('http://domain.com/wsdl',
              array('default_socket_timeout'=>'600'));
      
              $result = $client -> __soapCall('send', array('request' => $params));
      
          }
      
      
      
       } catch (SoapFault $exception) {
      
          return "error";      
      
        }
      
      
          return $result;
      
      
         } //end function
      
      
      
      
      } 
      
      Call the class like this :

      PHP Code:
      $params = array('stuff'=>$stuff,'morestuff'=>$morestuff);
      
      $soapsender = new soapsender();
      $result = $soapsender->send($params); 
      
      * Download the nusoap file first : http://sourceforge.net/projects/nuso.../nusoap/0.9.5/


      That's all the time I can spend on this though.
      Good luck.



      Comment

      • Naughty
        Confirmed User
        • Jul 2001
        • 6482

        #4
        Thanks, i will have a look.
        Its annoying as hell, should have had this done yesterday.
        seks.ai for sale - ping me

        Comment

        • Naughty
          Confirmed User
          • Jul 2001
          • 6482

          #5
          Issue is though, i think i need to get this format:
          Code:
          $params = array('stuff'=>$stuff,'morestuff'=>$morestuff);
          From this section:
          Code:
          <PL69_IN xsi:type="xsd:string"><![CDATA[<?xml version="1.0" ?>
                 <PL69_IN>
                    <INPUTBLOK>
                      <BERICHTTYPE>PL69</BERICHTTYPE>
                      <INITIATOR_ID>ATP</INITIATOR_ID>
                      <RESPONDENT_ID>DELA</RESPONDENT_ID>
                      <BEDRIJFSCODE>ATP</BEDRIJFSCODE>
                    </INPUTBLOK>
                    <POLISBLOK>
                      <INSCHRIJVERNUMMER>10005</INSCHRIJVERNUMMER>
                      <BEREKENING_ID>2</BEREKENING_ID>
                      <BETAALPERIODE>1</BETAALPERIODE>
                      <COMMERCIEEL_PRODUCT>D</COMMERCIEEL_PRODUCT>
                      <INGANGSDATUM_POLISMUTATIE>01-10-2012</INGANGSDATUM_POLISMUTATIE>
                      <DEKKINGBLOK>
                        <DEKKING_ID_DEK>1</DEKKING_ID_DEK>
                        <ELEMENTAIR_PRODUCT_ID>400</ELEMENTAIR_PRODUCT_ID>
                        <INGANGSDATUM_DEKKING>01-10-2012</INGANGSDATUM_DEKKING>
                        <KAPITAAL_VERZEKERD>5000</KAPITAAL_VERZEKERD>
                        <VERZEKERDEBLOK>
                          <GEB_DAT>31-01-1981</GEB_DAT>
                          <GESLACHT>V</GESLACHT>
                        </VERZEKERDEBLOK>
                      </DEKKINGBLOK>
                      <DEKKINGBLOK>
                        <DEKKING_ID_DEK>2</DEKKING_ID_DEK>
                        <ELEMENTAIR_PRODUCT_ID>210</ELEMENTAIR_PRODUCT_ID>
                        <INGANGSDATUM_DEKKING>01-10-2012</INGANGSDATUM_DEKKING>
                        <KAPITAAL_VERZEKERD>5000</KAPITAAL_VERZEKERD>
                        <VERZEKERDEBLOK>
                          <GEB_DAT>31-08-2005</GEB_DAT>
                          <GESLACHT>V</GESLACHT>
                        </VERZEKERDEBLOK>
                      </DEKKINGBLOK>
                    </POLISBLOK>
                   </PL69_IN>]]>
                  </PL69_IN>
          seks.ai for sale - ping me

          Comment

          • blackmonsters
            Making PHP work
            • Nov 2002
            • 21061

            #6
            $params = array('BERICHTTYPE'=>'PL69','INITIATOR_ID'=>'ATP', 'RESPONDENT_ID'=>'DELA'.......);
            Good luck.



            Comment

            • Naughty
              Confirmed User
              • Jul 2001
              • 6482

              #7
              Originally posted by blackmonsters
              $params = array('BERICHTTYPE'=>'PL69','INITIATOR_ID'=>'ATP', 'RESPONDENT_ID'=>'DELA'.......);
              Hehe, i knew that much, but it is different each time so i need it automated. Feel like a freakin n00b
              seks.ai for sale - ping me

              Comment

              • blackmonsters
                Making PHP work
                • Nov 2002
                • 21061

                #8
                Originally posted by Naughty
                Hehe, i knew that much, but it is different each time so i need it automated. Feel like a freakin n00b
                Yes, it's different every time so you need variables; but you didn't like it when
                I posted that.

                $params = array('stuff'=>$stuff,'morestuff'=>$morestuff);
                Good luck.



                Comment

                • Naughty
                  Confirmed User
                  • Jul 2001
                  • 6482

                  #9
                  Originally posted by blackmonsters
                  Yes, it's different every time so you need variables; but you didn't like it when
                  I posted that.

                  $params = array('stuff'=>$stuff,'morestuff'=>$morestuff);
                  The variables are still static there, just the values aren't.

                  I appreciate the help though, don't get me wrong!!
                  seks.ai for sale - ping me

                  Comment

                  • blackmonsters
                    Making PHP work
                    • Nov 2002
                    • 21061

                    #10
                    Originally posted by Naughty
                    The variables are still static there, just the values aren't.

                    I appreciate the help though, don't get me wrong!!
                    Well gee, sorry that I didn't explain how fucking arrays work for you!

                    Fuck you idiot!

                    Good luck.



                    Comment

                    • Naughty
                      Confirmed User
                      • Jul 2001
                      • 6482

                      #11
                      Originally posted by blackmonsters
                      Well gee, sorry that I didn't explain how fucking arrays work for you!

                      Fuck you idiot!

                      hehe, yeah arrays have always been my achilles heel;-)
                      I have two projects here that needed fixing yesterday. Always great when shit hits the fan on more than one project at the same time. It makes my vision blurry:-p
                      seks.ai for sale - ping me

                      Comment

                      • blazin
                        Confirmed User
                        • Aug 2002
                        • 2781

                        #12
                        Originally posted by Naughty
                        hehe, yeah arrays have always been my achilles heel;-)
                        I have two projects here that needed fixing yesterday. Always great when shit hits the fan on more than one project at the same time. It makes my vision blurry:-p
                        A programmer that doesn't understand arrays.....

                        Give up programming now... its not for you.
                        I don't endorse a god damn thing......

                        Comment

                        • Naughty
                          Confirmed User
                          • Jul 2001
                          • 6482

                          #13
                          Originally posted by blazin
                          A programmer that doesn't understand arrays.....

                          Give up programming now... its not for you.
                          I understand them, just not that much ;-)
                          Luckily i am not a 'real programmer'. I'm just very very resourcefull at times....
                          seks.ai for sale - ping me

                          Comment

                          • Naughty
                            Confirmed User
                            • Jul 2001
                            • 6482

                            #14
                            20 bucks for who helps me fix this little crap, it needs to be done today.

                            dykwia at gmail dottercom
                            or 125586484
                            seks.ai for sale - ping me

                            Comment

                            • Mr. Stiff
                              So Fucking Stiff!
                              • Oct 2005
                              • 493

                              #15
                              That raw SOAP envelope doesn't help much.. Better post the full WSDL URL and most of your code, that'll probably contain the key the solve this.

                              SOAP & PHP generally doen't play well together..

                              Maandag kan ik je helpen, maar 20 USD is wel een beetje weinig ;)
                              ICQ 208807506

                              Comment

                              • Naughty
                                Confirmed User
                                • Jul 2001
                                • 6482

                                #16
                                Originally posted by Mr. Stiff
                                That raw SOAP envelope doesn't help much.. Better post the full WSDL URL and most of your code, that'll probably contain the key the solve this.
                                SOAP & PHP generally doen't play well together..
                                I cannot post everything, hence the emailaddress and icq number;-)


                                Originally posted by Mr. Stiff
                                Maandag kan ik je helpen, maar 20 USD is wel een beetje weinig ;)
                                Ik weet dat 20 te weinig is, er stond drie uur voor, die heb ik geaccepteerd (eerder voor Wehkamp e.a. SOAP koppelingen gemaakt, maar ben inmiddels ruim anderhalve dag bezig;-)
                                Voor de kenner die mijn script ziet, vast binnen half uurtje voltooid.

                                Ik ken alleen SOAP mbt het halen van gegevens, niet voor het posten én halen;-)
                                seks.ai for sale - ping me

                                Comment

                                • Naughty
                                  Confirmed User
                                  • Jul 2001
                                  • 6482

                                  #17
                                  Glad to find out i am not a COMPLETE idiot. My input file/format is just wrong, i tested with some default xml data and that gave some valid output, whereas the SOAP envelope doesn't do me any good. Seems i need to read up on that first:-(
                                  seks.ai for sale - ping me

                                  Comment

                                  • doorag
                                    Confirmed User
                                    • Oct 2012
                                    • 45

                                    #18
                                    xml is dead, everyone should use json

                                    Comment

                                    • CurrentlySober
                                      Too lazy to wipe my ass
                                      • Aug 2002
                                      • 38984

                                      #19
                                      i cant afford soap...

                                      But I guess most of you knew that already...
                                      ️ ️

                                      Comment

                                      • Naughty
                                        Confirmed User
                                        • Jul 2001
                                        • 6482

                                        #20
                                        Originally posted by CurrentlySober
                                        i cant afford soap...

                                        But I guess most of you knew that already...
                                        I never actually thought about it, nor did i ever care, but... are you Drinkinghard?
                                        seks.ai for sale - ping me

                                        Comment

                                        • grumpy
                                          Too lazy to set a custom title
                                          • Jan 2002
                                          • 9870

                                          #21
                                          Originally posted by doorag
                                          xml is dead, everyone should use json

                                          use csv for regular data exchange
                                          Don't let greediness blur your vision | You gotta let some shit slide
                                          icq - 441-456-888

                                          Comment

                                          Working...