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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T03:25:22+00:00 2026-05-22T03:25:22+00:00

I have a webservice, written in PHP, which I want to consume in a

  • 0

I have a webservice, written in PHP, which I want to consume in a .NET application. I have used the standard SoapServer implementation of PHP, with a selfwritten WSDL file. Here is the WSDL file:

<?xml version="1.0"?>
<definitions name="Calculator"
             targetNamespace="urn:Calculator"
             xmlns:tns="urn:Calculator"
             xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
             xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" 
             xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" 
             xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" 
             xmlns="http://schemas.xmlsoap.org/wsdl/">

    <!-- Definition of types used in the WSDL http://localhost/services/wsdl/CalculatorService.wsdl -->
    <types>
        <xsd:schema xmlns="http://www.w3.org/2001/XMLSchema" targetNameSpace="urn:Calculator">
            <xsd:element name="Reflect" type="xsd:string" />
            <xsd:element name="ReflectResponse" type="xsd:string" />
            <xsd:element name="GimmePiResponse" type="xsd:float" />
        </xsd:schema>
    </types>

    <!-- Abstract definition of the data being transmitted in -->
    <message name="CalculatorService_Reflect_InputMessage">
        <part name="stringToEcho" element="tns:Reflect" />
    </message>

    <!-- Abstract definition of the data being transmitted out -->
    <message name="CalculatorService_Reflect_OutputMessage">
        <part name="return" element="tns:ReflectResponse" />
    </message>

    <message name="CalculatorService_GimmePi_OutputMessage">
        <part name="return" element="tns:GimmePiResponse" />
    </message>

    <!-- A set of abstract operations referring to input and output messages -->
    <portType name="CalculatorServiceOperations">
        <operation name="Reflect">
            <input message="tns:CalculatorService_Reflect_InputMessage" />
            <output message="tns:CalculatorService_Reflect_OutputMessage" />
        </operation>
        <operation name="GimmePi">
            <output message="tns:CalculatorService_GimmePi_OutputMessage" />
        </operation>
    </portType>

    <!-- Concrete protocol and data format specifications -->
    <binding name="HttpBinding_CalculatorService" type="tns:CalculatorServiceOperations">
        <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
        <operation name="Reflect">
            <soap:operation soapAction="urn:ReflectAction"/>
            <input>
                <soap:body use="encoded" namespace="urn:Calculator" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
            </input>
            <output>
                <soap:body use="encoded" namespace="urn:Calculator" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
            </output>
        </operation>
        <operation name="GimmePi">
            <soap:operation soapAction="urn:GimmePiAction"/>
            <output>
                <soap:body use="encoded" namespace="urn:Calculator" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
            </output>
        </operation>
    </binding>

    <!-- Specifies location and bindings for a service -->
    <service name="CalculatorService">
        <port name="CalculatorServiceOperations" binding="tns:HttpBinding_CalculatorService">
            <soap:address location="http://localhost/services/CalculatorService.php" />
        </port>
    </service>
</definitions>

Along with that I have the following webservice implementation:

<?php
if (!extension_loaded("soap"))
{
    dl("php_soap.dll");
}

ini_set("soap.wsdl_cache_enabled", "0");
$server = new SoapServer("CalculatorService.wsdl");

function GimmePi()
{
    return 3.14;
}

function Reflect($stringToEcho)
{
    return $stringToEcho;
}

$server->AddFunction("GimmePi");
$server->AddFunction("Reflect");

$server->handle();
?>

If I communicate with this service using SoapUI, it works like a charm, methods get called and return what they are supposed to.

Now I am trying to consume the same webservice in a .NET application, but for some reason, it does not generate the proxy class and I am not able to use it.

Does anyone has had this problem before or knows how to deal with it?

  • 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-22T03:25:22+00:00Added an answer on May 22, 2026 at 3:25 am

    that WSDL looks to be rpc/encoding rather than document/literal. These don’t behave as expected with the DataContractSerialiser.

    you should try svcutil to generate the .cs from there. more options.

    if you can host the php service online and point me to a wsdl, i’d be happy to try.

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

Sidebar

Related Questions

I have some code I've written in PHP for consuming our simple webservice, which
I have to implement a webservice which will be used by different clients written
I have a .NET webservice and a client program which was written by C++.
I have written a webservice using the PHP SOAP classes. It has functions to
I have C# Client application calling Windows webservice written in WCF calling Sql Procedure
I have a .NET WebService (written in C#), that is supposed to serve people
hey guys i have written a small webservice which allows users of a company
I have a webservice written in Yii (php framework). I use C# and Visual
Below i have written code of a soap webservice in php with its client,It
I have an asp.net .asmx webservice written to handle requests from a third party

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.