I have a Drupal 6 module that provides a web service using nusoap. I can access the service with php but service can't be accessed from .net application. If I however use the same code to provide web service in Drupal 7 it can be accessed from .net application.

Here is the function providing the web service:

function _provide_nusoap_server(){

  // Pull in the NuSOAP code

  // Create the server instance
  $server = new soap_server();

  global $base_url;

  // Initialize WSDL support
  $server->configureWSDL('mynamespace', 'urn:mynamespace', $base_url.'/mysoap');

  // tämä paluuarvoille

  // Register the method
  $server->register('mysoap_addModifyProduct',      // method name
      'salasana' => 'xsd:string',
      'rekkariId' => 'xsd:int',                     // to identify event in rekisteri. Later on id can be used to update or delete certain event      
      //'op' => 'xsd:string',                       // op should be 'insert' or 'update'
      'tuotenimi' => 'xsd:string',
        'ret' => 'tns:stringArray',
      'urn:mynamespace',                      // namespace
      'urn:mynamespace#mysoap_addModifyProduct',      // soapaction
      'rpc',                                     // style
      'encoded',                                 // use
      'Adds stuff to Drupal database'            // documentation

  // Use the request to (try to) invoke the service


And here is the wsdl-file:

<?xml version="1.0" encoding="ISO-8859-1"?>
<definitions xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="urn:mynamespace" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="urn:mynamespace">
<xsd:schema targetNamespace="urn:mynamespace"
 <xsd:import namespace="http://schemas.xmlsoap.org/soap/encoding/" />
 <xsd:import namespace="http://schemas.xmlsoap.org/wsdl/" />
 <xsd:complexType name="stringArray">
   <xsd:restriction base="SOAP-ENC:Array">
    <xsd:attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="xsd:string[]"/>

<message name="mysoap_addModifyProductRequest">
  <part name="salasana" type="xsd:string" />
  <part name="rekkariId" type="xsd:int" />
  <part name="tuotenimi" type="xsd:string" /></message>
<message name="mysoap_addModifyProductResponse">
  <part name="ret" type="tns:stringArray" /></message>
<portType name="mynamespacePortType">

  <operation name="mysoap_addModifyProduct">
    <documentation>Adds stuff to Drupal database</documentation>
    <input message="tns:mysoap_addModifyProductRequest"/>
    <output message="tns:mysoap_addModifyProductResponse"/>
<binding name="mynamespaceBinding" type="tns:mynamespacePortType">
  <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
  <operation name="mysoap_addModifyProduct">

    <soap:operation soapAction="urn:mynamespace#mysoap_addModifyProduct" style="rpc"/>
    <input><soap:body use="encoded" namespace="urn:mynamespace" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></input>
    <output><soap:body use="encoded" namespace="urn:mynamespace" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/></output>
<service name="mynamespace">
  <port name="mynamespacePort" binding="tns:mynamespaceBinding">
    <soap:address location="[the url of the service]/mysoap"/>

  • Workaround for this problem is to save the wsdl -file as a physical file to the web server. The con here is that every time the service changes the wsdl-file has to be saved again.
    – jjei
    Commented Sep 1, 2011 at 10:08
  • Did you ever find a solution for this?
    – chrisjlee
    Commented Jan 23, 2012 at 21:02

1 Answer 1


Workaround for this problem is to save the wsdl -file as a physical file to the web server. The con here is that every time the service changes the wsdl-file has to be saved again.

An alternative and maybe better idea would be to use the services module http://drupal.org/project/services

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.