none
Consuming a remote SOAP web service which has WSSe RRS feed

  • Question

  • I am trying to consume a web service from a remote url that has WSSe, & the online advice is contradictory , & there are issues when adding it to a project.  

    What is the recommended approach now? 

    • Some posts say I should add WSE 3.
    • Some say WSE not supported anymore & I should use WCF.
    • Some say WCF doesnt support it.  
    When I right click service references add service reference & add  https://some.one.elses/getPersonService?wsdl
    It shows the operations.  

    After adding this, I can create a new custom object (mygetPerson)  & see all the named parameters ( Eg Surname, Firstname etc..) 

    BUT there is no CLIENT CREDENTIALS object as referred to in many online examples

    Conversely when I attempt to follow WCF tutorials & point SVCutil.exe or WSDL.exe at https://some.one.elses/getPersonService?wsdl, then I get a 405 method not allowed error. even when I add a valid id / password



    Richard

    • Moved by DotNet Wang Tuesday, November 24, 2015 3:32 AM
    Monday, November 23, 2015 2:22 PM

Answers

  • Can you please post me the code of the creation of the ServiceClient?

    You know, where you call the Constructor of the generated client

    You know, it seems ws Security is not available in the standard, but this is how it supposed to be done, seem like i cannot assist in this, never done it

    it a microsoft link if you don't trust that download:

    http://download.microsoft.com/download/e/7/7/e77e5b26-1a19-49b7-b90c-d0847882e848/WCF%20and%20WS-Security%20updated.doc

    Hope it helps


    • Edited by MDeero Wednesday, November 25, 2015 4:10 PM
    • Marked as answer by Richard Scannell Thursday, November 26, 2015 11:12 AM
    Wednesday, November 25, 2015 3:58 PM

All replies

  • Hi Richard,

    As your issue is more related to WCF, I help you move this case to WCF forum for dedicated support.

    Thank you for your understanding.

    Best Regards,
    Li Wang


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Tuesday, November 24, 2015 4:05 AM
  • Hi Richard Scannell,

    According to this case, if you want to use the WCF. And used wshttpbinding, maybe

    you can try set the security mode as none.

    Because, when we used wshttpbinding, the default security mode is message.

    So, you can change it in web.config file. like below:

    <wsHttpBinding>
            <binding name="wsHttpBinding">
              <security mode="None">
              </security>
            </binding>
    </wsHttpBinding>

    Best Regards,

    Grady

    Wednesday, November 25, 2015 7:57 AM
    Moderator
  • You need to use a different Endpoint for your metadata. MEX in WCF, it needs to bypass validation, since it's just shares what methods are available. It should also be disabled when you go into production.

    It might also be possible, taht the Endpoint is not registered in Windows (with netsh for example). You should try to use administrator rights with VS in that case or ofc use netsh to enable the endpoint.

    The ClientCredentials Property is normally applied to the Client (generated from the wsdl, when using code) or the Behavior (when using XML) on the Client.

    Edit : I think this can help you, or maybe a bit more here

    Cheers






    • Edited by MDeero Wednesday, November 25, 2015 10:57 AM
    Wednesday, November 25, 2015 10:48 AM
  • Thanks all for this.  

     I am not sure what language the remote service is written in  ( I  though the whole point of web services was that they could be technology agnostic) , but they're not asmx or WCF.  The only endpoint I have is a .wsdl file, which I have pointed my project to as a Service Reference.   As far as I can tell this operation works as it generates references to the functions available in the Service  EG 

    myNameSpace.searchPersonRequest();

    HowerSVCUTIL.exe & WSDL.exe are not able to analyse this endpoint, & I dont know if a mex exists ( IS that just WCF or does it apply to other services too) .    So I have not been able to build any proxies


    Richard

    Wednesday, November 25, 2015 2:20 PM
  • WSDL is the WebServiceDescriptionLanguage used by WCF to let it be implemented on Clients.

    As far as I know, MEX is only used by WCF and it always exposes WSDL´which in turn is always in XML.

    Please explain again what your issue is, cause as said, Credentials are not added to the Functions but checked before. For example with (HTTP) Basic Authentication (its a standard), a Header is filled with the Credentials.

    What you are referring to is the Property of your Client and there it depends on what kind of Credential is used, Windows, Basic, Certificate, also depends on where it is used on, either the Transport level or on the Message itself.

    Please just state exactly what you wanna do (preferrable post the code of your client [how you consume the Endpoint]) so we can support you better. Cause as far as I can tell, you have little experience with WCF (not wanna to offend).

    Wednesday, November 25, 2015 2:59 PM
  • ..Spot on MDeero :)  - I've not had any experience with WCF, & I was not entirely convinced it was the most suitable solution. WebClient has worked well for me in the past, but got steered towards WCF by posts relating to the WSEE standard, which is what this service requires for authorisation.   

    I am trying to post the following soap ( derived from the WSDL) at the service www.ourIntranet/framework/searchPerson

    <soapenv:Envelope xmlns:sear="http://www.XternalOrg.co.uk/framework/searchperson" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
       <soapenv:Header>
          <wsse:Security soapenv:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
             <wsu:Timestamp wsu:Id="TS-053F4F55F3E9532E3812341234505581601">
                <wsu:Created>2015-11-25T11:22:38.160Z</wsu:Created>
                <wsu:Expires>2015-11-25T11:23:38.160Z</wsu:Expires>
             </wsu:Timestamp>
             <wsse:UsernameToken wsu:Id="UsernameToken-053F4F55F3E5672E3814484505497522">
                <wsse:Username>myUserID</wsse:Username>
                <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">myPassWord</wsse:Password>
                <wsse:Nonce EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">1d9ugJC310T6b9YzujAa8Q==</wsse:Nonce>
                <wsu:Created>2015-11-25T11:22:29.757Z</wsu:Created>
             </wsse:UsernameToken>
          </wsse:Security>
       </soapenv:Header>
       <soapenv:Body>
          <sear:SearchPersonRequest>
             <SearchPersonParameters>
                <PersonGivenName>Bloggs</PersonGivenName>
                <PersonFamilyName>Fred</PersonFamilyName>
             </SearchPersonParameters>
          </sear:SearchPersonRequest>
       </soapenv:Body>
    </soapenv:Envelope>

    I had been anticipating that SVCUTIL or WSDL.exe  would build a custom client where the I could set the userid & password.  


    Richard

    Wednesday, November 25, 2015 3:23 PM
  • As far as i understand (and i have to admit to guessing here), this is not a WSDL, it is the Message of a "conversation" between the Client and the Service, i don't think the Tools can generate a wsdl from this (but i don't know the tools, so...).

    try to get a Mex endpoint, you should be able to let VS take care of that, just paste in the base address into the Add Service Reference on the WCF Client Project.

    Edit: Oh and regarding WSEE => ??? (reading up on it),

    Edit2: Having like no luck at all


    • Edited by MDeero Wednesday, November 25, 2015 3:33 PM
    Wednesday, November 25, 2015 3:29 PM
  • The xml is the result of creating a new project in SOAPUI,  which asks for the WSDL.  & then which genarates the wrappers for the SOAPUI client to use.   It is a template for the SOAP to be posted at the searchPerson endpoint.  

    Is MEX a generic standard or WCF only - I thought it was WCF only ?  I dont think this is a WCF service - so I am not sure if I can use a MEX  

    I have used the same /searchPerson.wsdl uri  in the Add Service Reference in my Visual Studio project and that listed several functions & operations.  Intellisense appears to be aware of them too, when I tried to create an object based on the class.  But there was no obvious structure to hold the credentials :( 


    Richard

    Wednesday, November 25, 2015 3:51 PM
  • Can you please post me the code of the creation of the ServiceClient?

    You know, where you call the Constructor of the generated client

    You know, it seems ws Security is not available in the standard, but this is how it supposed to be done, seem like i cannot assist in this, never done it

    it a microsoft link if you don't trust that download:

    http://download.microsoft.com/download/e/7/7/e77e5b26-1a19-49b7-b90c-d0847882e848/WCF%20and%20WS-Security%20updated.doc

    Hope it helps


    • Edited by MDeero Wednesday, November 25, 2015 4:10 PM
    • Marked as answer by Richard Scannell Thursday, November 26, 2015 11:12 AM
    Wednesday, November 25, 2015 3:58 PM
  • Thanks for this, I think I have found the Client class  - I am going to see how far I get with it , & I'll get back to you 



    Richard

    Wednesday, November 25, 2015 4:29 PM
  • Thanks all for your help.  the links & pointers have taken me much further forward

    Richard

    Thursday, November 26, 2015 11:12 AM