Jump to content

Soap,php, and wsdl files


gork4life

Recommended Posts

I've only used SOAP a handful of times. All I can say is, from my experience, it's bloated and annoying to make simple changes. I think JSON is the way forwar. Just bear in mind that most browsers block cross site requests returning JSON, so when sending JSON from other hosts JSONP is your friend.

 

If you have code problems post them and we'll try and help :)

Link to comment
Share on other sites

  • 2 weeks later...

Ok thanks I'm tring to create a webservice in php. My servercode is

<?php 
ini_set('soap.wsdl_cache_enabled',0);
ini_set('soap.wsdl_cache_ttl',0);

$soap_server = new SoapServer('Notification.wsdl');
$soap_server->addFunction('Notify');

function Notify($message)
{
    return array('message' => $message);
}

$soap_server->handle();


?>

And I'm trying to create a client for the service  using this code

<?php

include 'soap_server.php';

$soap_client = new SoapClient('https://localhost:8888/Soap/Notification.wsdl', array(
                'proxy_host' => 'localhost',
                'proxy_port' => '8888',
                'local_cert' => 'APX_WS_API1.cer'  
            ));

try{
    $result = $soap_client->__soapCall('Notify',array('message' => 'Hello World'));
    echo $result;
}catch(SoapFault $e){
    echo "Error: " . $e->faultcode;
}


?>

The problem is when I run this I get could not connect to host error. If I can do this with JSONP. How can I do this with the wsdl file that I have to use? Please help?:)

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.