locked
Call Webservices RRS feed

  • Question

  • HI all,

    There is one webservice which is facilitate to send SMS's. The following is the webservice code

    <?xml version="1.0" encoding="utf-8"?>
    <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
      <soap:Body>
        <SendSMSMT xmlns="http://www.netsize.com/webservices/">
          <sServer>string</sServer>
          <sPort>string</sPort>
          <nTimeout>string</nTimeout>
          <sEndpointName>string</sEndpointName>
          <sPeerName>string</sPeerName>
          <bUseSSL>string</bUseSSL>
          <bTPRP>string</bTPRP>
          <sLogin>string</sLogin>
          <sPassword>string</sPassword>
          <sTarget>string</sTarget>
          <sMessage>string</sMessage>
          <sMessageID>string</sMessageID>
          <sADC>string</sADC>
          <sOADC>string</sOADC>
          <sServiceId>string</sServiceId>
          <sHandsetType>string</sHandsetType>
          <sTPUDH>string</sTPUDH>
          <sTPUDLb>string</sTPUDLb>
          <sPrice>string</sPrice>
          <nSubscription>string</nSubscription>
          <nClass>string</nClass>
          <nNotification>string</nNotification>
          <nBitNumber>string</nBitNumber>
          <nCharNumber>string</nCharNumber>
          <nDCS>string</nDCS>
          <nEncoding>string</nEncoding>
          <nAppType>string</nAppType>
          <nPriority>string</nPriority>
          <nBinary>string</nBinary>
          <bBinary>string</bBinary>
          <bTPUDHI>string</bTPUDHI>
          <bUnicode>string</bUnicode>
          <sExtID>string</sExtID>
          <sRequestID>string</sRequestID>
          <sDelayDate>string</sDelayDate>
          <sValidityDate>string</sValidityDate>
          <nDispatchOperator>string</nDispatchOperator>
          <sDispatchPrice>string</sDispatchPrice>
          <sDispatchApplication>string</sDispatchApplication>
          <sDispatchShortCode>string</sDispatchShortCode>
          <sDispatchMessageType>string</sDispatchMessageType>
          <sRealAlias>string</sRealAlias>
          <sTPPID>string</sTPPID>
          <sExtContentType>string</sExtContentType>
          <sMTFreeReason>string</sMTFreeReason>
          <sContractID>string</sContractID>
          <nMediaType>string</nMediaType>
          <nSubscriptionAction>string</nSubscriptionAction>
          <nSubscriptionId>string</nSubscriptionId>
          <nSubscriptionPIN>string</nSubscriptionPIN>
          <nRequestPIN>string</nRequestPIN>
          <sOutput>string</sOutput>
        </SendSMSMT>
      </soap:Body>
    </soap:Envelope>

    I dont know how to call this webservice from CRM using JS. I have all the parameters. Ill supply all the parameters from CRM by creating a entity. I would like to know how to call this service from CRM. Please help

    Regards,
    GF
    Friday, July 3, 2009 11:44 AM

Answers

  • Hi.

    Try this, but replace all string in request with real values:

    var xml = "<?xml version='1.0' encoding='utf-8'?>"+
    "<soap:Envelope xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'>"+
    "  <soap:Body>"+
    "    <SendSMSMT xmlns='http://www.netsize.com/webservices/'>"+
    "      <sServer>string</sServer>"+
    "      <sPort>string</sPort>"+
    "      <nTimeout>string</nTimeout>"+
    "      <sEndpointName>string</sEndpointName>"+
    "      <sPeerName>string</sPeerName>"+
    "      <bUseSSL>string</bUseSSL>"+
    "      <bTPRP>string</bTPRP>"+
    "      <sLogin>string</sLogin>"+
    "      <sPassword>string</sPassword>"+
    "      <sTarget>string</sTarget>"+
    "      <sMessage>string</sMessage>"+
    "      <sMessageID>string</sMessageID>"+
    "      <sADC>string</sADC>"+
    "      <sOADC>string</sOADC>"+
    "      <sServiceId>string</sServiceId>"+
    "      <sHandsetType>string</sHandsetType>"+
    "      <sTPUDH>string</sTPUDH>"+
    "      <sTPUDLb>string</sTPUDLb>"+
    "      <sPrice>string</sPrice>"+
    "     <nSubscription>string</nSubscription>"+
    "      <nClass>string</nClass>"+
    "      <nNotification>string</nNotification>"+
    "      <nBitNumber>string</nBitNumber>"+
    "      <nCharNumber>string</nCharNumber>"+
    "      <nDCS>string</nDCS>"+
    "      <nEncoding>string</nEncoding>"+
    "      <nAppType>string</nAppType>"+
    "      <nPriority>string</nPriority>"+
    "      <nBinary>string</nBinary>"+
    "      <bBinary>string</bBinary>"+
    "      <bTPUDHI>string</bTPUDHI>"+
    "      <bUnicode>string</bUnicode>"+
    "      <sExtID>string</sExtID>"+
    "      <sRequestID>string</sRequestID>"+
    "      <sDelayDate>string</sDelayDate>"+
    "      <sValidityDate>string</sValidityDate>"+
    "      <nDispatchOperator>string</nDispatchOperator>"+
    "      <sDispatchPrice>string</sDispatchPrice>"+
    "      <sDispatchApplication>string</sDispatchApplication>"+
    "      <sDispatchShortCode>string</sDispatchShortCode>"+
    "      <sDispatchMessageType>string</sDispatchMessageType>"+
    "      <sRealAlias>string</sRealAlias>"+
    "      <sTPPID>string</sTPPID>"+
    "      <sExtContentType>string</sExtContentType>"+
    "      <sMTFreeReason>string</sMTFreeReason>"+
    "      <sContractID>string</sContractID>"+
    "      <nMediaType>string</nMediaType>"+
    "      <nSubscriptionAction>string</nSubscriptionAction>"+
    "      <nSubscriptionId>string</nSubscriptionId>"+
    "      <nSubscriptionPIN>string</nSubscriptionPIN>"+
    "      <nRequestPIN>string</nRequestPIN>"+
    "      <sOutput>string</sOutput>"+
    "    </SendSMSMT>"+
    "  </soap:Body>"+
    "</soap:Envelope>";
    
    var xHReq = new ActiveXObject("Msxml2.XMLHTTP");
    xHReq.Open("POST", "http://wwwfr.netsizeonline.com/NAGWebService2/AGEndpoint.asmx", false);
    xHReq.setRequestHeader("SOAPAction","http://www.netsize.com/webservices/SendSMSMT");
    xHReq.setRequestHeader("Content-Type", "text/xml; charset=utf-8");
    xHReq.setRequestHeader("Content-Length", xml.length);
    xHReq.send(xml);
    

    Truth is opened the prepared mind My blog - http://a33ik.blogspot.com
    Friday, July 3, 2009 12:36 PM
    Moderator

All replies

  • Hi.

    Could you give the webservice url. I'll try to help you.
    Truth is opened the prepared mind My blog - http://a33ik.blogspot.com
    Friday, July 3, 2009 11:55 AM
    Moderator
  • Hi a33ik,


    The following is the url. Please give me CRM code for this webservice if possible.

    http://wwwfr.netsizeonline.com/NAGWebService2/AGEndpoint.asmx 

    Regards,
    GF

    Friday, July 3, 2009 12:00 PM
  • The download for the Netsize plug-in for MS CRM at Codeplex comes with source code, installation instructions and Admin guide.

    Please have a look at the URL below.

    Note: you will need a netsize account to send sms.

    Hasan.


    Hassan Hussain | http://hassanhussain.wordpress.com/
    Friday, July 3, 2009 12:35 PM
  • Hi.

    Try this, but replace all string in request with real values:

    var xml = "<?xml version='1.0' encoding='utf-8'?>"+
    "<soap:Envelope xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'>"+
    "  <soap:Body>"+
    "    <SendSMSMT xmlns='http://www.netsize.com/webservices/'>"+
    "      <sServer>string</sServer>"+
    "      <sPort>string</sPort>"+
    "      <nTimeout>string</nTimeout>"+
    "      <sEndpointName>string</sEndpointName>"+
    "      <sPeerName>string</sPeerName>"+
    "      <bUseSSL>string</bUseSSL>"+
    "      <bTPRP>string</bTPRP>"+
    "      <sLogin>string</sLogin>"+
    "      <sPassword>string</sPassword>"+
    "      <sTarget>string</sTarget>"+
    "      <sMessage>string</sMessage>"+
    "      <sMessageID>string</sMessageID>"+
    "      <sADC>string</sADC>"+
    "      <sOADC>string</sOADC>"+
    "      <sServiceId>string</sServiceId>"+
    "      <sHandsetType>string</sHandsetType>"+
    "      <sTPUDH>string</sTPUDH>"+
    "      <sTPUDLb>string</sTPUDLb>"+
    "      <sPrice>string</sPrice>"+
    "     <nSubscription>string</nSubscription>"+
    "      <nClass>string</nClass>"+
    "      <nNotification>string</nNotification>"+
    "      <nBitNumber>string</nBitNumber>"+
    "      <nCharNumber>string</nCharNumber>"+
    "      <nDCS>string</nDCS>"+
    "      <nEncoding>string</nEncoding>"+
    "      <nAppType>string</nAppType>"+
    "      <nPriority>string</nPriority>"+
    "      <nBinary>string</nBinary>"+
    "      <bBinary>string</bBinary>"+
    "      <bTPUDHI>string</bTPUDHI>"+
    "      <bUnicode>string</bUnicode>"+
    "      <sExtID>string</sExtID>"+
    "      <sRequestID>string</sRequestID>"+
    "      <sDelayDate>string</sDelayDate>"+
    "      <sValidityDate>string</sValidityDate>"+
    "      <nDispatchOperator>string</nDispatchOperator>"+
    "      <sDispatchPrice>string</sDispatchPrice>"+
    "      <sDispatchApplication>string</sDispatchApplication>"+
    "      <sDispatchShortCode>string</sDispatchShortCode>"+
    "      <sDispatchMessageType>string</sDispatchMessageType>"+
    "      <sRealAlias>string</sRealAlias>"+
    "      <sTPPID>string</sTPPID>"+
    "      <sExtContentType>string</sExtContentType>"+
    "      <sMTFreeReason>string</sMTFreeReason>"+
    "      <sContractID>string</sContractID>"+
    "      <nMediaType>string</nMediaType>"+
    "      <nSubscriptionAction>string</nSubscriptionAction>"+
    "      <nSubscriptionId>string</nSubscriptionId>"+
    "      <nSubscriptionPIN>string</nSubscriptionPIN>"+
    "      <nRequestPIN>string</nRequestPIN>"+
    "      <sOutput>string</sOutput>"+
    "    </SendSMSMT>"+
    "  </soap:Body>"+
    "</soap:Envelope>";
    
    var xHReq = new ActiveXObject("Msxml2.XMLHTTP");
    xHReq.Open("POST", "http://wwwfr.netsizeonline.com/NAGWebService2/AGEndpoint.asmx", false);
    xHReq.setRequestHeader("SOAPAction","http://www.netsize.com/webservices/SendSMSMT");
    xHReq.setRequestHeader("Content-Type", "text/xml; charset=utf-8");
    xHReq.setRequestHeader("Content-Length", xml.length);
    xHReq.send(xml);
    

    Truth is opened the prepared mind My blog - http://a33ik.blogspot.com
    Friday, July 3, 2009 12:36 PM
    Moderator
  • Hi a33ik,

    The above code is not working. I used the code in 'OnChange' event. I am getting 'Permisson Denied' error. What could be the reason. I have all the sufficent information to access that service. By using that .asmx url i am able to send message from browser. But, when i provide the same credintials in CRM i am getting the above error.

    Regards,
    GF
    Monday, July 6, 2009 4:14 AM
  • Hi,

    It could be because of CRM and your web service are in different domain!!
    May be you could create a custom web service that consumes the above netsize's web service, and deploy that custom web service to your isv folder within CRM, and consume your custom web service in your javascript !

    Regards,
    Nishant Rana
    http://nishantrana.wordpress.com
    Monday, July 6, 2009 5:28 AM
  • hi,

    How can i create a custom webservice that consumes the netsize's webservice?. Do you have any examples on this concept.

    Regards,

    GF

    Monday, July 6, 2009 5:38 AM
  • Hi.

    Nishant - it is not required for webservices to be in the same domain to use it.
    Golden Fish - you can ask for an advice developers of this webservice.
    Truth is opened the prepared mind My blog - http://a33ik.blogspot.com
    Monday, July 6, 2009 5:51 AM
    Moderator
  • Hi,

    Thanks Andriy!

    That's true, webservices aren't required to be in the same domain for them to be consumed, actually i was referring to the cross-domain thing !

    Regards,
    Nishant Rana
    http://nishantrana.wordpress.com
    Monday, July 6, 2009 6:03 AM
  • Hi Golden Fish,

    do you still have your problem ?
    If yes, can you explain me where you set the event 'onChange' (on what entity) and what you try do ?

    BR
    Hervé
    Thursday, July 16, 2009 1:31 PM