SOAP reference binding cannot access BASIC/NTLM-protected WSDL getting 401 response code

Solution Verified - Updated -

Issue

  • We have been trying to invoke SOAP service through FSW. The scenario is that we read message from a file and want to pass that message to SAP WS.
  • The problem we face is that we are not able to pass authentication credentials which are required for WS invocation and interface deployment fails with errors.
  • The credentials provided inside <soap:basic> element are not used during authentication and we get the errors as follows:
12:26:35,919 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-8) MSC000001: Failed to start service jboss.deployment.unit."myapp-0.0.1-SNAPSHOT.jar".SwitchYardService: org.jboss.msc.service.StartException in service jboss.deployment.unit."myapp-0.0.1-SNAPSHOT.jar".SwitchYardService: org.switchyard.component.soap.WebServiceConsumeException: javax.wsdl.WSDLException: WSDLException: faultCode=OTHER_ERROR: SWITCHYARD035405: Unable to read WSDL at http://sap.example.com:8000/sap/bc/srt/wsdl/srvc_xxxxx/wsdl11/allinone/standard/document?sap-client=100: java.io.IOException: Server returned HTTP response code: 401 for URL: http://sap.example.com:8000/sap/bc/srt/wsdl/srvc_xxxxx/wsdl11/allinone/standard/document?sap-client=100
    at org.switchyard.as7.extension.services.SwitchYardService.start(SwitchYardService.java:80)
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811) [jboss-msc-1.0.4.GA-redhat-1.jar:1.0.4.GA-redhat-1]
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746) [jboss-msc-1.0.4.GA-redhat-1.jar:1.0.4.GA-redhat-1]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_55]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_55]
    at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_55]
Caused by: org.switchyard.component.soap.WebServiceConsumeException: javax.wsdl.WSDLException: WSDLException: faultCode=OTHER_ERROR: SWITCHYARD035405: Unable to read WSDL at http://sap.example.com:8000/sap/bc/srt/wsdl/srvc_xxxxx/wsdl11/allinone/standard/document?sap-client=100: java.io.IOException: Server returned HTTP response code: 401 for URL: http://sap.example.com:8000/sap/bc/srt/wsdl/srvc_xxxxx/wsdl11/allinone/standard/document?sap-client=100
    at org.switchyard.component.soap.OutboundHandler.doStart(OutboundHandler.java:211)
    at org.switchyard.deploy.BaseServiceHandler.start(BaseServiceHandler.java:60)
    at org.switchyard.deploy.internal.Deployment.deployReferenceBindings(Deployment.java:310)
    at org.switchyard.deploy.internal.Deployment.start(Deployment.java:143)
    at org.switchyard.as7.extension.deployment.SwitchYardDeployment.start(SwitchYardDeployment.java:101)
    at org.switchyard.as7.extension.services.SwitchYardService.start(SwitchYardService.java:73)
    ... 5 more
Caused by: javax.wsdl.WSDLException: WSDLException: faultCode=OTHER_ERROR: SWITCHYARD035405: Unable to read WSDL at http://sap.example.com:8000/sap/bc/srt/wsdl/srvc_xxxxx/wsdl11/allinone/standard/document?sap-client=100: java.io.IOException: Server returned HTTP response code: 401 for URL: http://sap.example.com:8000/sap/bc/srt/wsdl/srvc_xxxxx/wsdl11/allinone/standard/document?sap-client=100
    at org.switchyard.component.soap.util.WSDLUtil.readWSDL(WSDLUtil.java:152)
    at org.switchyard.component.soap.OutboundHandler.doStart(OutboundHandler.java:100)
    ... 10 more
Caused by: java.io.IOException: Server returned HTTP response code: 401 for URL: http://sap.example.com:8000/sap/bc/srt/wsdl/srvc_xxxxx/wsdl11/allinone/standard/document?sap-client=100
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1626) [rt.jar:1.7.0_55]
    at java.net.URL.openStream(URL.java:1037) [rt.jar:1.7.0_55]
    at org.switchyard.component.soap.util.WSDLUtil.readWSDL(WSDLUtil.java:143)
    ... 11 more
  • The reference binding of the switchyard.xml looks like this:
    <sca:reference name="SapServiceOut" multiplicity="0..1" promote="Route/SapServiceOut">
      <sca:interface.java interface="com.example.switchyard.myapp.SapServiceOut"/>
      <soap:binding.soap name="soap1">
        <soap:contextMapper/>
        <soap:wsdl>http://sap.example.com:8000/sap/bc/srt/wsdl/srvc_xxxxx/wsdl11/allinone/standard/document?sap-client=100</soap:wsdl>
        <soap:wsdlPort>binding</soap:wsdlPort>
        <soap:endpointAddress>http://sap.example.com:8000/sap/bc/srt/rfc/sap/xxxxx/100/service/binding</soap:endpointAddress>
        <soap:basic>
          <soap:user>sap_user</soap:user>
          <soap:password>Password</soap:password>
        </soap:basic>
      </soap:binding.soap>
    </sca:reference>

Environment

  • Red Hat JBoss Fuse Service Works (FSW)
    • 6.0.0

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.