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 7039651
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T01:49:28+00:00 2026-05-28T01:49:28+00:00

I have a SOAP service I am calling with PHP 5.3.1’s builtin SoapClient. The

  • 0

I have a SOAP service I am calling with PHP 5.3.1’s builtin SoapClient. The first operation I must perform on the service is a custom authentication operation, and one of the required parameters I must pass is a 3DES encrypted string which I am creating using PHP’s mcrypt, like so:

$encryptionKey        = '1234myKey1234';
$currentFormattedDate = date ("Y/m/d H:i");
$encryptedString      = mcrypt_encrypt('tripledes', $encryptionKey, $currentFormattedDate, 'ecb');

If I try to just pass $encryptedString as I get it from mcrypt_encrypt() I get a fatal error on my side and no call is made:

Fatal error: SOAP-ERROR: Encoding: string ‘d\xe0…’ is not a valid utf-8 string in /path/to/file

However if I utf8_encode() the string as such:

$encryptedString = utf8_encode($encryptedString)

Then the call is made but their webservice responds with the following error:

The formatter threw an exception while trying to deserialize the message: There was an error while trying to deserialize parameter http://tempuri.org/:argStatusDate. The InnerException message was ‘There was an error deserializing the object of type System.String. The byte 0x19 is not valid at this location. Line 2, position 318.’.

This is the closest I can get to success with this process after having tried so many things that I’m back to square one. I have verified I can just pass a bogus string which results in the expected response of not being able to authenticate.

I don’t think this should make any difference since I believe the SOAP call is ultimately made as utf8, but I have tried setting ‘encoding’ => ‘ISO-8859-1’ when constructing my SoapClient in PHP and I get the same error. The call is made but the server responds with the deserialization error.

Does anyone know a better way for me to treat this encrypted string that will please both my PHP client and their .Net webservice?

Maybe the problem is on their end?

FWIW, I can also request that we change the encryption method to “Rijndael AES Block Cypher” per their documentation. Not sure if that would result in an easier to handle string.

  • 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-28T01:49:28+00:00Added an answer on May 28, 2026 at 1:49 am

    You probably need to encode the data in a base 64 encoded CDATA segment inside the opening and closing tags. You might want to ask the creater of the service for a sample, or – if it is a webservice – try to download the definition or even create a client through discovery. Note that the last link was found using Google search, I’ve been out of PHP for a while.

    [EDIT] changing the cipher won’t help for this, although anything is better than ECB encoding XML

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have application consuming a SOAP service that uses transport-level authentication. We are trying
i am calling a web service using SOAP and web service is returning one
I Have an internal SOAP Web service that is being called from an external
I have a complex RIA client that communicates with a WCF SOAP web service,
I have been studying SOAP and WSDL in preparation for implementing a web service.
I have to use several SOAP messages to get data from a web service.
I have an ASP.NET web service running that accepts both HTTP POST and SOAP
I have a WCF service with three methods. Two of the methods return custom
I'm testing calling a SOAP based service from a .net client app and am
The scenario is around calling an external SSL SOAP web service from within Mirth.

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.