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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T05:09:40+00:00 2026-05-24T05:09:40+00:00

I am creating a SOAP server (in Symfony using ckWebservicePlugin) which needs to comply

  • 0

I am creating a SOAP server (in Symfony using ckWebservicePlugin) which needs to comply with the following structure of request and response (I was given this as an already agreed specification).

Request:

<?xml version="1.0" encoding="UTF-8"?> 
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://www.example.net/schemas/USSD">
  <SOAP-ENV:Header/>
  <SOAP-ENV:Body>
    <USSDMessageRequest>
      <id>43</id>
      <msid>1234567890</msid>
      <data>1*2</data>
    </USSDMessageRequest>
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>  

Reponse:

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
  <SOAP-ENV:Header/>
  <SOAP-ENV:Body>
    <USSDMessageResponse>
       <id>43</id>
       <msid>1234567890</msid>
       <data>
          RESPONSE DATA
       </data>
    </USSDMessageResponse>
</SOAP-ENV:Body>

The trouble I’m having is with SoapServer always produces the response as name of the requested method + ‘Response’ appended.

So the response XML that is being sent out looks like this:

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://bw.petr.appsdev/bw/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <SOAP-ENV:Body>
      <ns1:USSDMessageRequestResponse>
         <result>
            <id>2</id>
            <msid>1234565789</msid>
            <data>RESPONSE DATA</data>
         </result>
      </ns1:USSDMessageRequestResponse>
   </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

I would like the output to be <ns1:USSDMessageResponse> rather than <ns1:USSDMessageRequestResponse>

The WSDL I’m using looks like this:

<?xml version="1.0" encoding="utf-8"?>
<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" name="webservices" targetNamespace="http://bw.petr.appsdev/bw/" xmlns:tns="http://bw.petr.appsdev/bw/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
  <wsdl:types xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://bw.petr.appsdev/bw/">
      <xsd:complexType name="userCredentials">
        <xsd:sequence>
          <xsd:element name="msisdn" type="xsd:string"/>
          <xsd:element name="status" type="xsd:string"/>
        </xsd:sequence>
      </xsd:complexType>
      <xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="userCredentialsElement" type="tns:userCredentials"/>
      <xsd:complexType name="USSDResponse">
        <xsd:sequence>
          <xsd:element name="id" type="xsd:string"/>
          <xsd:element name="msid" type="xsd:string"/>
          <xsd:element name="data" type="xsd:string"/>
        </xsd:sequence>
      </xsd:complexType>
      <xsd:element xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="USSDResponseElement" type="tns:USSDResponse"/>
    </xsd:schema>
  </wsdl:types>
  <wsdl:portType name="webservicesPortType">
    <wsdl:operation name="USSDMessageRequest" parameterOrder="userCredentials id msid data">
      <wsdl:input message="tns:USSDMessageRequestRequest"/>
      <wsdl:output message="tns:USSDMessageResponse" name="USSDMessageResponse"/>
    </wsdl:operation>
  </wsdl:portType>
  <wsdl:binding xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" name="webservicesBinding" type="tns:webservicesPortType">
    <soap:binding xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
    <wsdl:operation xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" name="USSDMessageRequest">
      <soap:operation xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" soapAction="http://bw.petr.appsdev/bw/USSDMessageRequest" style="rpc"/>
      <wsdl:input xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
        <soap:body xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" parts="id msid data" use="literal" namespace="http://bw.petr.appsdev/bw/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
        <soap:header xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" message="tns:USSDMessageRequestRequest" part="userCredentials" use="literal" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
      </wsdl:input>
      <wsdl:output xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
        <soap:body xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" parts="result" use="literal" namespace="http://bw.petr.appsdev/bw/" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
        <soap:header xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" message="tns:USSDMessageResponse" part="userCredentials" use="literal" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
      </wsdl:output>
    </wsdl:operation>
  </wsdl:binding>
  <wsdl:message name="USSDMessageRequestRequest">
    <wsdl:part name="userCredentials" element="tns:userCredentialsElement"/>
    <wsdl:part name="id" type="xsd:string"/>
    <wsdl:part name="msid" type="xsd:string"/>
    <wsdl:part name="data" type="xsd:string"/>
  </wsdl:message>
  <wsdl:message name="USSDMessageResponse">
    <wsdl:part name="userCredentials" element="tns:userCredentialsElement"/>
    <wsdl:part name="result" type="tns:USSDResponse"/>
  </wsdl:message>
  <wsdl:service xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" name="webservicesService">
    <wsdl:port xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" name="webservicesPort" binding="tns:webservicesBinding">
      <soap:address xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" location="http://bw.petr.appsdev/bw/webservices.php"/>
    </wsdl:port>
  </wsdl:service>
</wsdl:definitions>

Have checked SoapServer documentation, browsed through Pro Xml And Web Services by R. Richards and just can’t figure out how to tell SoapServer what the response name should be.

Thank you.

  • 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-24T05:09:41+00:00Added an answer on May 24, 2026 at 5:09 am

    Try this dirty SoapVar hack:

    public function USSDMessageRequest() {
            $result = '<ns1:USSDMessageResponse> ... </ns1:USSDMessageResponse>'; // ns1 is dirty, depends on the SoapServer implementation
            $result = new SoapVar($result, XSD_ANYXML);
            return $result;
        }
    

    It has worked for me in a similar problem (I have not tested it with your web service, though).

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

Sidebar

Related Questions

I am working in ubuntu server 10.04 I am creating a test.h file which
I am successfully creating a Task using the SalesForce API SOAP API through Java.
I'm creating a web service using PHP5's native SOAP Methods. Everything went fine until
I am creating a SOAP service using JAX-WS and JAXB, by annotating the classes.
I am creating a simple SOAP web service using a SLSB and JAX-WS annotations.
I am planning to work on creating a perl webservice[using XML::Compile::SOAP] and want to
Creating Traversals for Binary Search Tree with Recursion. void inOrder(void (*inOrderPtr)(T&)) { if(this->left !=
(creating a separate question after comments on this: Javascript redeclared global variable overrides old
Creating a server-side socket will fail if I'm trying to use the same port
I'm currently in the process of creating a WCF webservice which should be compatible

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.