Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. How to run a java script(json) from my vc++ code?

How to run a java script(json) from my vc++ code?

Scheduled Pinned Locked Moved C / C++ / MFC
xmlquestionc++javawcf
8 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    pankajkumar
    wrote on last edited by
    #1

    I need to create a 'input' parameter in method of my web service.

    I am writing a VC++ program where I am calling my vb web service method, using http request(SOAP packet). While calling this web method, return SOAP packet tells me only 'out' parameter(being generated by web method). I digged on google, came to know that this 'input' parameter may be added by json, XML scripts...

    There might be some java expert here, who can answer my question...

    -Pankaj

    L D 2 Replies Last reply
    0
    • P pankajkumar

      I need to create a 'input' parameter in method of my web service.

      I am writing a VC++ program where I am calling my vb web service method, using http request(SOAP packet). While calling this web method, return SOAP packet tells me only 'out' parameter(being generated by web method). I digged on google, came to know that this 'input' parameter may be added by json, XML scripts...

      There might be some java expert here, who can answer my question...

      -Pankaj

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      This is not a question for Java experts, you are talking about javascript which is completely different. You also need to provide better details of what your code is doing, and where the error occurs.

      P 2 Replies Last reply
      0
      • L Lost User

        This is not a question for Java experts, you are talking about javascript which is completely different. You also need to provide better details of what your code is doing, and where the error occurs.

        P Offline
        P Offline
        pankajkumar
        wrote on last edited by
        #3

        Dear, I explain you whole condition of code...

            ... – pankaj 16 hours ago   
        

        I want to add an input parameter('zipcode' from VC++/'InParam' in vb web method) in web method...though I am trying to send that parameter, in my call of C++ SOAP packet..but this is being taken as 'Nothing'(InParam) by web method..

        Though I made a sample json file as microsoft says...social.msdn.microsoft.com/Forums/en-US/… how to fix that in my vc++ code, after sending 'POST' request of my http packet

        in WSDL..Web Service.vb..

        Imports System.Web Imports System.Web.Services Imports System.Web.Services.Protocols ; _ _ _ Public Class WebService Inherits System.Web.Services.WebService _ Public Function ConvertTemperature(ByVal InParam As String) As String Dim Temp As Integer Temp = CInt(InParam) + 20 Return CStr(Temp) End Function End Class – pankaj 15 hours ago

        float CallWebService(LPCTSTR szZipCode) { // SOAP Request Envelop to be posted TCHAR szSOAPReq[MAX_PATH*2] = {0}; sprintf(szSOAPReq, g_lpszSOAPReq, szZipCode); CComPtr spXMLHTTP; HRESULT hr = spXMLHTTP.CoCreateInstance(GetClsidXMLHTTP("Msxml2.ServerXML‌​HTTP.4.0")); CHECK_HR(hr); TCHAR szGetURL[64]={0}; )); sprintf(szGetURL, g_lpszGetURL, szZipCode); char szTemp[32]; sprintf(szTemp, "\"%s\"", szZipCode); hr = spXMLHTTP->open(_bstr_t(_T("GET")), szGetURL, VARIANT_FALSE); – pankaj 15 hours ago

        CHECK_HR(hr); ///////////////////////////Packet //static const TCHAR* const g_lpszSOAPReq = CString szRequest= _T(" " ""; " " " " " string" " " " " ""); – pankaj 14 hours ago

        VARIANT vRequest; v

        L 1 Reply Last reply
        0
        • L Lost User

          This is not a question for Java experts, you are talking about javascript which is completely different. You also need to provide better details of what your code is doing, and where the error occurs.

          P Offline
          P Offline
          pankajkumar
          wrote on last edited by
          #4

          Dear Richard, Please give a look to my problem. as mentioned above. -Pankaj

          P 1 Reply Last reply
          0
          • P pankajkumar

            Dear Richard, Please give a look to my problem. as mentioned above. -Pankaj

            P Offline
            P Offline
            pankajkumar
            wrote on last edited by
            #5

            change this line in wsdl as "

            type="xsd:string"/

            "go instead of "xsd:double"

            1 Reply Last reply
            0
            • P pankajkumar

              Dear, I explain you whole condition of code...

                  ... – pankaj 16 hours ago   
              

              I want to add an input parameter('zipcode' from VC++/'InParam' in vb web method) in web method...though I am trying to send that parameter, in my call of C++ SOAP packet..but this is being taken as 'Nothing'(InParam) by web method..

              Though I made a sample json file as microsoft says...social.msdn.microsoft.com/Forums/en-US/… how to fix that in my vc++ code, after sending 'POST' request of my http packet

              in WSDL..Web Service.vb..

              Imports System.Web Imports System.Web.Services Imports System.Web.Services.Protocols ; _ _ _ Public Class WebService Inherits System.Web.Services.WebService _ Public Function ConvertTemperature(ByVal InParam As String) As String Dim Temp As Integer Temp = CInt(InParam) + 20 Return CStr(Temp) End Function End Class – pankaj 15 hours ago

              float CallWebService(LPCTSTR szZipCode) { // SOAP Request Envelop to be posted TCHAR szSOAPReq[MAX_PATH*2] = {0}; sprintf(szSOAPReq, g_lpszSOAPReq, szZipCode); CComPtr spXMLHTTP; HRESULT hr = spXMLHTTP.CoCreateInstance(GetClsidXMLHTTP("Msxml2.ServerXML‌​HTTP.4.0")); CHECK_HR(hr); TCHAR szGetURL[64]={0}; )); sprintf(szGetURL, g_lpszGetURL, szZipCode); char szTemp[32]; sprintf(szTemp, "\"%s\"", szZipCode); hr = spXMLHTTP->open(_bstr_t(_T("GET")), szGetURL, VARIANT_FALSE); – pankaj 15 hours ago

              CHECK_HR(hr); ///////////////////////////Packet //static const TCHAR* const g_lpszSOAPReq = CString szRequest= _T(" " ""; " " " " " string" " " " " ""); – pankaj 14 hours ago

              VARIANT vRequest; v

              L Offline
              L Offline
              Lost User
              wrote on last edited by
              #6

              Sorry, but I cannot understand any of that. And like I already told you, this has nothing to do with Java.

              1 Reply Last reply
              0
              • P pankajkumar

                I need to create a 'input' parameter in method of my web service.

                I am writing a VC++ program where I am calling my vb web service method, using http request(SOAP packet). While calling this web method, return SOAP packet tells me only 'out' parameter(being generated by web method). I digged on google, came to know that this 'input' parameter may be added by json, XML scripts...

                There might be some java expert here, who can answer my question...

                -Pankaj

                D Offline
                D Offline
                David Crow
                wrote on last edited by
                #7

                Did you create this web service/method?

                "One man's wage rise is another man's price increase." - Harold Wilson

                "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

                "You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles

                P 1 Reply Last reply
                0
                • D David Crow

                  Did you create this web service/method?

                  "One man's wage rise is another man's price increase." - Harold Wilson

                  "Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons

                  "You can easily judge the character of a man by how he treats those who can do nothing for him." - James D. Miles

                  P Offline
                  P Offline
                  pankajkumar
                  wrote on last edited by
                  #8

                  Yes..I created this web service...by VS->New Web->Added Web service->vb Web Method... Do you have any suggestion for my project..? :) Pankaj

                  1 Reply Last reply
                  0
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  • Login

                  • Don't have an account? Register

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • World
                  • Users
                  • Groups