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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T06:37:27+00:00 2026-05-15T06:37:27+00:00

I am new in web services so apologize me if I am making some

  • 0

I am new in web services so apologize me if I am making some cardinal mistake here, hehe.

I have built SOAP service using PHP. Service is SOAP 1.2 compatible, and I have WSDL available. I have enabled sessions, so that I can track login status, etc.

I don’t need some super security here (ie message-level security), all I need is transport security (HTTPS), since this service will be used infrequently, and performances are not so much of an issue.

I am having difficulties making it to work at all. C# throws some unclear exception (“Server returned an invalid SOAP Fault. Please see InnerException for more details.”, which in turn says “Unbound prefix used in qualified name ‘rpc:ProcedureNotPresent’.”), but consuming service using PHP SOAP client behaves as expected (including session and all).

So far, I have following code. note: due to amount of real code, I am posting minimal code configuration

PHP SOAP server (using Zend Soap Server library), including class(es) exposed via service:

<?php

class Verification_LiteralDocumentProxy {

    protected $instance;

    public function __call($methodName, $args)
    {
        if ($this->instance === null)
        {
            $this->instance = new Verification();
        }

        $result = call_user_func_array(array($this->instance, $methodName), $args[0]);
        return array($methodName.'Result' => $result);
    }
}

class Verification {

    private $guid = '';
    private $hwid = '';

    /**
    * Initialize connection
    *
    * @param string GUID
    * @param string HWID
    * @return bool
    */
    public function Initialize($guid, $hwid)
    {
        $this->guid = $guid;
        $this->hwid = $hwid;
        return true;
    }

    /**
    * Closes session
    *
    * @return void
    */
    public function Close()
    {
        // if session is working, $this->hwid and $this->guid
        // should contain non-empty values
    }
}

// start up session stuff
$sess = Session::instance();

require_once 'Zend/Soap/Server.php';
$server = new Zend_Soap_Server('https://www.somesite.com/api?wsdl');

$server->setClass('Verification_LiteralDocumentProxy');

$server->setPersistence(SOAP_PERSISTENCE_SESSION);

$server->handle();

WSDL:

<definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="https://www.somesite.com/api" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap-enc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" name="Verification" targetNamespace="https://www.somesite.com/api">
    <types>
        <xsd:schema targetNamespace="https://www.somesite.com/api">
            <xsd:element name="Initialize">
                <xsd:complexType>
                    <xsd:sequence>
                        <xsd:element name="guid" type="xsd:string"/>
                        <xsd:element name="hwid" type="xsd:string"/>
                    </xsd:sequence>
                </xsd:complexType>
            </xsd:element>
            <xsd:element name="InitializeResponse">
                <xsd:complexType>
                    <xsd:sequence>
                        <xsd:element name="InitializeResult" type="xsd:boolean"/>
                    </xsd:sequence>
                </xsd:complexType>
            </xsd:element>
            <xsd:element name="Close">
                <xsd:complexType/>
            </xsd:element>
        </xsd:schema>
    </types>
    <portType name="VerificationPort">
        <operation name="Initialize">
            <documentation>
                Initializes connection with server</documentation>
            <input message="tns:InitializeIn"/>
            <output message="tns:InitializeOut"/>
        </operation>
        <operation name="Close">
            <documentation>
                Closes session between client and server</documentation>
            <input message="tns:CloseIn"/>
        </operation>
    </portType>
    <binding name="VerificationBinding" type="tns:VerificationPort">
        <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
        <operation name="Initialize">
            <soap:operation soapAction="https://www.somesite.com/api#Initialize"/>
            <input>
                <soap:body use="literal"/>
            </input>
            <output>
                <soap:body use="literal"/>
            </output>
        </operation>
        <operation name="Close">
            <soap:operation soapAction="https://www.somesite.com/api#Close"/>
            <input>
                <soap:body use="literal"/>
            </input>
            <output>
                <soap:body use="literal"/>
            </output>
        </operation>
    </binding>
    <service name="VerificationService">
        <port name="VerificationPort" binding="tns:VerificationBinding">
            <soap:address location="https://www.somesite.com/api"/>
        </port>
    </service>
    <message name="InitializeIn">
        <part name="parameters" element="tns:Initialize"/>
    </message>
    <message name="InitializeOut">
        <part name="parameters" element="tns:InitializeResponse"/>
    </message>
    <message name="CloseIn">
        <part name="parameters" element="tns:Close"/>
    </message>
</definitions>

And finally, WCF C# consumer code:

[ServiceContract(SessionMode = SessionMode.Required)]
public interface IVerification
{
    [OperationContract(Action = "Initialize", IsInitiating = true)]
    bool Initialize(string guid, string hwid);

    [OperationContract(Action = "Close", IsInitiating = false, IsTerminating = true)]
    void Close();
}

class Program
{
    static void Main(string[] args)
    {
        WSHttpBinding whb = new WSHttpBinding(SecurityMode.Transport, true);

        ChannelFactory<IVerification> cf = new ChannelFactory<IVerification>(
            whb, "https://www.somesite.com/api");

        IVerification client = cf.CreateChannel();

        Console.WriteLine(client.Initialize("123451515", "15498518").ToString());
        client.Close();
    }
}

Any ideas? What am I doing wrong here?

  • 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-15T06:37:28+00:00Added an answer on May 15, 2026 at 6:37 am

    Have you tried generating a client proxy from the wsdl? Either a local copy with the data contracts (XML Schemas) or the hosted wsdl.

    You should be able to create a simple C# Console Application, perform an ‘Add Service Reference…’ on the wsdl and create a proxy. The client code will be automatically generated and the app.config will contain your binding information and endpoint.

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

Sidebar

Related Questions

I'm new in web services. I have faced some problem. At the server side
I'm relatively new to web services. I dont know how this web service will
I'm actually working on a website project. I'm new with web services. I have
We just started a new ASP.Net project that uses web services to serialize some
I am totally new to Spring Web Services and so what concept should I
I'm learning about web services and most of the resources I've been reading talk
I'm in the unfortunate situation where I need to consume web services that do
Our system communicates with several web services providers. They are all invoked from a
pretty straightforward question: Is there a good web services solution for Joomla1.5+? I've been
I have a .Net 3.5 class library project that I've migrated to use Visual

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.