GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   XML SOAP experts, i need a heads up (https://gfy.com/showthread.php?t=1103931)

Naughty 03-22-2013 02:13 AM

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.

Naughty 03-22-2013 02:19 AM

And yes, i do call the client first

Code:

$client = new SoapClient('http://domain.com/DELAPRBWS?wsdl');

blackmonsters 03-22-2013 02:54 AM

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.

Naughty 03-22-2013 03:44 AM

Thanks, i will have a look.
Its annoying as hell, should have had this done yesterday.

Naughty 03-22-2013 03:46 AM

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>


blackmonsters 03-22-2013 03:50 AM

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

Naughty 03-22-2013 03:54 AM

Quote:

Originally Posted by blackmonsters (Post 19540322)
$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

blackmonsters 03-22-2013 03:57 AM

Quote:

Originally Posted by Naughty (Post 19540325)
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);

Naughty 03-22-2013 04:19 AM

Quote:

Originally Posted by blackmonsters (Post 19540328)
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!!

blackmonsters 03-22-2013 05:08 AM

Quote:

Originally Posted by Naughty (Post 19540335)
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!

:1orglaugh

Naughty 03-22-2013 05:26 AM

Quote:

Originally Posted by blackmonsters (Post 19540361)
Well gee, sorry that I didn't explain how fucking arrays work for you!

Fuck you idiot!

:1orglaugh

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

blazin 03-22-2013 06:32 AM

Quote:

Originally Posted by Naughty (Post 19540374)
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..... :1orglaugh

Give up programming now... its not for you.

Naughty 03-22-2013 10:22 AM

Quote:

Originally Posted by blazin (Post 19540431)
A programmer that doesn't understand arrays..... :1orglaugh

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....:pimp

Naughty 03-22-2013 10:28 AM

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

dykwia at gmail dottercom
or 125586484

Mr. Stiff 03-22-2013 10:51 AM

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 ;)

Naughty 03-22-2013 11:47 AM

Quote:

Originally Posted by Mr. Stiff (Post 19540935)
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;-)


Quote:

Originally Posted by Mr. Stiff (Post 19540935)
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;-)

Naughty 03-22-2013 12:53 PM

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:-(

doorag 03-23-2013 05:33 AM

xml is dead, everyone should use json

CurrentlySober 03-23-2013 05:37 AM

i cant afford soap... :(

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

Naughty 03-23-2013 12:48 PM

Quote:

Originally Posted by CurrentlySober (Post 19541933)
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?

grumpy 03-23-2013 12:52 PM

Quote:

Originally Posted by doorag (Post 19541926)
xml is dead, everyone should use json


use csv for regular data exchange


All times are GMT -7. The time now is 02:52 AM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123