Webservices and Axis Target Service problem...

Use this forum for questions regarding installation, upgrading and configuration of OpenEMM

Moderator: moderator

Webservices and Axis Target Service problem...

Postby aheman » Thu Mar 11, 2010 9:37 pm

I am having some problems getting webservices to work using the php class from http://enarion.net/programming/php/openemm/. I have two seperate servers here, one with the OpenEMM program and database, and another with a php webserver that I'm attempting to use to access it.

Following the documentation in the Webservices PDF, I created a web services username and password and then ran the command

Code: Select all
./EmmCreateWSDL.sh -o ws.wsdl -l "http://192.168.2.79:8080/emm_webservice"
-n "urn:agnitas-webservice" -w ALL
org.agnitas.webservice.EmmWebService_Port


Without the line breaks of course.

I then copied the created ws.wsdl file over to /home/openemm/webapps/core/ws.wsdl

From there, I can access the file and view the xml at http://192.168.2.79:8080/ws.wsdl.

Also, it appears that running http://192.168.2.79:8080/emm_webservice displays the following results, though the link is a 404:

Code: Select all
<h2>And now... Some Services</h2>
<ul>
<li>urn:agnitas-webservice <a href="http://192.168.2.79:8080/services/urn:agnitas-webservice?wsdl"><i>(wsdl)</i></a></li>
<ul>
<li>sendMailing
<li>newEmailMailing
<li>insertContent
<li>deleteContent
<li>addSubscriber
<li>getSubscriber
<li>findSubscriber
<li>deleteSubscriber
<li>setSubscriberBinding
<li>newEmailMailingWithReply

<li>updateEmailMailing
<li>getSubscriberBinding
<li>updateSubscriber
</ul>
</ul>


When I attempt to run this from php with the following code, I get the error below:

Code: Select all
<?
include('OpenEMM.php');
$openemm = new OpenEMM('http://192.168.2.79:8080/ws.wsdl', 'marketing', 'success');
var_dump($openemm->getSubscriber(17));
?>


Code: Select all
Fatal error: Uncaught SoapFault exception: [ns1:Server.NoService] The AXIS engine could not find a target service to invoke! targetService is null


The code in the php class that was called was simply:

Code: Select all
   public function getSubscriber($subscriber_id) {
      $params = array (
         'in0' => $this->loginCredential['login'],
         'in1' => $this->loginCredential['password'],
         'in2' => $subscriber_id
      );
      $soapResult = $this->soapClient->__soapCall('getSubscriber', $params);
      // TODO check + validate result
      return $this->__generateArrayFromSOAPResult($soapResult->paramNames->x, $soapResult->paramValues->x);
   }


When I direct a browser window to http://192.168.2.79:8080/emm_webservice ... Subscriber I get:

Code: Select all
<soapenv:Envelope>
−
<soapenv:Body>
−
<soapenv:Fault>
<faultcode>ns1:Server.NoService</faultcode>
−
<faultstring>
The AXIS engine could not find a target service to invoke!  targetService is null
</faultstring>
−
<detail>
<ns2:hostname>scktdb2.socket.net</ns2:hostname>
</detail>
</soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>


I've read through a number of threads and a lot of googling has turned up some ideas, but not much I've been able to do. I was wondering if there are any specific problems with attempting to run this from another server, or if it's possible that I'm missing something glaringly obvious like needing to set up Axis in java or potentially modify any source code.

Thanks in advance if anyone can offer any help.
aheman
 
Posts: 7
Joined: Thu Mar 11, 2010 9:24 pm

Postby aheman » Mon Mar 15, 2010 9:33 pm

After working for some time (and upgrading to 6.0.1) I'm now able to use all of the webservices in the API for 5.5.1 but nothing new that was added in 6.0.0 (the add/delete mailing list options).

Also when I attempt to run the commands from linux using the .sh script, I'm getting java errors for an index out of bounds exception on line 13. Any ideas?
aheman
 
Posts: 7
Joined: Thu Mar 11, 2010 9:24 pm

Postby aheman » Tue Mar 16, 2010 4:01 pm

Looking at the source, the problem appears to be as simple as an array that's not large enough. On line 41 of EmmWebServiceBindingStub.java an array is declared of size 13, and on line 266 something gets declared as 14.

Now trying to recompile this with the fix...
aheman
 
Posts: 7
Joined: Thu Mar 11, 2010 9:24 pm

Postby maschoff » Tue May 04, 2010 8:24 am

Is "index out of bounds exception" gone now?
OpenEMM Maintainer
maschoff
Site Admin
 
Posts: 2129
Joined: Thu Aug 03, 2006 10:20 am
Location: Munich, Germany


Return to Installation & Upgrades

Who is online

Users browsing this forum: Yahoo [Bot] and 2 guests

cron