6 Replies Latest reply: Feb 16, 2012 10:50 PM by 917005 RSS

    How to invoke the "CustomRecordType" web service? Missing <wsse:Security

    917005
      How to invoke the "CustomRecordType" web service? I always got "Missing &lt;wsse:Security> in SOAP Header" error...
      I downloaded the wsdl and tried to invoke it from soap ui but failed, following is the request and response:
      Request:
      <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:cus="urn:crmondemand/ws/odesabs/customrecordtype/" xmlns:data="urn:/crmondemand/xml/customrecordtype/data" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wsswssecurity-secext-1.0.xsd">
      <soapenv:Header>
      <wsse:Security>
      <wsse:UsernameToken>
      <wsse:Username>xxx</wsse:Username>
      <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">xxx</wsse:Password>
      </wsse:UsernameToken>
      </wsse:Security>
      </soapenv:Header>
      <soapenv:Body>
      <cus:CustomRecordTypeUpsert_Input>
      <data:CustomRecordType>
      <!--You may enter the following 6 items in any order-->
      <data:Name>myname</data:Name>
      <!--Optional:-->
      <data:SingularName>myname</data:SingularName>
      <!--Optional:-->
      <data:PluralName>myname</data:PluralName>
      <!--Optional:-->
      <data:ShortName>myname</data:ShortName>
      <!--Optional:-->
      <data:IconName>myname</data:IconName>
      <data:ListOfCustomRecordTypeTranslations>
      <!--1 or more repetitions:-->
      <data:CustomRecordTypeTranslation>
      <!--You may enter the following 4 items in any order-->
      <data:LanguageCode>?</data:LanguageCode>
      <data:SingularName>?</data:SingularName>
      <data:PluralName>?</data:PluralName>
      <data:ShortName>?</data:ShortName>
      </data:CustomRecordTypeTranslation>
      </data:ListOfCustomRecordTypeTranslations>
      </data:CustomRecordType>
      </cus:CustomRecordTypeUpsert_Input>
      </soapenv:Body>
      </soapenv:Envelope>
      Response:
      <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
      <env:Header/>
      <env:Body>
      <env:Fault xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
      <faultcode>wsse:InvalidSecurity</faultcode>
      <faultstring>Missing &lt;wsse:Security> in SOAP Header</faultstring>
      <faultactor/>
      </env:Fault>
      </env:Body>
      </env:Envelope>
      Per the web service guide, using wsse="http://schemas.xmlsoap.org/ws/2002/04/secext" and wsse="http://schemas.xmlsoap.org/ws/2002/07/secext" will have the same issue. Does anything else need to do before invoking this web service? Can anybody help? Thanks in advance!
        • 1. Re: How to invoke the "CustomRecordType" web service? Missing <wsse:Security
          Charles Dubant[eFrontech]
          Dear colleague,

          Few things that seem odd :

          The string I use in my definition of security namespace is :
          "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"

          Yours is :
          "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wsswssecurity-secext-1.0.xsd"

          I assume you're missing a "-" and the SOAP answer is :
          <env:Fault xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">

          Therefore you can find below the structure that is working for me :

          <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="urn:crmondemand/ws/ecbs/opportunity/10/2004" xmlns:quer="urn:/crmondemand/xml/Opportunity/Query" xmlns:ns1="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
          <soapenv:Header>
               <ns1:Security>
                    <ns1:UsernameToken>
                    <ns1:Username>COMPANYID/USERNAME</ns1:Username>
                    <ns1:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">PASSWORD</ns1:Password>
                    </ns1:UsernameToken>
               </ns1:Security>
          </soapenv:Header>

          Hope this works out for you,
          Best regards,
          Charles.

          Edited by: user8104568 on 13 févr. 2012 01:43
          • 2. Re: How to invoke the "CustomRecordType" web service? Missing <wsse:Security
            917005
            Thank you very much for the help! After I modified the wsse namespace(which is copied from the guide), I got following error:
            <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ns0="urn:crmondemand/ws/odesabs/customrecordtype/" xmlns:ns1="urn:/crmondemand/xml/customrecordtype/data" xmlns:ns2="urn:/crmondemand/xml/customrecordtype/query">
            <env:Body>
            <env:Fault>
            <faultcode>env:Server</faultcode>
            <faultstring>Internal Server Error (unexpected null value for literal data)</faultstring>
            </env:Fault>
            </env:Body>
            </env:Envelope>

            Do you know the possible reasons? Thanks in advance!
            • 3. Re: How to invoke the "CustomRecordType" web service? Missing <wsse:Security
              Sablok
              Hi,

              Please use the below code for your Web Service Call
              <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" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:cus="urn:crmondemand/ws/odesabs/customrecordtype/" xmlns:data="urn:/crmondemand/xml/customrecordtype/data">
              <SOAP-ENV:Header>
                        <wsse:Security xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/07/secext">
                             <wsse:UsernameToken>
                                  <wsse:Username> USERNAME </wsse:Username>
                                  <wsse:Password> PASSWORD </wsse:Password>
                             </wsse:UsernameToken>
                        </wsse:Security>
              </SOAP-ENV:Header>
              <SOAP-ENV:Body>
              <cus:CustomRecordTypeUpsert_Input>
              <data:CustomRecordType>
              <!--You may enter the following 6 items in any order-->
              <data:Name>myname</data:Name>
              <!--Optional:-->
              <data:SingularName>myname</data:SingularName>
              <!--Optional:-->
              <data:PluralName>myname</data:PluralName>
              <!--Optional:-->
              <data:ShortName>myname</data:ShortName>
              <!--Optional:-->
              <data:IconName>myname</data:IconName>
              <data:ListOfCustomRecordTypeTranslations>
              <!--1 or more repetitions:-->
              <data:CustomRecordTypeTranslation>
              <!--You may enter the following 4 items in any order-->
              <data:LanguageCode>?</data:LanguageCode>
              <data:SingularName>?</data:SingularName>
              <data:PluralName>?</data:PluralName>
              <data:ShortName>?</data:ShortName>
              </data:CustomRecordTypeTranslation>
              </data:ListOfCustomRecordTypeTranslations>
              </data:CustomRecordType>
              </cus:CustomRecordTypeUpsert_Input>
              </SOAP-ENV:Body>
              </SOAP-ENV:Envelope>

              Hope that helps!

              Thanks & Regards
              Sablok Kumar
              • 4. Re: How to invoke the "CustomRecordType" web service? Missing <wsse:Security
                917005
                Hi Sablok,
                Thanks for your reply, but using your wsse namespace xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/07/secext" will also have that "Missing <wsse:Security..." issue. I think the correct namespace should be: xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
                Anyway, thank you for the information, now I have the null literal issue, can you help to look at it? Thanks in advance!
                • 5. Re: How to invoke the "CustomRecordType" web service? Missing <wsse:Security
                  Sablok
                  Hi,

                  For null literal issue please make sure that you provide input for all the required fields.

                  Thanks & Regards
                  Sablok Kumar
                  • 6. Re: How to invoke the "CustomRecordType" web service? Missing <wsse:Security
                    917005
                    Thanks for reply! Which fields should be provided? My soap request has been posted in this thread.
                    For the CustomRecordType service, which url location should I use?
                    1) https://secure-ausomxapa.crmondemand.com/Services/cte/CustomRecordTypeService
                    or
                    2) https://secure-ausomxapa.crmondemand.com/Services/Integration
                    ?
                    Using 1) I'll get "Internal Server Error (unexpected null value for literal data)" error; using 2) I'll get "The HTTP request did not contain a valid SOAPAction header" error.
                    Do you have an example to use this service? Thanks in advance!