0

I am trying connecting PHP soap server with client written in C#. WSDL is created in that way:

$autodiscover = new Zend_Soap_AutoDiscover('Zend_Soap_Wsdl_Strategy_ArrayOfTypeComplex');
$autodiscover->setClass('Soap_Service1');
$autodiscover->handle();

then I receive:

<definitions xmlns="http://schemas.xmlsoap.org/wsdl/" 
    xmlns:tns="http://www.xx.de/soap/version/1" 
    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/" 
    targetNamespace="http://www.xx.de/soap/version/1"
    name="Soap_Services1" 
>

this 'name="Soap_Services1"' attribute parsed in C# looks ugly (Services.Soap_Services1Service). Of course name is connected with ServiceBinding and PortType. Is there any way to change it without manually hacking zend library?

tawfekov
  • 5,084
  • 3
  • 28
  • 51
mrok
  • 2,680
  • 3
  • 27
  • 46

3 Answers3

1

Yes. Just rename your service class ;)

$autodiscover->setClass('CoolServiceName');

will give you

<definitions xmlns="http://schemas.xmlsoap.org/wsdl/" 
    xmlns:tns="http://www.xx.de/soap/version/1" 
    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/" 
    targetNamespace="http://www.xx.de/soap/version/1"
    name="CoolServiceName" 
>
Tomáš Fejfar
  • 11,129
  • 8
  • 54
  • 82
0

Since you're using the autodiscover / magical soap service creator, you can't override the names it creates as-is.

If you want to do this you can extend Zend_Soap_AutoDiscover and implement your own setClass method that uses your own name choice while generating the wsdl.

Darryl E. Clarke
  • 7,537
  • 3
  • 26
  • 34
0

All you need to do is rename your service class (the one set by the setClass() call) and you're good.

Tash Pemhiwa
  • 7,590
  • 4
  • 45
  • 49