NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
addAttachment on SOAP-Server


Joined: 23 Oct 2006
Posts: 3
Reply with quote
Hi everybody,

i hope you can show me a simple example, how to trasnfer some attachments from the server to the client.

thank you for the help!
View user's profileFind all posts by mendoSend private message


Joined: 28 Sep 2006
Posts: 13
Reply with quote
you can use:$server->addAttachment();
View user's profileFind all posts by macrovanSend private messageVisit poster's websiteMSN Messenger


Joined: 23 Oct 2006
Posts: 3
Reply with quote
macrovan wrote:
you can use:$server->addAttachment();


how is the syntax for wsdl file?
and how can a client get this file?

this example works,but i have to response from the server with attachemnt..

server
Code:
$server->wsdl->addComplexType(
    'hrbIndexRquest',
    'complexType',
    'struct',
    'all',
    '',
    array(
        'Timestamp' => array('name'=>'Timestamp','type'=>'xsd:string'),
        'Complete' => array('name'=>'Complete','type'=>'xsd:boolean')
    )
);

$server->wsdl->addComplexType(
    'hrbIndexResponse',
    'complexType',
    'struct',
    'all',
    '',
    array(
        'Url' => array('name'=>'Url','type'=>'xsd:string'),
        'Timestamp' => array('name'=>'Timestamp','type'=>'xsd:string'),
        'Complete' => array('name'=>'Complete','type'=>'xsd:boolean'),
        'Error' => array('name'=>'Error','type'=>'xsd:string')
    )
);
$server->register(
    'hrbIndex',
    array('input'=>'tns:hrbIndexRquest'),
    array('return'=>'tns:hrbIndexResponse'),
    $cfg["soap"]["space"]);

function hrbIndex ($x)
{
global $cfg;

        $res['Timestamp']=fileatime($cfg["index"]["com"]);
        $res['Complete']=$x["Complete"];
        $res['Url']=$cfg["soap"]["space"]."/";

//here i have,to make the attachment

return $res;
}

$server->service($HTTP_RAW_POST_DATA);


client

Code:
$param = array('Timestamp' => "20061018123400",
               'Complete' => "1"
               );
$client = new soapclient('http://www.XXXX.de/nusoap/server.php');
$response = $client->call('hrbIndex', $param);
View user's profileFind all posts by mendoSend private message
er


Joined: 28 Sep 2006
Posts: 13
Reply with quote
you must config your 'PEAR Mail_MIME library' in nusoapmime.php
and require_once your PEAR.php in mime.php and in mimeDecode.php

in your soap server files:
$soap = new nusoapservermime() instead of $soap = new soap_server();

I am sorry for my bad English!
View user's profileFind all posts by macrovanSend private messageVisit poster's websiteMSN Messenger
:)


Joined: 28 Sep 2006
Posts: 13
Reply with quote
Attachment is in the httpBody
you can send/receicve from the soap message!

$server->addAttachment();//send
$client->getAttachment();//receive
View user's profileFind all posts by macrovanSend private messageVisit poster's websiteMSN Messenger
Re: :)


Joined: 23 Oct 2006
Posts: 3
Reply with quote
macrovan wrote:
Attachment is in the httpBody
you can send/receicve from the soap message!

$server->addAttachment();//send
$client->getAttachment();//receive


thank you it seems good,
can you recommend me some simple tutrial for using nusoapservermime?
View user's profileFind all posts by mendoSend private message
addAttachment on SOAP-Server
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic