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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T11:06:33+00:00 2026-05-26T11:06:33+00:00

I’m trying to make an PHP Client for an WCF Webservice. But i get

  • 0

I’m trying to make an PHP Client for an WCF Webservice. But i get some Errors when i call the functions of the service.

App.config

<system.serviceModel>
<services>
  <service behaviorConfiguration="MyServiceBehavior"
           name="GSC.Wcf.Services.CartService">
    <endpoint address=""
              binding="basicHttpBinding"
              contract="GSC.Wcf.Services.ICartService">
      <identity>
        <dns value="localhost" />
      </identity>
    </endpoint>
    <endpoint address="mex" binding="mexHttpBinding"
              contract="IMetadataExchange" />
    <host>
      <baseAddresses>
        <add baseAddress="http://localhost:8731/CartService" />
      </baseAddresses>
    </host>
  </service>
</services>
<behaviors>
  <serviceBehaviors>
    <behavior name="MyServiceBehavior">
      <serviceMetadata httpGetEnabled="True"/>
      <serviceDebug includeExceptionDetailInFaults="False" />
    </behavior>
  </serviceBehaviors>
</behaviors>

Function:

> public int Addiere(int a, int b)
        {
            return a + b;
        }

PHP-Request:

> $client = new SoapClient("http://localhost:8731/CartService?wsdl");
>
> $result = $client->Addiere(2,4);

for these function i get an Error like that:

“Uncaught SoapFault exception: [a:DeserializationFailed] the
Formatierer formatter has realeased an exception during the
deserilization of the message: Failed to deserialize the request body
of the message is intended for operation “Addiere”. The end-element
“Body” aus Namespace “http://schemas.xmlsoap.org/soap/envelope/&#8221; was
expected. Found was the element “param1″ of Namespace””.

In German:

Fatal error: Uncaught SoapFault exception: [a:DeserializationFailed]
Der Formatierer hat beim Deserialisieren der Nachricht eine Ausnahme
ausgelöst: Fehler beim Deserialisieren des Textkörpers der
Anforderungsnachricht für Vorgang “Addiere”. Es wurde das Endelement
“Body” aus Namespace “http://schemas.xmlsoap.org/soap/envelope/&#8221;
erwartet. Gefunden wurde “Element “param1” aus Namespace “””. Zeile 2,
Position 148. in C:\xampp\htdocs\TestClient\Client.php:6 Stack trace:
0 C:\xampp\htdocs\TestClient\Client.php(6): SoapClient->__call(‘Addiere’, Array) #1
C:\xampp\htdocs\TestClient\Client.php(6): SoapClient->Addiere(2, 4) #2
{main} thrown in C:\xampp\htdocs\TestClient\Client.php on line 6

But this function is working:

C#

> public string Message()
        {
            return "WORD";
        }

PHP

> $result = $client->Message();
var_dump($result);

result

object(stdClass)#2 (1) { [“MessageResult”]=> string(4) “WORD” } WORD

the only problem is that the return type is no string.

Can anybody guess whats wrong, or shell i post some more stuff like wsdl ?
Or does anybody knows good sources where i can look up how i can get the right konfigurations to communicate with my service ?

  • 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-26T11:06:34+00:00Added an answer on May 26, 2026 at 11:06 am

    Problem solved.

    When calling a method with more than 2 Parameters you need to put them in an array like this

    $result = $client->Addiere(array("a" => 2, "b" => 3))->AddiereResult;

    and the otherProblem was the return typ, this is solved with

    ....->AddiereResult;
    

    not sure what the last part means but it works i will figure this out.

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

Sidebar

Related Questions

I want to count how many characters a certain string has in PHP, but
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I'm trying to create an if statement in PHP that prevents a single post
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am trying to understand how to use SyndicationItem to display feed which is
Basically, what I'm trying to create is a page of div tags, each has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I would like to count the length of a string with PHP. The string
For some reason, after submitting a string like this Jack’s Spindle from a text

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.