cancel
Showing results for 
Search instead for 
Did you mean: 

[WSDL] SOAP-ERROR: Parsing WSDL: Couldn't bind to service

former_member204618
Active Contributor
0 Kudos

Hi All

Having tried out the blog here :-

I am getting the error :-

Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL: Couldn't bind to service in

Now I have followed the instructions almost to the letter except for the function name and web service name.

I can view the wsdl generated and have even used the file directly but the same error occurs.

I am using php 5.2.6.

I am trying this out in the NW 7.01 Trail Version.

Can someone shed some light on the problem please ?

Thanks

Craig

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

hi,

it would help a little if you posted the WSDL. I think the problem is due to the fact that you use some kind of WSDL that doesn't have a binding defined (SAP calls it 'Port Type WSDL') or you have an unusual binding defined or something...

your WSDL is supposed to contain something like

<wsdl:binding name="SOME_NAME" type="tns:FUNCTION_NAME">
  <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
    <wsdl:operation name="ZDoSomething">
      <soap:operation soapAction="" style="document"/>
      <wsdl:input>
        <soap:body use="literal"/>
      </wsdl:input>
      <wsdl:output>
        <soap:body use="literal"/>
      </wsdl:output>
    </wsdl:operation>
</wsdl:binding>

if it doesn't you have the port type WSDL...

anton

Edited by: Anton Wenzelhuemer on Sep 29, 2008 2:40 PM

former_member204618
Active Contributor
0 Kudos

Anton, thanks for coming back to me.

Here is the WSDL :-


<wsdl:definitions targetNamespace="urn:sap-com:document:sap:soap:functions:mc-style">
    <wsdl:documentation>
       <sidl:sidl/>
    </wsdl:documentation>
    <wsdl:types>
      <xsd:schema attributeFormDefault="qualified" targetNamespace="urn:sap-com:document:sap:soap:functions:mc-style">
         <xsd:element name="YtwFub1">
            <xsd:complexType>
              <xsd:sequence>
                <xsd:element name="PIn" type="xsd:string"/>
              </xsd:sequence> 
            </xsd:complexType>
         </xsd:element>
         <xsd:element name="YtwFub1Response">
           <xsd:complexType>
             <xsd:sequence>
               <xsd:element name="POut" type="xsd:string"/>
             </xsd:sequence>
           </xsd:complexType>
         </xsd:element>
       </xsd:schema>
     </wsdl:types>
     <wsdl:message name="YtwFub1">
       <wsdl:part name="parameters" element="tns:YtwFub1"/>
     </wsdl:message>
     <wsdl:message name="YtwFub1Response">
       <wsdl:part name="parameter" element="tns:YtwFub1Response"/>
     </wsdl:message>
     <wsdl:portType name="YTW_FUB1">
        <wsdl:operation name="YtwFub1">
          <wsdl:input message="tns:YtwFub1"/>
          <wsdl:output message="tns:YtwFub1Response"/>
        </wsdl:operation>
     </wsdl:portType>
</wsdl:definitions>

Thanks

Craig

Edited by: Craig Armstead on Sep 29, 2008 7:32 PM

Former Member
0 Kudos

Craig,

according to what I said earlier and what we see here, you have the porttype WSDL. go to SOAMANAGER, create an endpoint for your service and choose 'get WSDL for selected binding' selecting the binding just created.

unfortunately my blog is a bit outdated and so it doesn't cover the more recent transaction SOAMANAGER and the way to create endpoints and find the correct WSDL with it.

in short it's still simple:

1) create the function module

2) run the webservice wizard

3) go to tx SOAMANAGER,create a binding

4) find the WSDL for this binding

( 5) replace 'ws_policy' in the URL by 'standard')

give it a try and come back if you don't get it going.

cheers, anton

former_member204618
Active Contributor
0 Kudos

Anton,

That seems to have worked here my WDSL but from a very strange url (http://localhost:8000/sap/bc/srt/wsdl/bndg_DD8E638320BEC3F189ED080027583E1A/wsdl11/allinone/standard/document?sap-client=001)


  <?xml version="1.0" encoding="utf-8" ?> 
- <wsdl:definitions targetNamespace="urn:sap-com:document:sap:soap:functions:mc-style" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="urn:sap-com:document:sap:soap:functions:mc-style">
- <wsdl:documentation>
  <sidl:sidl xmlns:sidl="http://www.sap.com/2007/03/sidl" /> 
  </wsdl:documentation>
- <wsdl:types>
- <xsd:schema attributeFormDefault="qualified" targetNamespace="urn:sap-com:document:sap:soap:functions:mc-style">
- <xsd:element name="YtwFub1">
- <xsd:complexType>
- <xsd:sequence>
  <xsd:element name="PIn" type="xsd:string" /> 
  </xsd:sequence>
  </xsd:complexType>
  </xsd:element>
- <xsd:element name="YtwFub1Response">
- <xsd:complexType>
- <xsd:sequence>
  <xsd:element name="POut" type="xsd:string" /> 
  </xsd:sequence>
  </xsd:complexType>
  </xsd:element>
  </xsd:schema>
  </wsdl:types>
- <wsdl:message name="YtwFub1">
  <wsdl:part name="parameters" element="tns:YtwFub1" /> 
  </wsdl:message>
- <wsdl:message name="YtwFub1Response">
  <wsdl:part name="parameter" element="tns:YtwFub1Response" /> 
  </wsdl:message>
- <wsdl:portType name="YTW_FUB1">
- <wsdl:operation name="YtwFub1">
  <wsdl:input message="tns:YtwFub1" /> 
  <wsdl:output message="tns:YtwFub1Response" /> 
  </wsdl:operation>
  </wsdl:portType>
- <wsdl:binding name="YTW_FUB1" type="tns:YTW_FUB1">
  <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" /> 
- <wsdl:operation name="YtwFub1">
  <soap:operation soapAction="" style="document" /> 
- <wsdl:input>
  <soap:body use="literal" /> 
  </wsdl:input>
- <wsdl:output>
  <soap:body use="literal" /> 
  </wsdl:output>
  </wsdl:operation>
  </wsdl:binding>
- <wsdl:service name="service">
- <wsdl:port name="YTW_FUB1" binding="tns:YTW_FUB1">
  <soap:address location="http://localhost:8000/sap/bc/srt/rfc/sap/ytw_fub1/001/ytw_fub1/ytw_fub1" /> 
  </wsdl:port>
  </wsdl:service>
  </wsdl:definitions>

Does this look correct ?

I tried using this in the PHP but now instead of the error I get nothing at all !

Just this :-


<HTML><HEAD><TITLE>soap 1</TITLE></HEAD>
<BODY>

</BODY></HTML>

Any ideas ?

Thanks

Craig

Former Member
0 Kudos

hi,

in my opinion the WSDL looks good now, but it's hard to tell from a distance where you're stuck now.

I'd try

1) turning on PHP debugging if you haven't yet.

2) have a look at the ABAP side, transaction ST11, latest dev_rfc file, see if the request arrived and has been served

3) add var_dump($client) to see the contents of the client-object

...

anton

former_member204618
Active Contributor
0 Kudos

Anton,

Here's is the result of var_dump :-

object(SoapClient)#1 (6) { ["_login"]=> string(6) "bcuser" ["_password"]=> string(7) "minisap" ["trace"]=> int(1) ["_exceptions"]=> bool(false) ["_soap_version"]=> int(1) ["sdl"]=> resource(4) of type (Unknown) }

I have looked at the latest dev_rfc files and nothing mentioned in them about any connection.

Could this have anything to do with the fact I am not connecting via PHP locally ?

Thanks for your help.

Craig