Replacing the deprecated https:outbound-endpoint with http:request in Mule - web-services

I was using the following configuration to hit a SOAP based service in mule 3.2, which works fine
<https:connector name="https" doc:name="HTTP\HTTPS"></https:connector>
<https:outbound-endpoint exchange-pattern="request-response" method="POST"
address="https://localhost:8080/CXF3Service/test" responseTimeout="15000" contentType="application/xml"
doc:name="HTTP Submit Request SOAP" connector-ref="https"> <message-properties-transformer
scope="outbound"> <add-message-property key="SOAPAction" value="https://myservice/myEndpoint"
/> </message-properties-transformer> </https:outbound-endpoint>
SOAP Binding in wsdl will look like,
<wsdl:operation name="sayHello">
<soap:operation soapAction="https://myservice/myEndpoint" style="document"/>
<wsdl:input name="sayHello">
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output name="sayHelloResponse">
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
On migrating to Mule 3.6, i replaced the code as follows. this was done to replace the deprecated https:outbound-endpoint with http:request
<http:request-config name="http" protocol="HTTPS"
host="localhost" port="8080"
doc:name="HTTP Request Configuration"/>
<http:request config-ref="http" path="CXF3Service/test" method="POST"
doc:name="HTTP" responseTimeout="15000" >
<http:request-builder>
<http:header headerName="SOAPAction" value="https://myservice/myEndpoint" ></http:header>
</http:request-builder>
<http:success-status-code-validator
values="0..599" />
</http:request>
But on hitting the service with new code, i am getting a SOAP Fault as response.
<?xml version="1.0" encoding="UTF-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<soap:Fault>
<faultcode>soap:Client</faultcode>
<faultstring>Server did not recognize the value of HTTP Header SOAPAction: https://myservice/myEndpoint, "".</faultstring>
<detail/>
</soap:Fault>
</soap:Body>
</soap:Envelope>
What could be the possible reason for this?
FYI. I am using a cxf:proxy-client with payload as envelope, which remains unchanged for both.
<cxf:proxy-client payload="envelope" doc:name="Proxy client">
<cxf:inInterceptors>
<spring:bean class="org.apache.cxf.interceptor.LoggingInInterceptor">
<spring:property name="prettyLogging" value="true" />
</spring:bean>
</cxf:inInterceptors>
<cxf:outInterceptors>
<spring:bean class="org.apache.cxf.interceptor.LoggingOutInterceptor">
<spring:property name="prettyLogging" value="true" />
</spring:bean>
</cxf:outInterceptors>
<cxf:outFaultInterceptors>
<spring:bean class="org.apache.cxf.interceptor.LoggingOutInterceptor">
<spring:property name="prettyLogging" value="true" />
</spring:bean>
</cxf:outFaultInterceptors>
</cxf:proxy-client>

Small tweak did the magic!!
I set the SOAPAction before the http:request instead of setting it inside.
<cxf:proxy-client payload="envelope" doc:name="Proxy client">
<cxf:inInterceptors>
<spring:bean class="org.apache.cxf.interceptor.LoggingInInterceptor">
<spring:property name="prettyLogging" value="true" />
</spring:bean>
</cxf:inInterceptors>
<cxf:outInterceptors>
<spring:bean class="org.apache.cxf.interceptor.LoggingOutInterceptor">
<spring:property name="prettyLogging" value="true" />
</spring:bean>
</cxf:outInterceptors>
<cxf:outFaultInterceptors>
<spring:bean class="org.apache.cxf.interceptor.LoggingOutInterceptor">
<spring:property name="prettyLogging" value="true" />
</spring:bean>
</cxf:outFaultInterceptors>
</cxf:proxy-client>
<message-properties-transformer>
<add-message-property key="SOAPAction" value="https://myservice/myEndpoint"/>
</message-properties-transformer>
<http:request config-ref="http" path="CXF3Service/test" method="POST"
doc:name="HTTP" responseTimeout="15000" >
<http:success-status-code-validator
values="0..599" />
</http:request>

Related

how to make my WCF sends specific WS-Security (Apache CXF 2.6)

I must make my WCF Client consume a web service and sign/encrypt the request using Web Services Axis 1.4 a Apache CXF 2.6.
So far I have created a custom binding and I've added ProtectionLevel=Net.Security.ProtectionLevel.Sign in my contract atributte and "think" I am working along the right lines.
This is my .config:
<system.serviceModel>
<behaviors>
<endpointBehaviors>
<behavior name="ComportamientoCertificadosREA">
<clientCredentials>
<clientCertificate findValue="XXXXXXXX"
x509FindType="FindByThumbprint" />
<serviceCertificate>
<defaultCertificate findValue="XXXXXX"
storeLocation="LocalMachine" x509FindType="FindByThumbprint" />
<authentication certificateValidationMode="ChainTrust" trustedStoreLocation="LocalMachine" />
</serviceCertificate>
</clientCredentials>
</behavior>
</endpointBehaviors>
</behaviors>
<bindings>
<customBinding>
<binding name="reaCXFWSSoapBinding">
<security authenticationMode="MutualCertificate" requireDerivedKeys="false"
includeTimestamp="false" messageProtectionOrder="EncryptBeforeSign"
messageSecurityVersion="WSSecurity10WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11BasicSecurityProfile10"
requireSecurityContextCancellation="false">
<secureConversationBootstrap authenticationMode="MutualCertificate"
messageSecurityVersion="WSSecurity10WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11BasicSecurityProfile10" />
</security>
<textMessageEncoding messageVersion="Soap11" />
<httpsTransport maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647"
maxBufferSize="2147483647" requireClientCertificate="true" />
</binding>
</customBinding>
</bindings>
<client>
<endpoint address="https://..."
behaviorConfiguration="ComportamientoCertificadosREA" binding="customBinding"
bindingConfiguration="reaCXFWSSoapBinding" contract="ServiceReference1.WSREACXFService"
name="REAEndpoint">
<identity>
<dns value="..." />
<certificateReference storeLocation="CurrentUser" findValue=""
isChainIncluded="false" />
</identity>
</endpoint>
</client>
</system.serviceModel>
That produces the following request (capture and decrypted with fiddler)
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" xmlns:u="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<s:Header>
<o:Security s:mustUnderstand="1" xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
<o:BinarySecurityToken u:Id="uuid-5a68af48-0f16-46b4-b45f-e83851841104-2" ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3" EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">...</o:BinarySecurityToken>
<Signature xmlns="http://www.w3.org/2000/09/xmldsig#">
<SignedInfo>
<CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
<SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1"/>
<Reference URI="#_1">
<Transforms>
<Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
</Transforms>
<DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
<DigestValue>...</DigestValue>
</Reference>
</SignedInfo>
<SignatureValue></SignatureValue>
<KeyInfo>
<o:SecurityTokenReference>
<o:Reference ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3" URI="#uuid-5a68af48-0f16-46b4-b45f-e83851841104-2"/>
</o:SecurityTokenReference>
</KeyInfo>
</Signature>
</o:Security>
</s:Header>
<s:Body u:Id="_1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
...
</s:Body>
</s:Envelope>
And this is a valid example of the service:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xenc="http://www.w3.org/2001/04/xmlenc#">
<soap:Header>
<wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" soap:mustUnderstand="1">
<wsse:BinarySecurityToken xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary"
ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3"
wsu:Id="CertId-E554529BAA924FFE9C14373971009923"></wsse:BinarySecurityToken>
<ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#" Id="Signature-2">
<ds:SignedInfo>
<ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" />
<ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" />
<ds:Reference URI="#id-3">
<ds:Transforms>
<ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" />
</ds:Transforms>
<ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
<ds:DigestValue>...</ds:DigestValue>
</ds:Reference>
</ds:SignedInfo>
<ds:SignatureValue>...</ds:SignatureValue>
<ds:KeyInfo Id="KeyId-E554529BAA924FFE9C14373971009924">
<wsse:SecurityTokenReference xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
wsu:Id="STRId-E554529BAA924FFE9C14373971009925">
<wsse:Reference URI="#CertId-E554529BAA924FFE9C14373971009923"
ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3" />
</wsse:SecurityTokenReference>
</ds:KeyInfo>
</ds:Signature>
<wsse:BinarySecurityToken xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary"
ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3"
wsu:Id="E554529BAA924FFE9C14373971009141">...</wsse:BinarySecurityToken>
<xenc:EncryptedKey Id="EncKeyId-E554529BAA924FFE9C14373971009302">
<xenc:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-1_5" />
<ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
<wsse:SecurityTokenReference>
<wsse:Reference URI="#E554529BAA924FFE9C14373971009141"
ValueType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3" />
</wsse:SecurityTokenReference>
</ds:KeyInfo>
<xenc:CipherData>
<xenc:CipherValue>...</xenc:CipherValue>
</xenc:CipherData>
<xenc:ReferenceList>
<xenc:DataReference URI="#EncDataId-1" />
</xenc:ReferenceList>
</xenc:EncryptedKey>
</wsse:Security>
</soap:Header>
<soap:Body xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" wsu:Id="id-3">
...
</soap:Body>
</soap:Envelope>
So, how can I set my .config (and my code) in order to generate a request like the valid example?

Application Authentication With JAX-WS

Im creating a client API for a JAX-WS web service using wsimport tool(used the jaxws-maven-plugin:wsimport goal). The resulting API worked just fine. Now when security was introduced and wsimport run again on the updated WSDL file, I got an error:
[INFO] jaxws:wsimport args: [-s, C:\projects\EDMS2.0.0\docmgmt\docmgmt-client\src\main\java, -d, C:\projects\EDMS2.0.0\docmgmt\docmgmt-client\target\classes, -verbose, -p, com.abc.technology.retrieve.document.client.v1, C:\projects\EDMS\docmgmt\docmgmt-client\src\wsdl\RetrieveDocument\Technology-RetrieveDocument.wsdl]
parsing WSDL...
[ERROR] unknown required extensibility element "wsp:PolicyReference" (in namespace "http://www.w3.org/ns/ws-policy")
line 65 of file:/C:/projects/EDMS/docmgmt/docmgmt-client/src/wsdl/RetrieveDocument/Technology-RetrieveDocument.wsdl
Failed to parse the WSDL.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------`
WSDL file:
<?xml version='1.0' encoding='UTF-8'?>
<wsdl11:definitions xmlns:wsdl11="http://schemas.xmlsoap.org/wsdl/" xmlns:soap11="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:whttp="http://schemas.xmlsoap.org/wsdl/http/" xmlns:mime="http:/schemas.xmlsoap.org/wsdl/mime/"
xmlns:tns="http://services.abc.com/Technology/RetrieveDocument/service/v1"
xmlns:wsp="http://www.w3.org/ns/ws-policy" targetNamespace="http://services.abc.com/Technology/RetrieveDocument/service/v1"
xmlns:exceptions="http://services.abc.com/exceptions" xmlns:abc="http://services.abc.com/framework/abcHeader/v2"
xmlns:contract="http://services.abc.com/Technology/RetrieveDocument/contract/v1"> <!--BEGIN ABSTRACT DESCRIPTION-->
<wsdl11:types>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:contract="http://services.abc.com/Technology/RetrieveDocument/contract/v1"
targetNamespace="http://services.abc.com/Technology/RetrieveDocument/contract/v1">
<xsd:include schemaLocation="RetrieveDocument_v1.xsd"/>
</xsd:schema>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:exceptions="http://services.abc.com/exceptions"
targetNamespace="http://services.abc.com/exceptions">
<xsd:include schemaLocation="CnaExceptions.xsd"/>
</xsd:schema>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:abc="http://services.abc.com/framework/abcHeader/v2"
targetNamespace="http://services.abc.com/framework/abcHeader/v2">
<xsd:include schemaLocation="CnaHeader_v2.xsd"/>
</xsd:schema>
</wsdl11:types>
<wsdl11:message name="retrieveDocument-inputHeader">
<wsdl11:part name="To" element="abc:To"/>
<wsdl11:part name="HeaderMetadata" element="abc:HeaderMetadata"/>
<wsdl11:part name="ConsumerInfo" element="abc:ConsumerInfo"/>
</wsdl11:message>
<wsdl11:message name="retrieveDocument">
<wsdl11:part name="body" element="contract:RetrieveDocument"/>
</wsdl11:message>
<wsdl11:message name="retrieveDocument-outputHeader">
<wsdl11:part name="To" element="abc:To"/>
<wsdl11:part name="HeaderMetadata" element="abc:HeaderMetadata"/>
<wsdl11:part name="ConsumerInfo" element="abc:ConsumerInfo"/>
</wsdl11:message>
<wsdl11:message name="retrieveDocumentResponse">
<wsdl11:part name="body" element="contract:RetrieveDocumentResponse"/>
</wsdl11:message>
<wsdl11:message name="abcInvalidMessageException">
<wsdl11:part name="body" element="exceptions:CfInvalidMessageException"/>
</wsdl11:message>
<wsdl11:message name="abcServiceException">
<wsdl11:part name="body" element="exceptions:CfServiceException"/>
</wsdl11:message>
<wsdl11:message name="abcProducerApplicationException">
<wsdl11:part name="body" element="exceptions:CfProducerApplicationException"/>
</wsdl11:message>
<wsdl11:portType name="RetrieveDocument">
<wsdl11:operation name="retrieveDocument">
<wsdl11:input message="tns:retrieveDocument"/>
<wsdl11:output message="tns:retrieveDocumentResponse"/>
<wsdl11:fault message="tns:abcInvalidMessageException" name="abcInvalidMessageException"/>
<wsdl11:fault message="tns:abcServiceException" name="abcServiceException"/>
<wsdl11:fault message="tns:abcProducerApplicationException" name="abcProducerApplicationException"/>
</wsdl11:operation>
</wsdl11:portType>
<!--END ABSTRACT DESCRIPTION-->
<!--BEGIN BINDING DESCRIPTION-->
<wsdl11:binding name="RetrieveDocumentSOAPBinding" type="tns:RetrieveDocument">
<soap11:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl11:operation name="retrieveDocument">
<soap11:operation soapAction="http://services.abc.com/Technology/RetrieveDocument/service/v1/soap11/RetrieveDocument./retrieveDocument"
wsdl11:required="true" style="document"/>
<wsdl11:input>
<wsp:PolicyReference URI="abc-username-secure" wsdl11:required="true"/>
<soap11:header use="literal" message="tns:retrieveDocument-inputHeader"
part="To"/>
<soap11:header use="literal" message="tns:retrieveDocument-inputHeader"
part="HeaderMetadata"/>
<soap11:header use="literal" message="tns:retrieveDocument-inputHeader"
part="ConsumerInfo"/>
<soap11:body use="literal"/>
</wsdl11:input>
<wsdl11:output>
<soap11:header use="literal" message="tns:retrieveDocument-outputHeader"
part="To"/>
<soap11:header use="literal" message="tns:retrieveDocument-outputHeader"
part="HeaderMetadata"/>
<soap11:header use="literal" message="tns:retrieveDocument-outputHeader"
part="ConsumerInfo"/>
<soap11:body use="literal"/>
</wsdl11:output>
<wsdl11:fault name="abcInvalidMessageException">
<soap11:fault name="abcInvalidMessageException" use="literal"/>
</wsdl11:fault>
<wsdl11:fault name="abcServiceException">
<soap11:fault name="abcServiceException" use="literal"/>
</wsdl11:fault>
<wsdl11:fault name="abcProducerApplicationException">
<soap11:fault name="abcProducerApplicationException" use="literal"/>
</wsdl11:fault>
</wsdl11:operation>
</wsdl11:binding>
<!--END BINDING DESCRIPTION-->
<!--BEGIN SERVICE DESCRIPTION-->
<wsdl11:service name="RetrieveDocument">
<wsdl11:port name="RetrieveDocument" binding="tns:RetrieveDocumentSOAPBinding">
<soap11:address location="dummy.url"/>
</wsdl11:port>
</wsdl11:service>
<!--END SERVICE DESCRIPTION-->
<wsp:Policy wsu:Id="abc-username-secure" xmlns:wsu=
"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702">
<wsp:ExactlyOne>
<wsp:All>
<!-- Empty <TransportBinding/> element required due to bug in CXF 2.2.6 -->
<sp:TransportBinding/>
<sp:SupportingTokens>
<wsp:Policy>
<sp:UsernameToken sp:IncludeToken=".../IncludeToken/AlwaysToRecipient"/>
</wsp:Policy>
</sp:SupportingTokens>
</wsp:All>
</wsp:ExactlyOne>
</wsp:Policy>
</wsdl11:definitions>
I did some research and tried switching on the extension switch in wsimport. After this the API was generated successfully. But after this authentication part was ignored by wsimport I think.
Please explain what the right procedure is to properly generate the client API when Web Service security is needed?

WCF service on IIS - WSDL is empty

I created a WCF service and hosted it on my IIS server. Then, I needed to edit the schemaLocation. I followed this post.
When I add "?wsdl" to the url, I get an empty page. If I try to use the WSDL from SOAPui to test it, I get this "Error loading [http://xx.xxx.xx.xx:8095/CardServiceLib.CardService.svc/service?wsdl]: org.apache.xmlbeans.XmlException: org.apache.xmlbeans.XmlException: error: Unexpected end of file after nul"
If I delete the HTTPGetUrl, the WSDL is correct but the schemaLocation isn't what I want. With the mod I made with the linked post, the schemaLocation is perfect but the WSDL is empty... why?
This works, but not as I want (generates WSDL but with wrong links):
<serviceMetadata httpGetEnabled="True" httpsGetEnabled="True" />
and this not (doesn't generate WSDL --> blank page!!!):
<serviceMetadata httpGetEnabled="True" httpsGetEnabled="True" httpGetUrl="http://xx.xx.xx.xx.:8095/MyService.svc/endpoint"/>
This is my web.config on IIS server 7
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<connectionStrings>
<add name="connectionString" connectionString="server=xxxxx;database=xxxxx;uid=xxxxx;pwd=xxxxx;" providerName="System.Data.SqlClient" />
</connectionStrings>
<appSettings>
<add key="aspnet:UseTaskFriendlySynchronizationContext" value="true" />
<add key="userName" value="admin" />
<add key="password" value="xxxxx" />
<add key="ClientSettingsProvider.ServiceUri" value="" />
<add key="SecurityKey" value="xxxxxxxxxx" />
</appSettings>
<system.web>
<compilation debug="true" />
<membership defaultProvider="ClientAuthenticationMembershipProvider">
<providers>
<add name="ClientAuthenticationMembershipProvider" type="System.Web.ClientServices.Providers.ClientFormsAuthenticationMembershipProvider, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri="" />
</providers>
</membership>
<!--<roleManager defaultProvider="ClientRoleProvider" enabled="true">
<providers>
<add name="ClientRoleProvider" type="System.Web.ClientServices.Providers.ClientRoleProvider, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" serviceUri="" cacheTimeout="86400" />
</providers>
</roleManager>-->
</system.web>
<system.serviceModel>
<standardEndpoints>
<webHttpEndpoint>
<!-- the "" standard endpoint is used for auto creating a web endpoint. -->
<standardEndpoint name="" helpEnabled="true" automaticFormatSelectionEnabled="true" />
</webHttpEndpoint>
</standardEndpoints>
<bindings>
<basicHttpBinding>
<binding name="SecurityByTransport" maxBufferPoolSize="2147483647" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647" messageEncoding="Text">
<readerQuotas maxDepth="2000000" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" />
<security mode="TransportCredentialOnly">
<transport clientCredentialType="Basic" />
<!--<message clientCredentialType="UserName"/>-->
</security>
</binding>
</basicHttpBinding>
</bindings>
<services>
<service name="CardServiceLib.CardService" behaviorConfiguration="customBehavior">
<endpoint address="" binding="basicHttpBinding" bindingConfiguration="SecurityByTransport" name="base" contract="CardServiceLib.ICardService">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" name="mex" contract="IMetadataExchange" />
<!--<endpoint address="web" behaviorConfiguration="webHttp" binding="webHttpBinding"
bindingConfiguration="" name="web" contract="calc.ICalcService">
<identity>
<dns value="localhost" />httpGetUrl="http://77.108.40.77:8095/CardServiceLib.CardService.svc/service"
</identity>
</endpoint>-->
<host>
<baseAddresses>
<add baseAddress="https://xx.xx.xx.xx:8095/MyService/" />
</baseAddresses>
</host>
</service>
</services>
<behaviors>
<endpointBehaviors>
<behavior name="webHttp">
<webHttp />
</behavior>
</endpointBehaviors>
<serviceBehaviors>
<behavior>
<serviceMetadata httpGetEnabled="True" httpsGetEnabled="True" />
<serviceDebug includeExceptionDetailInFaults="False" />
</behavior>
<behavior name="customBehavior">
<serviceMetadata httpGetEnabled="True" httpsGetEnabled="True" httpGetUrl="http://xx.xx.xx.xx:8095/MyService.Service.svc/service"/>
<serviceDebug includeExceptionDetailInFaults="True" />
<serviceCredentials>
<userNameAuthentication userNamePasswordValidationMode="Custom" customUserNamePasswordValidatorType="xx,xx" />
</serviceCredentials>
</behavior>
</serviceBehaviors>
</behaviors>
<!--<protocolMapping>
<add binding="webHttpBinding" scheme="http" />
</protocolMapping>-->
</system.serviceModel>
<system.webServer>
<directoryBrowse enabled="false" />
</system.webServer>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" /> </startup></configuration>
SOLVED!! I added this
address="http://192.168.1.2/Demo.Service/MultiEndPointsService.svc/basic"
in my endpoint tag, like written in this link.
I suspect the issue is related to the authentication required to access the WSDL.
When attempting to access the metadata URL directly, the web site indicates the following:
“Authentication Required”
“The server http://...:8095 requires a username and password.”
You either need to provide the proper credentials or relax the permissions on the WSDL.

INDY WebService over SSL contains link with HTTP protocol instead of HTTPS in WSDL

When creating new SOAP WebService server project using Delphi XE2 the wizard allows to set change port and HTTPS properties. Port is set to 443, HTTPS flag is checked, but when trying to connect to created server it returns incorrect transport (HTTP instead of HTTPS) in WSDL and generates HTTP links on the Service Info Page. The auto-generated page is not so important, but wrong information in WSDL file is a problem. Below you can see the returned WSDL - there are no HTTPS:
<?xml version="1.0"?>
<definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:xs="http://www.w3.org/2001/XMLSchema" name="Itest123service" targetNamespace="http://tempuri.org/" xmlns:tns="http://tempuri.org/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:ns1="urn:test123Intf">
<types>
<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:test123Intf">
<simpleType name="TEnumTest">
<restriction base="string">
<enumeration value="etNone"/>
<enumeration value="etAFew"/>
<enumeration value="etSome"/>
<enumeration value="etAlot"/>
</restriction>
</simpleType>
<complexType name="TDoubleArray">
<complexContent>
<restriction base="soapenc:Array">
<sequence/>
<attribute ref="soapenc:arrayType" n1:arrayType="xs:double[]" xmlns:n1="http://schemas.xmlsoap.org/wsdl/"/>
</restriction>
</complexContent>
</complexType>
<complexType name="TMyEmployee">
<sequence>
<element name="LastName" type="xs:string"/>
<element name="FirstName" type="xs:string"/>
<element name="Salary" type="xs:double"/>
</sequence>
</complexType>
</schema>
</types>
<message name="echoEnum0Request">
<part name="Value" type="ns1:TEnumTest"/>
</message>
<message name="echoEnum0Response">
<part name="return" type="ns1:TEnumTest"/>
</message>
<message name="echoDoubleArray1Request">
<part name="Value" type="ns1:TDoubleArray"/>
</message>
<message name="echoDoubleArray1Response">
<part name="return" type="ns1:TDoubleArray"/>
</message>
<message name="echoMyEmployee2Request">
<part name="Value" type="ns1:TMyEmployee"/>
</message>
<message name="echoMyEmployee2Response">
<part name="return" type="ns1:TMyEmployee"/>
</message>
<message name="echoDouble3Request">
<part name="Value" type="xs:double"/>
</message>
<message name="echoDouble3Response">
<part name="return" type="xs:double"/>
</message>
<portType name="Itest123">
<operation name="echoEnum">
<input message="tns:echoEnum0Request"/>
<output message="tns:echoEnum0Response"/>
</operation>
<operation name="echoDoubleArray">
<input message="tns:echoDoubleArray1Request"/>
<output message="tns:echoDoubleArray1Response"/>
</operation>
<operation name="echoMyEmployee">
<input message="tns:echoMyEmployee2Request"/>
<output message="tns:echoMyEmployee2Response"/>
</operation>
<operation name="echoDouble">
<input message="tns:echoDouble3Request"/>
<output message="tns:echoDouble3Response"/>
</operation>
</portType>
<binding name="Itest123binding" type="tns:Itest123">
<binding xmlns="http://schemas.xmlsoap.org/wsdl/soap/" style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="echoEnum">
<operation xmlns="http://schemas.xmlsoap.org/wsdl/soap/" soapAction="urn:test123Intf-Itest123#echoEnum" style="rpc"/>
<input>
<body xmlns="http://schemas.xmlsoap.org/wsdl/soap/" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:test123Intf-Itest123"/>
</input>
<output>
<body xmlns="http://schemas.xmlsoap.org/wsdl/soap/" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:test123Intf-Itest123"/>
</output>
</operation>
<operation name="echoDoubleArray">
<operation xmlns="http://schemas.xmlsoap.org/wsdl/soap/" soapAction="urn:test123Intf-Itest123#echoDoubleArray" style="rpc"/>
<input>
<body xmlns="http://schemas.xmlsoap.org/wsdl/soap/" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:test123Intf-Itest123"/>
</input>
<output>
<body xmlns="http://schemas.xmlsoap.org/wsdl/soap/" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:test123Intf-Itest123"/>
</output>
</operation>
<operation name="echoMyEmployee">
<operation xmlns="http://schemas.xmlsoap.org/wsdl/soap/" soapAction="urn:test123Intf-Itest123#echoMyEmployee" style="rpc"/>
<input>
<body xmlns="http://schemas.xmlsoap.org/wsdl/soap/" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:test123Intf-Itest123"/>
</input>
<output>
<body xmlns="http://schemas.xmlsoap.org/wsdl/soap/" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:test123Intf-Itest123"/>
</output>
</operation>
<operation name="echoDouble">
<operation xmlns="http://schemas.xmlsoap.org/wsdl/soap/" soapAction="urn:test123Intf-Itest123#echoDouble" style="rpc"/>
<input>
<body xmlns="http://schemas.xmlsoap.org/wsdl/soap/" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:test123Intf-Itest123"/>
</input>
<output>
<body xmlns="http://schemas.xmlsoap.org/wsdl/soap/" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:test123Intf-Itest123"/>
</output>
</operation>
</binding>
<service name="Itest123service">
<port name="Itest123Port" binding="tns:Itest123binding">
<address xmlns="http://schemas.xmlsoap.org/wsdl/soap/" location="http://localhost:443/soap/Itest123"/>
</port>
</service>
</definitions>
When I'm trying to import WSDL to soapUI tool to check WebService work I need to change manually binding link to "https://" and only then RPCs will work.
I will be very grateful for any idea how to force INDY to return links in WSDL with HTTPS protocol. Thanks in advance!
I had the same problem and solved it like this:
Look at the properties of the generated WSDLHTMLPublish1.
Change the property PublishOptions -> poPublishLocationAsSecure to true

Cisco UCP Web Service Issue AuthenticateUser

Update: This issue has been resolved. I was trying to authenticate various admin accounts which apparently are in a separate database than the user accounts this service talks to. I used a generic user account that I created in CISCO and the web service calls worked great!
I would like to thank #Yahia for the recommendation on running Fiddler also!
I've been reading over the CICCO UCP Web Service documentation for days now. I'm able to talk to the one web service on the box, with proper credentials and everything works fine; however, with the UCP Service, I get an error... SoapUI seems to understand the WSDL file, and I'm able to send a request to the endpoint but I get an authentication error, below.
I use the same username and password to login to the ACS Portal so the account is not expired. I'm pretty much lost on this one and at the mercy of CICSO tech support. Any and all ideas are welcome!
SOAP Response:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<ns1:authenticateUserResponse soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="http://cisco.com/nm/acs/mgmt/ucp/service/">
<authenticateUserReturn href="#id0"/>
</ns1:authenticateUserResponse>
<multiRef id="id0" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns2:ResponseType" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns2="http://cisco.com/nm/acs/mgmt/ucp/service/">
<errors soapenc:arrayType="xsd:string[1]" xsi:type="soapenc:Array">
<errors xsi:type="xsd:string">Credentials are incorrect.</errors>
</errors>
<status href="#id1"/>
</multiRef>
<multiRef id="id1" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns3:StatusCodeType" xmlns:ns3="http://cisco.com/nm/acs/mgmt/ucp/service/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">failure</multiRef>
</soapenv:Body>
</soapenv:Envelope>
Soap Envelope:
<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="http://cisco.com/nm/acs/mgmt/ucp/service/">
<soapenv:Header/>
<soapenv:Body>
<ser:authenticateUser soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<userName xsi:type="xsd:string">myusername</userName>
<password xsi:type="xsd:string">mypassword</password>
</ser:authenticateUser>
</soapenv:Body>
</soapenv:Envelope>
And the WSDL:
<?xml version="1.0" encoding="utf-8"?>
<wsdl:definitions targetNamespace="http://cisco.com/nm/acs/mgmt/ucp/service/"
xmlns:apachesoap="http://xml.apache.org/xml-soap"
xmlns:impl="http://www.cisco.com/wsdl.service"
xmlns:intf="http://cisco.com/nm/acs/mgmt/ucp/service/"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<wsdl:documentation>Copyright (c) 2007, 2009 Cisco Systems, Inc.
WSDL Service Interface for ACS5.1 User Change Password interface
(UCP) This WSDL document defines the publication API calls for
interacting with the ACS UCP service.</wsdl:documentation>
<wsdl:types>
<schema targetNamespace="http://cisco.com/nm/acs/mgmt/ucp/service/"
xmlns="http://www.w3.org/2001/XMLSchema">
<import namespace="http://schemas.xmlsoap.org/soap/encoding/" />
<complexType name="ArrayOf_xsd_string">
<complexContent>
<restriction base="soapenc:Array">
<attribute ref="soapenc:arrayType"
wsdl:arrayType="xsd:string[]" />
</restriction>
</complexContent>
</complexType>
<simpleType name="StatusCodeType">
<restriction base="string">
<enumeration value="success" />
<enumeration value="failure" />
</restriction>
</simpleType>
<complexType name="ResponseType">
<sequence>
<element name="errors" nillable="true"
type="intf:ArrayOf_xsd_string" />
<element name="status" nillable="false"
type="intf:StatusCodeType" />
</sequence>
</complexType>
</schema>
</wsdl:types>
<wsdl:message name="changeUserPassRequest">
<wsdl:part name="userName" type="xsd:string" />
<wsdl:part name="oldPassword" type="xsd:string" />
<wsdl:part name="newPassword" type="xsd:string" />
</wsdl:message>
<wsdl:message name="authenticateUserRequest">
<wsdl:part name="userName" type="xsd:string" />
<wsdl:part name="password" type="xsd:string" />
</wsdl:message>
<wsdl:message name="changeUserPassResponse">
<wsdl:part name="changeUserPassReturn"
type="intf:ResponseType" />
</wsdl:message>
<wsdl:message name="authenticateUserResponse">
<wsdl:part name="authenticateUserReturn"
type="intf:ResponseType" />
</wsdl:message>
<wsdl:portType name="UCP">
<wsdl:operation name="authenticateUser"
parameterOrder="userName password">
<wsdl:input message="intf:authenticateUserRequest"
name="authenticateUserRequest" />
<wsdl:output message="intf:authenticateUserResponse"
name="authenticateUserResponse" />
</wsdl:operation>
<wsdl:operation name="changeUserPass"
parameterOrder="userName oldPassword newPassword">
<wsdl:input message="intf:changeUserPassRequest"
name="changeUserPassRequest" />
<wsdl:output message="intf:changeUserPassResponse"
name="changeUserPassResponse" />
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="UCP" type="intf:UCP">
<wsdlsoap:binding style="rpc"
transport="http://schemas.xmlsoap.org/soap/http" />
<wsdl:operation name="authenticateUser">
<wsdlsoap:operation soapAction="" />
<wsdl:input name="authenticateUserRequest">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://cisco.com/nm/acs/mgmt/ucp/service/"
use="encoded" />
</wsdl:input>
<wsdl:output name="authenticateUserResponse">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://cisco.com/nm/acs/mgmt/ucp/service/"
use="encoded" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="changeUserPass">
<wsdlsoap:operation soapAction="" />
<wsdl:input name="changeUserPassRequest">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://cisco.com/nm/acs/mgmt/ucp/service/"
use="encoded" />
</wsdl:input>
<wsdl:output name="changeUserPassResponse">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://cisco.com/nm/acs/mgmt/ucp/service/"
use="encoded" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="UCPService">
<wsdl:port binding="intf:UCP" name="UCP">
<wsdlsoap:address location="https://localhost/PI/services/UCP/" />
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
Update: This issue has been resolved. I was trying to authenticate various admin accounts which apparently are in a separate database than the user accounts this service talks to. I used a generic user account that I created in CISCO and the web service calls worked great!
I would like to thank #Yahia for the recommendation on running Fiddler also!