Referencing WCF (Windows Communication Foundation) web services

I am having some issues referencing a WCF based web service.
Apex can consume the WSDL just fine, but when I attempt to use any of the methods I start running into errors.
For example, there is a simple method that accepts a username and returns a facility ID. If I use the apex built-in web service test tool, I see the following request and response:
<?xml version='1.0' encoding='UTF-8'?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
mlns:xsd="http://www.w3.org/2001/XMLSchema">
     <SOAP-ENV:Body><ns1:FetchRequest xmlns:ns1="http://microsoft.com/wsdl/types/"><ns1:UserName>TAUS461</ns1:UserName>
/ns1:FetchRequest></SOAP-ENV:Body>
</SOAP-ENV:Envelope>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"><s:Body><s:Fault>
<faultcode xmlns:a="http://schemas.microsoft.com/net/2005/12/windowscommunicationfoundation/dispatcher">a:InternalServiceFault</faultcode><faultstring xml:lang="en-US">
Procedure or function 'Prc_Fetch' expects parameter '@userName', which was not supplied.</faultstring><detail>
<ExceptionDetail xmlns="http://schemas.datacontract.org/2004/07/System.ServiceModel"
xmlns:i="http://www.w3.org/2001/XMLSchema-instance"><HelpLink i:nil="true"/><InnerException i:nil="true"/>
<Message>Procedure or function 'Prc_Fetch' expects parameter '@userName', which was not supplied.</Message><StackTrace>   at WA.Ecy.ADS.FS.Service.BusinessLogic.FacilitySiteBAO.Fetch(String userName) in
C:\Projects\FS 2008\Development\Services\FS.Service\Source\Business Logic\FS.Service.BusinessLogic\FacilitySiteBAO.cs:line 418&#xD;
at FS.Service.ServiceImplementation.FacilitySiteService.Fetch(FetchRequest request) in
C:\Projects\FS 2008\Development\Services\FS.Service\Source\Service Interface\FS.Service.ServiceImplementation\GeneratedCodeFacilitySiteService.cs:line 1588&#xD;
   at SyncInvokeFetch(Object , Object[] , Object[] )&#xD;
   at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]&amp; outputs)&#xD;
   at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc&amp; rpc)&#xD;
   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc&amp; rpc)&#xD;
   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage4(MessageRpc&amp; rpc)&#xD;
   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage3(MessageRpc&amp; rpc)&#xD;
   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage2(MessageRpc&amp; rpc)&#xD;
   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage1(MessageRpc&amp; rpc)&#xD;
   at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)</StackTrace><Type>System.Data.SqlClient.SqlException</Type></ExceptionDetail></detail></s:Fault></s:Body></s:Envelope>I get a similar error regardless of which method I attempt to call.
So, I thought that I would try Jason Straub's [link FLEX_WS_API|http://jastraub.blogspot.com/2008/06/flexible-web-service-api.html] package. First I opened SOAPUI, pointed to the WSDL and generated a test request for the Fetch method. The request looked like this:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn: WA.Ecy.ADS.FacilitySite.Services">
   <soapenv:Header/>
   <soapenv:Body>
      <urn:FetchRequest>
         <!--Optional:-->
         <urn:UserName>TAUS461</urn:UserName>
      </urn:FetchRequest>
   </soapenv:Body>
</soapenv:Envelope>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
   <s:Header>
      <ActivityId CorrelationId="dcdd3433-7f61-48f4-b3e3-c2a6647409d3" xmlns="http://schemas.microsoft.com/2004/09/ServiceModel
Diagnostics">2aeead53-c9df-41df-9a77-3798be030775</ActivityId>
   </s:Header>
   <s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
      <FetchResponse xmlns="urn: WA.Ecy.ADS.FacilitySite.Services">
         <FacilitySiteId>99997167</FacilitySiteId>
      </FetchResponse>
   </s:Body>
</s:Envelope>So far so good, SOAPUI can call and retrieve from this method. Now I put this into place with FLEX_WS_API
declare
l_env clob;
l_url varchar2(1000) := 'http://ecydevws/FacilitySiteService/FacilitySiteService.svc'; -- dev web service URL
l_response xmltype;
p_username varchar2(30) := 'TAUS461';
begin
     -- start creating the soap envelope
     l_env := '<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn: WA.Ecy.ADS.FacilitySite.Services">
             <soapenv:Header/>
             <soapenv:Body>
                <urn:FetchRequest>
                <urn:UserName>'||p_username||'</urn:UserName>
                </urn:FetchRequest>
             </soapenv:Body>
          </soapenv:Envelope>';
     -- get the response
     l_response := flex_ws_api.make_request (
          p_url => l_url,
          p_action => 'http://WA.Ecy.ADS.FacilitySite.Services/Fetch',
          p_version => '1.1',
          p_envelope => l_env);
-- for testing, put the respone into a table
insert into ws_results values (l_response);
end;Doing this,my response becomes
<s:Envelope xmlns:s=
"http://schemas.xmlsoap.org/soap/envelope/"><s:Body><s:Fault><faultcode xmlns:a="http://schemas.microsoft.com
ws/2005/05/addressing/none">a:ActionNotSupported</faultcode>
<faultstring xml:lang="en-US">
The message with Action 'http://WA.Ecy.ADS.FacilitySite.Services/Fetch' cannot be processed at the receiver, due to a ContractFilter
mismatch at the EndpointDispatcher. This may be because of either a contract mismatch (mismatched Actions between sender and receiver)
or a binding/security mismatch between the sender and the receiver.  Check that sender and receiver have the same contract and the same
binding (including security requirements, e.g. Message, Transport, None).</faultstring></s:Fault></s:Body></s:Envelope>So it appears to me that the WCF service is expecting something else in soap header, but I am confused on why the SOAPUI call works as is.
Does anyone with WCF knowledge have any ideas of how to get this to work or if the problem is even with WCF?
Thanks, Tony

as of now only file with wsdl extention is supported,

Similar Messages

  • WCF- ( Windows communication Foundation ) New standard for webservice

    Dear Friends,
      Could anybody tell me whether we can call a WCF service from SAP PI?
      WCF (Windows communication Foundation) can be considered as a new standard for webservice.
    Take care,
    Karthik..k

    as of now only file with wsdl extention is supported,

  • Windows Communication Foundation .svc versus .asmx

    .NET 3.5 and above allow programmer to create Windows Communication Foundation that has the .svc file. I can use this WCF like a Web services on .Net C# and VB.NET without issues. I can also access what has been created on the browser (http://server1/DemoWebServices/Demo.svc?wsdl).
    However, when I go to LabView 8.6.1, it can only allowed import of asmx?wsdl Web services.
    Does that mean labview does not play with .svc?wsdl ?
    If not supported, would other Labview version allowed that support.

    Unfortunately, at this point it appears only asmx?wsdl Web Services are supported.  If you can convert between formats, that may be your best solution.
    Regards,
    Mike S
    NI AE

  • Windows communication Foundation

    how to  View the   Windows communication Foundation  output  Results?

    You can use diagnostics for creating the service/client logs.
    <system.diagnostics>
    <sources>
    <source name="System.ServiceModel" switchValue="Information, ActivityTracing" propagateActivity="true">
    <listeners>
    <add type="System.Diagnostics.DefaultTraceListener" name="Default">
    <filter type=""/>
    </add>
    <add initializeData="C:\Temp\IService.svclog" type="System.Diagnostics.XmlWriterTraceListener" name="traceListener">
    <filter type=""/>
    </add>
    </listeners>
    </source>
    <source name="System.ServiceModel.MessageLogging" switchValue="Warning, ActivityTracing">
    <listeners>
    <add type="System.Diagnostics.DefaultTraceListener" name="Default">
    <filter type=""/>
    </add>
    <add name="ServiceModelMessageLoggingListener">
    <filter type=""/>
    </add>
    </listeners>
    </source>
    </sources>
    <sharedListeners>
    <add initializeData="C:\Temp\IService.svclog" type="System.Diagnostics.XmlWriterTraceListener, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" name="ServiceModelMessageLoggingListener" traceOutputOptions="Timestamp">
    <filter type=""/>
    </add>
    </sharedListeners>
    </system.diagnostics>

  • Importing WSDL from Windows Communication Foundation (WCF)

    We've created a new WCF windows service using VS2008/.net 3.5.  Using IE we can find the WSDL.  When using the LabVIEW (8.5) Import Web Service utility, returns an error when referencing the WSDL.
    Has anyone had any experience accessing a WCF based WSDL?

    Hello, I have the same experience, we us a web server also VS2008/.net 3.5 and we will control a device with it.   error from web server import:
    1. The URL does not exist or the WSDL is bad   // comment is correct we have check out with java client
    2. Authentication is not correct    //comment we haven't any authentication 
    3. Proxy information is not correct // comment no Proxy is localhost !
    But with a java applet the server url (http://127.0.01:8111/MacroServer) is it achievable look user XML sheet in the attachment.But also we have checked the LV 8.6 import function with the web server example on the Website xmethods (http://www.xmethods.net/ve2/index.po) those functions are very well. Please if there any go around for this tell us.
    Best regards reiner
    Attachments:
    http___127.0.0.1_8111_Macroserver.pdf ‏60 KB

  • Problem communication with Web Service

    Hello,
    today i've got a really illogical error. I will try to explain:
    I have got a procedure, which connect with a web service.
    The Code of this function is:
    °°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°
    create or replace procedure opc.P_WCF_WEBSERVICE(pEmpfaenger in varchar2, pData in varchar2) is
    service_ sys.utl_dbws.SERVICE;
    call_ sys.utl_dbws.CALL;
    service_qname sys.utl_dbws.QNAME;
    response sys.XMLTYPE; request
    sys.XMLTYPE;
    begin
    service_qname := sys.utl_dbws.to_qname(null, 'WebService_WCF');
    service_ := sys.utl_dbws.create_service(service_qname);
    call_ := sys.utl_dbws.create_call(service_);
    sys.utl_dbws.set_target_endpoint_address(call_, 'http://server:84/Service.asmx');
    sys.utl_dbws.set_property( call_, 'SOAPACTION_USE', 'TRUE');
    sys.utl_dbws.set_property( call_, 'SOAPACTION_URI', 'http://tempuri.org/SendXMLTOApplication');
    request := sys.XMLTYPE('<SendXMLTOApplication xmlns="http://tempuri.org/"><pEmpfaenger>' ||
    pEmpfaenger ||'</pEmpfaenger><pXML>' || pData ||'</pXML></SendXMLTOApplication>');
    response :=sys. utl_dbws.invoke(call_, request);
    --return response.extract('//child::text()', 'xmlns="http://gefdnb048a:4800/WebService-WCF/Service.asmx"').getstringval(); 
    end P_WCF_WEBSERVICE;
    OK, if i want use this procedure, I use the following command:
    °°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°
    begin
    OPC.P_WCF_WEBSERVICE('OPC',
    '&&lt;MaschineSperren DLL="MaschineSperren.dll" MC="TBM02" Barcode="14154360" /&&gt; '
    end;
    The WebService got the correct XML-String (<MaschineSperren DLL="MaschineSperren.dll" MC="TBM02" Barcode="14154360" /> )
    if I use the same command in a Trigger (after insert), I've got the following error message in line ( request := sys.XMLTYPE('<S... ) :
    ORA-31011: XML parsing
    ORA19202: Error occured in XML processing
    LPX-00242 invalid use of amersand(") character(use amp;)
    I thought, I should replace the & with &amp;
    If i use it in that way, my WebService got the follwing xml-string:
    &&lt;MaschineSperren DLL="MaschineSperren.dll" MC="TBM01" Barcode="14154360" /&&gt;
    But i need a XML string!
    "&&lt;" will not replaced to "<", if I do it in that way.
    The Problem occures only in a Trigger!!!
    What should I do - What can be wrong?
    I hope, Someone can help me.
    Thanks Andi

    Hi,
    I am working on a similar scenario where I my consuming an external web service using https protocol from PI.
    I have configured a soap receiver channel to call the target url of this web service as https://portal.xyz.org.uk/webservice_alt.
    I am getting an error HTTP 302 suggesting that PI is not able to follow the re-direction to the target URL as the service resides not on that URL but on https://portal1.xyz.org.uk/webservice_alt or https://portal2.xyz.org.uk/webservice_alt.
    This is their server fail over handling mechanism which is very common. But PI 7.0 is not able to handle this.
    So if I change the target URL on the SOAP receiver channel to  https://portal1.xyz.org.uk/web service  or  https://portal2.xyz.org.uk/webservice_alt , PI works fine without errors . But this is not the right approach because, every time the web service provider takes one of these systems down for upgrade/patching etc, they inform us and then I manually go and change the target URL to the available server on my production PI system config.
    My problem is I want to resolve this redirection error in PI. I have tried raising a call with SAP itself and they pointed out to use Axis adapter which is still not working.
    So I am here asking for help. any suggestions please from the experts?
    Thanks
    Jhansi.

  • Windows Communication Foundation interoperability with Java.

    Hii,
    I am building a client for the WCF service using Soap1.2 and ws-security. I have tried building a stub for the service using JDeveloper 10 g and also tried to validate the wsdl using XML spy. Both are giving errors. I wanna know how could i genrate the stub for the service and also Validate WSDL? I know i might have to modify the WSDL, but dont know what changes must be required? And Also which std i must adhere?
    Here is the WSDL
    <?xml version="1.0" encoding="utf-8"?>
    <wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
                      xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
                      xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
                      xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
                      xmlns:wsap10="http://www.w3.org/2005/08/addressing"
                      xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing"
                      xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
                      xmlns:i0="http://Corona.Services.UserMgmt.UserMgmtSrv"
                      xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/09/policy/addressing"
                      xmlns:xsd="http://www.w3.org/2001/XMLSchema"
                      xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract"
                      xmlns:tns="http://tempuri.org/"
                      xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
                      xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex"
                      xmlns:wsa10="http://www.w3.org/2005/08/addressing"
                      targetNamespace="http://tempuri.org/" name="UserMgmtSrv">
      <wsdl:import namespace="http://Corona.Services.UserMgmt.UserMgmtSrv"
                   location="http://debugger/Corona.Services/Corona.Services.svc?wsdl"/>
      <wsdl:types/>
      <wsdl:binding name="WSHttpBinding_UserMgmtSrv" type="i0:UserMgmtSrv">
        <wsp:PolicyReference URI="#WSHttpBinding_UserMgmtSrv_policy"/>
        <soap12:binding transport="http://schemas.xmlsoap.org/soap/http"/>
        <wsdl:operation name="Authenticate">
          <wsdl:input>
            <soap12:body use="literal"/>
          </wsdl:input>
          <wsdl:output>
            <soap12:body use="literal"/>
          </wsdl:output>
          <wsdl:fault name="ArgumentExceptionFault">
            <soap12:fault name="ArgumentExceptionFault"
                          namespace="http://Corona.Services.UserMgmt.UserMgmtSrv.FaultException"/>
          </wsdl:fault>
        </wsdl:operation>
        <wsdl:operation name="SaveHealthProfileWrapper">
          <wsdl:input>
            <soap12:body use="literal"/>
          </wsdl:input>
          <wsdl:output>
            <soap12:body use="literal"/>
          </wsdl:output>
        </wsdl:operation>
      </wsdl:binding>
      <wsdl:service name="UserMgmtSrv">
        <wsdl:port name="WSHttpBinding_UserMgmtSrv"
                   binding="tns:WSHttpBinding_UserMgmtSrv">
          <soap12:address location="https://debugger/Corona.Services/Corona.Services.svc"/>
          <wsa10:EndpointReference>
            <wsa10:Address>https://debugger/Corona.Services/Corona.Services.svc</wsa10:Address>
          </wsa10:EndpointReference>
        </wsdl:port>
      </wsdl:service>
      <wsp:Policy wsu:Id="WSHttpBinding_UserMgmtSrv_policy">
        <wsp:ExactlyOne>
          <wsp:All>
            <wspe:Utf816FFFECharacterEncoding xmlns:wspe="http://schemas.xmlsoap.org/ws/2004/09/policy/encoding"/>
            <sp:TransportBinding xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
              <wsp:Policy>
                <sp:TransportToken>
                  <wsp:Policy>
                    <sp:HttpsToken RequireClientCertificate="false"/>
                  </wsp:Policy>
                </sp:TransportToken>
                <sp:AlgorithmSuite>
                  <wsp:Policy>
                    <sp:Basic128/>
                  </wsp:Policy>
                </sp:AlgorithmSuite>
                <sp:Layout>
                  <wsp:Policy>
                    <sp:Strict/>
                  </wsp:Policy>
                </sp:Layout>
                <sp:IncludeTimestamp/>
              </wsp:Policy>
            </sp:TransportBinding>
            <sp:EndorsingSupportingTokens xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
              <wsp:Policy>
                <sp:SecureConversationToken sp:IncludeToken="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/AlwaysToRecipient">
                  <wsp:Policy>
                    <mssp:RequireCancel wsp:Optional="true"
                                        xmlns:mssp="http://schemas.microsoft.com/ws/2005/07/securitypolicy"/>
                    <sp:BootstrapPolicy>
                      <wsp:Policy>
                        <sp:TransportBinding>
                          <wsp:Policy>
                            <sp:TransportToken>
                              <wsp:Policy>
                                <sp:HttpsToken RequireClientCertificate="false"/>
                              </wsp:Policy>
                            </sp:TransportToken>
                            <sp:AlgorithmSuite>
                              <wsp:Policy>
                                <sp:Basic128/>
                              </wsp:Policy>
                            </sp:AlgorithmSuite>
                            <sp:Layout>
                              <wsp:Policy>
                                <sp:Strict/>
                              </wsp:Policy>
                            </sp:Layout>
                            <sp:IncludeTimestamp/>
                          </wsp:Policy>
                        </sp:TransportBinding>
                        <sp:EndorsingSupportingTokens>
                          <wsp:Policy>
                            <sp:SpnegoContextToken sp:IncludeToken="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/AlwaysToRecipient">
                              <wsp:Policy>
                                <mssp:RequireCancel wsp:Optional="true"
                                                    xmlns:mssp="http://schemas.microsoft.com/ws/2005/07/securitypolicy"/>
                              </wsp:Policy>
                            </sp:SpnegoContextToken>
                          </wsp:Policy>
                        </sp:EndorsingSupportingTokens>
                        <sp:Trust10>
                          <wsp:Policy>
                            <sp:MustSupportIssuedTokens/>
                            <sp:RequireClientEntropy/>
                            <sp:RequireServerEntropy/>
                          </wsp:Policy>
                        </sp:Trust10>
                      </wsp:Policy>
                    </sp:BootstrapPolicy>
                  </wsp:Policy>
                </sp:SecureConversationToken>
              </wsp:Policy>
            </sp:EndorsingSupportingTokens>
            <sp:Trust10 xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
              <wsp:Policy>
                <sp:MustSupportIssuedTokens/>
                <sp:RequireClientEntropy/>
                <sp:RequireServerEntropy/>
              </wsp:Policy>
            </sp:Trust10>
            <wsap10:UsingAddressing/>
          </wsp:All>
        </wsp:ExactlyOne>
      </wsp:Policy>
      <wsp:UsingPolicy/>
    </wsdl:definitions>

    Unfortunately, at this point it appears only asmx?wsdl Web Services are supported.  If you can convert between formats, that may be your best solution.
    Regards,
    Mike S
    NI AE

  • Question: Securing Communications in Web Services: A Tutorial

    Hi all,
    I have been following this tutorial:
    http://developers.sun.com/prodtech/identserver/reference/techart/secure-ws.html
    And it was a pissed-off experience. I have only spent 5 mins on it and I am already stuck.
    Anyway, when I try to deploy the StockServer project, I get the following error:
    am-init:
    am-deploy:
    /home/bwoo/Creator/Projects/webservicessecurity/samples/StockServer/nbproject/am-deploy.xml:46: Could not create task or type of type: amdeploy.
    Ant could not find the task or a class this task relies upon.
    This is common and has a number of causes; the usual
    solutions are to read the manual pages then download and
    install needed JAR files, or fix the build file:
    - You have misspelt 'amdeploy'.
    Fix: check your spelling.
    - The task needs an external JAR file to execute
    and this is not found at the right place in the classpath.
    Fix: check the documentation for dependencies.
    Fix: declare the task.
    - The task is an Ant optional task and the JAR file and/or libraries
    implementing the functionality were not found at the time you
    yourself built your installation of Ant from the Ant sources.
    Fix: Look in the ANT_HOME/lib for the 'ant-' JAR corresponding to the
    task and make sure it contains more than merely a META-INF/MANIFEST.MF.
    If all it contains is the manifest, then rebuild Ant with the needed
    libraries present in ${ant.home}/lib/optional/ , or alternatively,
    download a pre-built release version from apache.org
    - The build file was written for a later version of Ant
    Fix: upgrade to at least the latest release version of Ant
    - The task is not an Ant core or optional task
    and needs to be declared using <taskdef>.
    - You are attempting to use a task defined using
    <presetdef> or <macrodef> but have spelt wrong or not
    defined it at the point of use
    Remember that for JAR files to be visible to Ant tasks implemented
    in ANT_HOME/lib, the files must be in the same directory or on the
    classpath
    Please neither file bug reports on this problem, nor email the
    Ant mailing lists, until all of these causes have been explored,
    as this is not an Ant bug.
    BUILD FAILED (total time: 5 seconds)
    Have any of you had the same problem? I know there is a similar tutorial on NetBeans website but it's even more poorly written.

    No i have not really worked on it these last days...
    I wonder why so few answers to this post. Would we the only two people who want to do this (be able to access OCS fron a web app, reusing SSO session)
    My main problem, for these web services, is to pass a password. As we do actually, we should keep a password in clear text in the User session.. and i'm not fond of this.

  • Stub/Client Generation of WSDL for Windows Communication Foundation Service

    Hii,
    I am building a client for the WCF service using Soap1.2 and ws-security. I have tried building a stub for the service using JDeveloper 10 g and also tried to validate the wsdl using XML spy. Both are giving errors. I wanna know how could i genrate the stub for the service and also Validate WSDL? I know i might have to modify the WSDL, but dont know what changes must be required? And Also which std i must adhere?
    Here is the WSDL
    <?xml version="1.0" encoding="utf-8"?>
    <wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
                      xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
                      xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
                      xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
                      xmlns:wsap10="http://www.w3.org/2005/08/addressing"
                      xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing"
                      xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
                      xmlns:i0="http://Corona.Services.UserMgmt.UserMgmtSrv"
                      xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/09/policy/addressing"
                      xmlns:xsd="http://www.w3.org/2001/XMLSchema"
                      xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract"
                      xmlns:tns="http://tempuri.org/"
                      xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
                      xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex"
                      xmlns:wsa10="http://www.w3.org/2005/08/addressing"
                      targetNamespace="http://tempuri.org/" name="UserMgmtSrv">
      <wsdl:import namespace="http://Corona.Services.UserMgmt.UserMgmtSrv"
                   location="http://debugger/Corona.Services/Corona.Services.svc?wsdl"/>
      <wsdl:types/>
      <wsdl:binding name="WSHttpBinding_UserMgmtSrv" type="i0:UserMgmtSrv">
        <wsp:PolicyReference URI="#WSHttpBinding_UserMgmtSrv_policy"/>
        <soap12:binding transport="http://schemas.xmlsoap.org/soap/http"/>
        <wsdl:operation name="Authenticate">
          <wsdl:input>
            <soap12:body use="literal"/>
          </wsdl:input>
          <wsdl:output>
            <soap12:body use="literal"/>
          </wsdl:output>
          <wsdl:fault name="ArgumentExceptionFault">
            <soap12:fault name="ArgumentExceptionFault"
                          namespace="http://Corona.Services.UserMgmt.UserMgmtSrv.FaultException"/>
          </wsdl:fault>
        </wsdl:operation>
        <wsdl:operation name="SaveHealthProfileWrapper">
          <wsdl:input>
            <soap12:body use="literal"/>
          </wsdl:input>
          <wsdl:output>
            <soap12:body use="literal"/>
          </wsdl:output>
        </wsdl:operation>
      </wsdl:binding>
      <wsdl:service name="UserMgmtSrv">
        <wsdl:port name="WSHttpBinding_UserMgmtSrv"
                   binding="tns:WSHttpBinding_UserMgmtSrv">
          <soap12:address location="https://debugger/Corona.Services/Corona.Services.svc"/>
          <wsa10:EndpointReference>
            <wsa10:Address>https://debugger/Corona.Services/Corona.Services.svc</wsa10:Address>
          </wsa10:EndpointReference>
        </wsdl:port>
      </wsdl:service>
      <wsp:Policy wsu:Id="WSHttpBinding_UserMgmtSrv_policy">
        <wsp:ExactlyOne>
          <wsp:All>
            <wspe:Utf816FFFECharacterEncoding xmlns:wspe="http://schemas.xmlsoap.org/ws/2004/09/policy/encoding"/>
            <sp:TransportBinding xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
              <wsp:Policy>
                <sp:TransportToken>
                  <wsp:Policy>
                    <sp:HttpsToken RequireClientCertificate="false"/>
                  </wsp:Policy>
                </sp:TransportToken>
                <sp:AlgorithmSuite>
                  <wsp:Policy>
                    <sp:Basic128/>
                  </wsp:Policy>
                </sp:AlgorithmSuite>
                <sp:Layout>
                  <wsp:Policy>
                    <sp:Strict/>
                  </wsp:Policy>
                </sp:Layout>
                <sp:IncludeTimestamp/>
              </wsp:Policy>
            </sp:TransportBinding>
            <sp:EndorsingSupportingTokens xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
              <wsp:Policy>
                <sp:SecureConversationToken sp:IncludeToken="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/AlwaysToRecipient">
                  <wsp:Policy>
                    <mssp:RequireCancel wsp:Optional="true"
                                        xmlns:mssp="http://schemas.microsoft.com/ws/2005/07/securitypolicy"/>
                    <sp:BootstrapPolicy>
                      <wsp:Policy>
                        <sp:TransportBinding>
                          <wsp:Policy>
                            <sp:TransportToken>
                              <wsp:Policy>
                                <sp:HttpsToken RequireClientCertificate="false"/>
                              </wsp:Policy>
                            </sp:TransportToken>
                            <sp:AlgorithmSuite>
                              <wsp:Policy>
                                <sp:Basic128/>
                              </wsp:Policy>
                            </sp:AlgorithmSuite>
                            <sp:Layout>
                              <wsp:Policy>
                                <sp:Strict/>
                              </wsp:Policy>
                            </sp:Layout>
                            <sp:IncludeTimestamp/>
                          </wsp:Policy>
                        </sp:TransportBinding>
                        <sp:EndorsingSupportingTokens>
                          <wsp:Policy>
                            <sp:SpnegoContextToken sp:IncludeToken="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy/IncludeToken/AlwaysToRecipient">
                              <wsp:Policy>
                                <mssp:RequireCancel wsp:Optional="true"
                                                    xmlns:mssp="http://schemas.microsoft.com/ws/2005/07/securitypolicy"/>
                              </wsp:Policy>
                            </sp:SpnegoContextToken>
                          </wsp:Policy>
                        </sp:EndorsingSupportingTokens>
                        <sp:Trust10>
                          <wsp:Policy>
                            <sp:MustSupportIssuedTokens/>
                            <sp:RequireClientEntropy/>
                            <sp:RequireServerEntropy/>
                          </wsp:Policy>
                        </sp:Trust10>
                      </wsp:Policy>
                    </sp:BootstrapPolicy>
                  </wsp:Policy>
                </sp:SecureConversationToken>
              </wsp:Policy>
            </sp:EndorsingSupportingTokens>
            <sp:Trust10 xmlns:sp="http://schemas.xmlsoap.org/ws/2005/07/securitypolicy">
              <wsp:Policy>
                <sp:MustSupportIssuedTokens/>
                <sp:RequireClientEntropy/>
                <sp:RequireServerEntropy/>
              </wsp:Policy>
            </sp:Trust10>
            <wsap10:UsingAddressing/>
          </wsp:All>
        </wsp:ExactlyOne>
      </wsp:Policy>
      <wsp:UsingPolicy/>
    </wsdl:definitions>

    I had the problem with JDev (9.0.4) when trying to generate server side classes from a homemade wsdl which took a complex type as a parameter. The only thing I got from JDeveloper was a class receiving an Element. Which pretty much means you have to do the work yourself.
    Quite disappointing....!
    I see to possibilities:
    1) If you are stuck with 9.0.4 you will have to parse to and from xml yourself. For this you can use jax-b which is a Sun API used to create classes for a given XML Schema to parse and validate XML. You have some work creating the classes, but it runs very fast when you have generated the classes.
    2) You use the topdown approach described on OTN. http://www.oracle.com/technology/sample_code/tech/java/codesnippet/webservices/doc-lit/index.html
    I think this is the example for OC4J (9.0.4). There is a new and improved version of the tool (wsa.jar) with the new OC4J (10.1.3)
    Have fun......and I am sure that Oracle quite soon will deliver the functionality directly from JDev....:-)
    /Peter

  • Oracle BPEL invoking Windows Communication Foundation Services

    Im right now studing the next generation of Microsoft technologies for SOA and WebServices. I correctly developed my first WCF service and was trying to invoke it using BPEL, but its not possible to do it. Anyone knows how to invoke a WCF service in BPEL? Im using wshttpBinding in my WCF service.
    Thanks for your time,
    Millan

    Can you post the whole binding configuration you are using. For default interoperability you should look at basicHttpbinding. In case you want to add things like Security with the wsHttpBinding keep in mind that Oracle BPEL only supports basic WS-Security

  • Windows Communication Foundation(WCF)

     Hi,
         i want to start WCF so what should i do first .
    Regards,
    Gopal Upadhyay

     Hi,
         i want to start WCF so what should i do first .
    Regards,
    Gopal Upadhyay
    You should buy a good book on WCF.

  • WCF client consumes JAVA web service - should I use WCF or just create a custom parser/message factory?

    We've a business partner who requires us to create a service request message with a SAML 2.0 assertion. The partner's supplied two certificates and a test harness for their JAVA webservice.
    I've created a WCF client with a `CustomBinding` to try and recreate the request and consume the service, but I'm getting so frustrated with the nuances of WCF (and the lack of intrinsic support for SAML 2.0) I'm wondering am I better off using something like
    a `WebClient` or `HttpWebRequest` and encrypting/building & signing the XML web request and doing the same for the response. I know there's a lot of work involved on this but at least I'd be in full control.
    Your advice would be very much appreciated, what I'm working with is displayed below
    **Note: I was supplied with a SoapUI Test harness for the Java service**
    **The vendor supplied me with this request (ran though SOAPUI and extracted via Fiddler)**
    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xenc="http://www.w3.org/2001/04/xmlenc#">
    <SOAP-ENV:Header xmlns:wsa="http://www.w3.org/2005/08/addressing">
    <wsse:Security SOAP-ENV:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
    <xenc:EncryptedKey Id="EncKeyId-29B98C291D1FDFB39113352984774895">
    <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>
    <ds:X509Data>
    <ds:X509IssuerSerial>
    <ds:X509IssuerName>CN=test_server</ds:X509IssuerName>
    <ds:X509SerialNumber>12356789</ds:X509SerialNumber>
    </ds:X509IssuerSerial>
    </ds:X509Data>
    </wsse:SecurityTokenReference>
    </ds:KeyInfo>
    <xenc:CipherData>
    <xenc:CipherValue>
    <!--Omitted -->
    </xenc:CipherValue>
    </xenc:CipherData>
    <xenc:ReferenceList>
    <xenc:DataReference URI="#EncDataId-3"/>
    </xenc:ReferenceList>
    </xenc:EncryptedKey>
    <wsse:BinarySecurityToken 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-29B98C291D1FDFB39113352984773591" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"><!-- Omitted --> </wsse:BinarySecurityToken>
    <ds:Signature Id="Signature-1" xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
    <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-2">
    <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>
    <!--Omitted -->
    </ds:DigestValue>
    </ds:Reference>
    </ds:SignedInfo>
    <ds:SignatureValue>
    <!--Omitted -->
    </ds:SignatureValue>
    <ds:KeyInfo Id="KeyId-29B98C291D1FDFB39113352984773792">
    <wsse:SecurityTokenReference wsu:Id="STRId-29B98C291D1FDFB39113352984773893" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
    <wsse:Reference URI="#CertId-29B98C291D1FDFB39113352984773591" 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:Security>
    <saml:Assertion ID="_54d0c8395de26c3e44730df2c9e8d3e9" IssueInstant="2012-02-17T10:40:36.806Z" Version="2.0" xmlns:saml="urn:oasis:names:tc:SAML:2.0:assertion">
    <saml:Issuer>CN=test_client</saml:Issuer>
    <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="#_54d0c8395de26c3e44730df2c9e8d3e9">
    <Transforms>
    <Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature"/>
    <Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
    </Transforms>
    <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
    <DigestValue>
    <!--Omitted -->
    </DigestValue>
    </Reference>
    </SignedInfo>
    <SignatureValue>
    <!--Omitted -->
    </SignatureValue>
    <KeyInfo>
    <X509Data>
    <X509Certificate>
    <!--Omitted -->
    </X509Certificate>
    </X509Data>
    </KeyInfo>
    </Signature>
    <saml:Subject>
    <saml:NameID Format="urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress">[email protected]</saml:NameID>
    </saml:Subject>
    <saml:Conditions NotBefore="2012-02-17T10:40:21.806Z" NotOnOrAfter="2012-02-17T10:41:06.806Z"/>
    </saml:Assertion>
    <wsa:Action SOAP-ENV:mustUnderstand="1">http://www.xxxxxxx.xxx/ws/schemas/xxxxxx1/xxxx/xxxxxxxxxxxxxx</wsa:Action>
    <wsa:MessageID SOAP-ENV:mustUnderstand="1">uuid:bffc27ba-68d9-44e6-b1f0-e2f852df7715</wsa:MessageID>
    </SOAP-ENV:Header>
    <SOAP-ENV:Body wsu:Id="id-2" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
    <xenc:EncryptedData Id="EncDataId-3" Type="http://www.w3.org/2001/04/xmlenc#Content">
    <xenc:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#tripledes-cbc"/>
    <ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
    <wsse:SecurityTokenReference xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
    <wsse:Reference URI="#EncKeyId-29B98C291D1FDFB39113352984774895"/>
    </wsse:SecurityTokenReference>
    </ds:KeyInfo>
    <xenc:CipherData>
    <xenc:CipherValue>
    <!--Omitted -->
    </xenc:CipherValue>
    </xenc:CipherData>
    </xenc:EncryptedData>
    </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>
    **This is as close as I've gotten with my WCF client. Issues I can immediatley is that the `<o:SecurityTokenReference>` element should contain the Issuer and Serial, instead it contains a `KeyIdentifier` element?**
    <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" xmlns:a="http://www.w3.org/2005/08/addressing" xmlns:u="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
    <s:Header>
    <a:Action s:mustUnderstand="1" u:Id="_3"/>
    <a:MessageID u:Id="_4">urn:uuid:fc8ef84b-dbf5-4150-a0c3-d4cc986333d1</a:MessageID>
    <ActivityId CorrelationId="a9e1fec4-32bc-4633-909e-3d601c809b3c" xmlns="http://schemas.microsoft.com/2004/09/ServiceModel/Diagnostics">d1909115-8922-46f3-a96c-db15bf91c599</ActivityId>
    <a:ReplyTo u:Id="_5">
    <a:Address>http://www.w3.org/2005/08/addressing/anonymous</a:Address>
    </a:ReplyTo>
    <VsDebuggerCausalityData xmlns="http://schemas.microsoft.com/vstudio/diagnostics/servicemodelsink">uIDPo27oY4/3mnBOry0YL4StqvcAAAAA0UM+eVt4fU2AOe9/B3lPDZNf/2HmAuNEvzAoW0eKVSUACQAA</VsDebuggerCausalityData>
    <a:To s:mustUnderstand="1" u:Id="_6">https://localhost:8089/ws</a:To>
    <o:Security s:mustUnderstand="1" xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
    <u:Timestamp u:Id="uuid-e5592f06-32af-40fb-996e-a0a469c7ed5e-2">
    <u:Created>2012-04-24T20:41:50.447Z</u:Created>
    <u:Expires>2012-04-24T20:46:50.447Z</u:Expires>
    </u:Timestamp>
    <e:EncryptedKey Id="uuid-e5592f06-32af-40fb-996e-a0a469c7ed5e-1" xmlns:e="http://www.w3.org/2001/04/xmlenc#">
    <e:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-1_5"/>
    <KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#">
    <o:SecurityTokenReference>
    <o:KeyIdentifier ValueType="http://docs.oasis-open.org/wss/oasis-wss-soap-message-security-1.1#ThumbprintSHA1" EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">lU10DQn4lSpE4fRpE9gslm5QDt0=</o:KeyIdentifier>
    </o:SecurityTokenReference>
    </KeyInfo>
    <e:CipherData>
    <e:CipherValue>
    <!--Omitted-->
    </e:CipherValue>
    </e:CipherData>
    <e:ReferenceList>
    <e:DataReference URI="#_2"/>
    <e:DataReference URI="#_7"/>
    <e:DataReference URI="#_8"/>
    </e:ReferenceList>
    </e:EncryptedKey>
    <o:BinarySecurityToken u:Id="uuid-fad0c01f-ab4b-4a5f-bec6-93aa8c2d5a52-1" 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"><!--Omitted--></o:BinarySecurityToken>
    <e:EncryptedData Id="_7" Type="http://www.w3.org/2001/04/xmlenc#Element" xmlns:e="http://www.w3.org/2001/04/xmlenc#">
    <e:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#tripledes-cbc"/>
    <e:CipherData>
    <e:CipherValue>
    <!--Omitted-->
    </e:CipherValue>
    </e:CipherData>
    </e:EncryptedData>
    <e:EncryptedData Id="_8" Type="http://www.w3.org/2001/04/xmlenc#Element" xmlns:e="http://www.w3.org/2001/04/xmlenc#">
    <e:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#tripledes-cbc"/>
    <e:CipherData>
    <e:CipherValue><!--Omitted--></e:CipherValue>
    </e:CipherData>
    </e:EncryptedData>
    </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">
    <e:EncryptedData Id="_2" Type="http://www.w3.org/2001/04/xmlenc#Content" xmlns:e="http://www.w3.org/2001/04/xmlenc#">
    <e:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#tripledes-cbc"/>
    <e:CipherData>
    <e:CipherValue><!--Omitted--></e:CipherValue>
    </e:CipherData>
    </e:EncryptedData>
    </s:Body>
    </s:Envelope>
    Using this configuration for the WCF CustomBinding
    <system.serviceModel>
    <bindings>
    <customBinding>
    <binding name="WSHttpBinding_IEnquiryRequest" >
    <transactionFlow />
    <security defaultAlgorithmSuite="TripleDesRsa15"
    authenticationMode="MutualCertificate"
    messageSecurityVersion="WSSecurity11WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11BasicSecurityProfile10"
    requireDerivedKeys="false"
    >
    <secureConversationBootstrap authenticationMode="CertificateOverTransport"
    messageSecurityVersion="WSSecurity11WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11BasicSecurityProfile10"
    requireDerivedKeys="false" />
    </security>
    <textMessageEncoding messageVersion="Soap11WSAddressing10" />
    <!--<mtomMessageEncoding messageVersion="Soap11WSAddressing10" />-->
    <httpsTransport requireClientCertificate="true" />
    </binding>
    </customBinding>
    </bindings>
    <behaviors>
    <endpointBehaviors>
    <behavior name="certBehaviour">
    <clientCredentials>
    <!-- clientCertificate not defaultCertificate -->
    <clientCertificate x509FindType="FindBySubjectName" storeLocation="CurrentUser" storeName="My" findValue="test_client" />
    <serviceCertificate>
    <defaultCertificate x509FindType="FindBySubjectName" storeLocation="CurrentUser" storeName="My" findValue="test_server"/>
    <authentication revocationMode="NoCheck" certificateValidationMode="None" />
    </serviceCertificate>
    </clientCredentials>
    </behavior>
    </endpointBehaviors>
    </behaviors>
    <client>
    <endpoint
    address="https://localhost:8089/pvs/ws"
    binding="customBinding"
    bindingConfiguration="WSHttpBinding_IEnquiryRequest"
    contract="XXXService.enquiryRequest"
    name="WSHttpBinding_IEnquiryRequest"
    behaviorConfiguration="certBehaviour"
    >
    <identity>
    <dns value="test_server"/>
    </identity>
    </endpoint>
    </client>
    </system.serviceModel>
    I've no idea how to insert the SAML 2.0 assertion in there before it's signed. That and the Key Issuer/serial issue above is where my main problems lie with the request.
    Any and all help appreciated
                        

    Yaron,
    Thanks a million for your response, think you hit the nail on the head there. Actually figured out the first part myself this morning, I've retrieved the SymmetricSecurityBindingElement object from the binding configured in the app.config and set it explicitly,
    just as you've defined. Couldnt figure out how to do this yesterday for some reason! Here's the code for anyone that's interested:
    //Get custom binding reference from app.config
    CustomBinding binding = new CustomBinding("bindingNameInConfig");
    // Reference the symmetric security element
    SymmetricSecurityBindingElement securityBindingElement = binding.Elements.Find<SymmetricSecurityBindingElement>();
    // Get the x509ProtectionParams from the security element
    X509SecurityTokenParameters tokenParameters = new X509SecurityTokenParameters();
    tokenParameters.X509ReferenceStyle = X509KeyIdentifierClauseType.IssuerSerial;
    tokenParameters.RequireDerivedKeys = false;
    tokenParameters.InclusionMode = SecurityTokenInclusionMode.AlwaysToInitiator;
    // Set the X509SecurityTokenParameters to point to the one's just configured. This is for symetric encryption, for asymetric this line needs to change
    securityBindingElement.ProtectionTokenParameters = tokenParameters;
    Are you sure that SAML assertion is not signed? That makes things a lot easier! Do you think the following approach will work when inserting in the SAML 2.0 assertion? :
    Create a class that inherits from IClientMessageInspector and insert the SAML as shown below
    using System;
    using System.Collections.Generic;
    using System.IO;
    using System.Linq;
    using System.ServiceModel;
    using System.ServiceModel.Channels;
    using System.ServiceModel.Description;
    using System.ServiceModel.Dispatcher;
    using System.Text;
    using System.Xml;
    using Microsoft.IdentityModel.Protocols.XmlSignature;
    namespace TestClient.Application
    class Saml20Extension : IClientMessageInspector, IEndpointBehavior
    #region Implementation of IClientMessageInspector
    public object BeforeSendRequest(ref Message request, IClientChannel channel)
    MessageBuffer buffer = request.CreateBufferedCopy(int.MaxValue);
    // ** Add the SAML Assertion XML here **
    request = buffer.CreateMessage();
    return null;
    public void AfterReceiveReply(ref Message reply, object correlationState)
    MessageBuffer buffer = reply.CreateBufferedCopy(Int32.MaxValue);
    // ** REMOVE THE SAML ASSERTION HERE **
    reply = buffer.CreateMessage();
    #endregion
    #region Implementation of IEndpointBehavior
    public void AddBindingParameters(ServiceEndpoint endpoint, System.ServiceModel.Channels.BindingParameterCollection bindingParameters)
    public void ApplyClientBehavior(ServiceEndpoint endpoint, ClientRuntime clientRuntime)
    // Add this implementation to the inspectors.
    clientRuntime.MessageInspectors.Add(this);
    public void ApplyDispatchBehavior(ServiceEndpoint endpoint, EndpointDispatcher endpointDispatcher)
    public void Validate(ServiceEndpoint endpoint)
    #endregion
    Also, There's a second signature being inserted into my WCF request that I need to replace with the SAML insertion - how do i get rid of the second signature?? (see updated request below)
    POST https://localhost:8089/pvs/ws HTTP/1.1
    Content-Type: text/xml; charset=utf-8
    SOAPAction: ""
    Host: localhost:8089
    Content-Length: 6720
    Expect: 100-continue
    Accept-Encoding: gzip, deflate
    Connection: Keep-Alive
    <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" xmlns:a="http://www.w3.org/2005/08/addressing" xmlns:u="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
    <s:Header>
    <a:Action s:mustUnderstand="1" u:Id="_3"/>
    <a:MessageID u:Id="_4">urn:uuid:84dc0bb8-13fd-4e90-84c4-ed1e6e831801</a:MessageID>
    <ActivityId CorrelationId="07e0df62-d40a-4e24-aacc-12e626f80e8b" xmlns="http://schemas.microsoft.com/2004/09/ServiceModel/Diagnostics">40077c44-d415-4567-99a1-1ea610c41d94</ActivityId>
    <a:ReplyTo u:Id="_5">
    <a:Address>http://www.w3.org/2005/08/addressing/anonymous</a:Address>
    </a:ReplyTo>
    <VsDebuggerCausalityData xmlns="http://schemas.microsoft.com/vstudio/diagnostics/servicemodelsink">uIDPo1f0ZJ98FOxIvULl0pmGv/wAAAAAEGu5/G7VNkia/XbStJDa+ldqi+8xxdtAiBL+Y8vCqa0ACQAA</VsDebuggerCausalityData>
    <a:To s:mustUnderstand="1" u:Id="_6">https://localhost:8089/pvs/ws</a:To>
    <o:Security s:mustUnderstand="1" xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
    <e:EncryptedKey Id="uuid-5b1de37e-ea76-4f75-b268-ebb63b554c11-1" xmlns:e="http://www.w3.org/2001/04/xmlenc#">
    <e:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#rsa-1_5"/>
    <KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#">
    <o:SecurityTokenReference>
    <X509Data>
    <X509IssuerSerial>
    <X509IssuerName>CN=test_server</X509IssuerName>
    <X509SerialNumber>123456789</X509SerialNumber>
    </X509IssuerSerial>
    </X509Data>
    </o:SecurityTokenReference>
    </KeyInfo>
    <e:CipherData>
    <e:CipherValue><!--Omitted--></e:CipherValue>
    </e:CipherData>
    <e:ReferenceList>
    <e:DataReference URI="#_2"/>
    </e:ReferenceList>
    </e:EncryptedKey>
    <o:BinarySecurityToken u:Id="uuid-d62ff21f-7e9b-460d-a0ee-d5fad221427d-1" 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">MIIBpzCCARCgAwIBAgIETzKMfzANBgkqhkiG9w0BAQUFADAYMRYwFAYDVQQDDA10ZXN0X2ZhY2lsaXR5MB4XDTEyMDIwODE0NTM1MVoXDTE3MDIwODE0NTM1MVowGDEWMBQGA1UEAwwNdGVzdF9mYWNpbGl0eTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAvzdwlxcpwRKGzLvpqYoS4NEbhbx/jV6Z6kyXgJ0IWLZAW20oWmxPwumsqkKr6bWX2NWbGrka6w1e9+iZFBKiBq5zzxJKusCJQtPjuYwjaTGjVTFnixHp9sKnjIEprKyarceG00WzCVdtuI1NpNp8dgemzA6FFt1ESwwELq+rKvECAwEAATANBgkqhkiG9w0BAQUFAAOBgQAokX6HZhhEj7Bfo0Z8ZeoZeYFB8pHrN5A6927cJx17EXWVv0Mwn/+fDgTAhtsN9DB68CFNejox8mM0+KewjsgT4z80YxMHGlpM13z4c8+iMiQcJ7cISScTBaTONOtDqK1WNtci8biNjnLn7+4Z4fw17jlttN0dPHC3fvGywh6TkQ==</o:BinarySecurityToken>
    <Signature Id="_0" 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#hmac-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>
    <!--Omitted-->
    </DigestValue>
    </Reference>
    <Reference URI="#_3">
    <Transforms>
    <Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
    </Transforms>
    <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
    <DigestValue>
    <!--Omitted-->
    </DigestValue>
    </Reference>
    <Reference URI="#_4">
    <Transforms>
    <Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
    </Transforms>
    <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
    <DigestValue>
    <!--Omitted-->
    </DigestValue>
    </Reference>
    <Reference URI="#_5">
    <Transforms>
    <Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
    </Transforms>
    <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
    <DigestValue>
    <!--Omitted-->
    </DigestValue>
    </Reference>
    <Reference URI="#_6">
    <Transforms>
    <Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
    </Transforms>
    <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
    <DigestValue>
    <!--Omitted-->
    </DigestValue>
    </Reference>
    </SignedInfo>
    <SignatureValue>
    <!--Omitted-->
    </SignatureValue>
    <KeyInfo>
    <o:SecurityTokenReference k:TokenType="http://docs.oasis-open.org/wss/oasis-wss-soap-message-security-1.1#EncryptedKey" xmlns:k="http://docs.oasis-open.org/wss/oasis-wss-wssecurity-secext-1.1.xsd">
    <o:Reference ValueType="http://docs.oasis-open.org/wss/oasis-wss-soap-message-security-1.1#EncryptedKey" URI="#uuid-5b1de37e-ea76-4f75-b268-ebb63b554c11-1"/>
    </o:SecurityTokenReference>
    </KeyInfo>
    </Signature><!-- Why is this second signature here? how do i get rid of it and replace with SAML --> <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="#_0">
    <Transforms>
    <Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#"/>
    </Transforms>
    <DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1"/>
    <DigestValue>
    <!--Omitted-->
    </DigestValue>
    </Reference>
    </SignedInfo>
    <SignatureValue>
    <!--Omitted-->
    </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-d62ff21f-7e9b-460d-a0ee-d5fad221427d-1"/>
    </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">
    <e:EncryptedData Id="_2" Type="http://www.w3.org/2001/04/xmlenc#Content" xmlns:e="http://www.w3.org/2001/04/xmlenc#">
    <e:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#tripledes-cbc"/>
    <e:CipherData>
    <e:CipherValue>
    <!--Omitted-->
    </e:CipherValue>
    </e:CipherData>
    </e:EncryptedData>
    </s:Body>
    </s:Envelope>

  • WCF Web Service Support

    Does Xcelsius support Microsoft Windows Communication Foundation Web Services? I've downloaded the trail version of Xcelsius Engage 2008 and when I try to load a WCF WSDL I get an error message stating Unable to Load.
    Thanks in advance,

    Hi Zhong,
           Thanks you for your reply and shared link. I have read that post before i post here. I'll read again.
           I do understand on "PreAuthenticate" like this. I'll be receive 401 first request if i set "PreAuthenticate=true". Because i haven't pass authentication to server. After authentication is successful
    I'll receive 200. So response should be like 401,401,200. Same as your explanation to me.
    But it does not mean it'll send the authentication information the first time HttpWebRequest send request to the server. So the server will give you a 401 response at the first request, then the HttpWebRequest will resend the request with the Authentication header information.
    In the subsequent requests, the authentication information will be cached.
     But why i got 401 again after i passed authentication to server and server already cached the authentication. It should be
    401,401,200,200.
     Now i got 401,401,200,401,200. I confuse on this part.
     If i use below code
    // Below is work but i can't use for my requirement.
    _Cred = new NetworkCredential("user", "password", "domain");
    credCache.Add(new Uri(url), "Negotiate",
    _Cred);
    req = (HttpWebRequest)WebRequest.Create(url);
    req.PreAuthenticate = true;
    req.Credentials = credCache;
    resp = req.GetResponse();
    if (req.HaveResponse)
    resp.Close();
    req = HttpWebRequest.Create(url) as HttpWebRequest;
    req.PreAuthenticate = true;
    req.Credentials = credCache;
    resp = req.GetResponse();
    if (req.HaveResponse)
    resp.Close();
    I'll get 401,401,200,200. Third time response is 200. Only different is user name and password and DefaultNetworkCredentials.
       Am i misunderstand on this? I appreciate your help.
    Regards,
    Yukon
    Make Simple & Easy

  • Consume WCF Web Service from Designer

    I am trying to consume a Windows Communications Foundation web service from within Adobe Form Designer and I believe the WSDL generated in incompatible. The WCF WSDL uses <xsd:import> tags to include other files containing the object schemas, such as the input and output parameters to method calls. Adobe doesn't seem to understand this notation and just shows "Body" for both the input and output, which is not correct.<br /><br />Is there a way to get these technologies to work together?

     I understand that you have to set the end point up using code
    Hello Paul,
    David have setup the endpoint in the code with this line
    var endpointAddress = new EndpointAddress(this.Variables.ServiceUrl);
    and this means he have created a SSIS variable containing the URL for the web service.
    Olaf Helper
    [ Blog] [ Xing] [ MVP]

  • Windows Communcation Foundation - JSR 172 Web Stub - interoperability

    Hi! I am just playing with WCF -Windows Communication Foundation and JSR 172 Web Stub generation utility of WTK 2.5beta - is there a known problem with the import-expression i XML?
    WCF generates:
    ?wsdl -> web service descrption that has import- references to
      <?xml version="1.0" encoding="utf-8" ?>
    - <wsdl:definitions name="EchoService" targetNamespace="http://tempuri.org/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="http://tempuri.org/" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:i0="http://schemas.microsoft.com/ws/2005/02/mex/bindings" xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/08/addressing/policy" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:wsa10="http://www.w3.org/2005/08/addressing" xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex">
      <wsdl:import namespace="http://schemas.microsoft.com/ws/2005/02/mex/bindings" location="http://localhost:8080/echo?wsdl=wsdl0" />
    - <wsdl:types>
    - <xsd:schema targetNamespace="http://tempuri.org/Imports">
      <xsd:import schemaLocation="http://localhost:8080/echo?xsd=xsd0" namespace="http://tempuri.org/" />
      <xsd:import schemaLocation="http://localhost:8080/echo?xsd=xsd1" namespace="http://schemas.microsoft.com/2003/10/Serialization/" />
      </xsd:schema>
      </wsdl:types>
    + <wsdl:message name="IEchoService_Echo_InputMessage">
      <wsdl:part name="parameters" element="tns:Echo" />
      </wsdl:message>
    - <wsdl:message name="IEchoService_Echo_OutputMessage">
      <wsdl:part name="parameters" element="tns:EchoResponse" />
      </wsdl:message>
    - <wsdl:portType name="IEchoService">
    - <wsdl:operation name="Echo">
      <wsdl:input wsaw:Action="http://tempuri.org/IEchoService/Echo" message="tns:IEchoService_Echo_InputMessage" />
      <wsdl:output wsaw:Action="http://tempuri.org/IEchoService/EchoResponse" message="tns:IEchoService_Echo_OutputMessage" />
      </wsdl:operation>
      </wsdl:portType>
    - <wsdl:service name="EchoService">
    - <wsdl:port name="MetadataExchangeHttpBinding_IEchoService" binding="i0:MetadataExchangeHttpBinding_IEchoService">
      <soap12:address location="http://localhost:8080/echo" />
    - <wsa10:EndpointReference>
      <wsa10:Address>http://localhost:8080/echo</wsa10:Address>
      </wsa10:EndpointReference>
      </wsdl:port>
      </wsdl:service>
      </wsdl:definitions>?wsdl=wsdl0
    ?xsd=xsd0
    ?xsd=xsd1Anyone experienced the same problem and knows a solution ?
    Henning

    I have gotten a step futher! The emulator had to be configured to run in the "secure" domain (as mentioned by some other people here), otherwise a http response "400 bad request (invalid header name)" was produced. J2ME web service is interoperable with WCF basichttpbinding (without debugging becuase it inserts unparseable soap-code into the http response)

Maybe you are looking for