Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 679035
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T01:12:56+00:00 2026-05-14T01:12:56+00:00

I am trying to use the tranlsation webservice from MyMemory: http://mymemory.translated.net/doc/spec.php Unfortunately, Zend_Soap_Client does

  • 0

I am trying to use the tranlsation webservice from MyMemory: http://mymemory.translated.net/doc/spec.php

Unfortunately, Zend_Soap_Client does generate an XML reqest object that is not recognized by the service. I guess it is because of the ns1-Attribute (Namespace) within the tags. So does anyone know how to remove them?

That’s basically what I do:

$client = new Zend_Soap_Client('http://mymemory.translated.net/otms/?wsdl', array(
    'soap_version' => SOAP_1_1
));

Then I call the function:

try {
    $client->otmsGet(array(
        'key' => 'xxx',
            'q' => array(
                'source' => 'Computer Science',
                'source_lang' => 'en-US',
                'target_lang' => 'de-DE'
            )
        ));
} catch(Exception $e) {
    print $client->getLastRequest();
}

The resulting XML looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://tempuri.org/">
    <SOAP-ENV:Body>
        <ns1:otmsGet>
            <ns1:key>xxx</ns1:key>
            <ns1:q>
                <ns1:source>Computer Science</ns1:source>
                <ns1:source_lang>en-US</ns1:source_lang>
                <ns1:target_lang>de-DE</ns1:target_lang>
            </ns1:q>
        </ns1:otmsGet>
    </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

And it should actually look like this:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
    <SOAP-ENV:Body>
        <otmsGet xmlns="http://tempuri.org/">
            <key xmlns:SOAPSDK1="http://tempuri.org/">mmDemo123</key>
            <q xmlns:SOAPSDK2="http://tempuri.org/">
                <source>control panel</source>
                <source_lang>en-US</source_lang>
                <target_lang>es-ES</target_lang>
            </q>
        </otmsGet>
    </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

Thanks for your help!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T01:12:56+00:00Added an answer on May 14, 2026 at 1:12 am

    I had to create a wrapper:

    class My_Soap_Client_Namespace extends Zend_Soap_Client_Common {
        protected $namespace = null;
    
        function __construct($doRequestCallback, $wsdl, $options) {
                if (array_key_exists('namespace', $options)) {
                    $this->namespace = $options['namespace'];
                }
                parent::__construct($doRequestCallback, $wsdl, $options);
        }
    
        function __doRequest($request, $location, $action, $version, $one_way = null) {
            if ($this->namespace != null) {
                $request = preg_replace ( '/<ns1:(\w+)/', '<$1 xmlns="' . $this->namespace . '"', $request, 1 );
                $request = preg_replace ( '/<ns1:(\w+)/', '<$1', $request );
                $request = str_replace ( array ('/ns1:', 'xmlns:ns1="' . $this->namespace . '"' ), array ('/', '' ), $request );
            }
    
            return parent::__doRequest ( $request, $location, $action, $version );
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying use mod_rewrite to rewrite URLs from the following: http://www.site.com/one-two-file.php to http://www.site.com/one/two/file.php The
I'm trying to use a Web Service using PHP and SOAP. The Web Service
I am trying to use sample FedEx Web Service code written in VB.NET to
When trying to use a modified version of the Lisp snippet from the GNU
I'm trying to use JavaScriptCore to do some string manipulation from the terminal, but
I’m trying to use the proprietary iPhone Safari properties -webkit-transition and -webkit-transform to make
I am trying to use 2 persistence units within the same transaction in a
I'm trying to use the System.IO.Log features to build a recoverable transaction system. I
I was trying use a set of filter functions to run the appropriate routine,
I'm trying use self-signed certificate (c#): X509Certificate2 cert = new X509Certificate2( Server.MapPath(~/App_Data/myhost.pfx), pass); on

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.