Loading ...
Sorry, an error occurred while loading the content.

8963Re: How can MSSOAP2.0 for client inerop with Apache SOAP 2.1 for server to complex?

Expand Messages
  • sonicbomber70 <sonicbomber70@yahoo.co.kr>
    Jan 6, 2003
    • 0 Attachment
      --- In soapbuilders@yahoogroups.com, "sonicbomber70
      <sonicbomber70@y...>" <sonicbomber70@y...> wrote:
      > HI.
      > I'm testing MSSOAP for client and Apache SOAP for server to interop
      a
      > complex type.
      > I writed "TestClass" and "TestClassMapper" for mapper.
      > and then "wsml", but not worked.
      > Who do i got it to interop "complex type" with MSSOAP and Apache
      SOAP?
      >
      > thanks.
      in additional.
      i wrote the "TestClass" and "TestClassMapper" in ATL/COM.
      regist the mapper in WSML.
      but i got the message "E_NOINTERFACE", is " not found the interface
      (method) in wsdl" ?
      let me knock out the error

      thans.

      following is sources in summary.

      in "TestClass"'s idl
      ========================================================
      skip...
      interface ITestClass : IDispatch
      {
      [propget, id(1), helpstring("property i1")]
      HRESULT i1([out, retval] short *pVal);
      [propput, id(1), helpstring("property i1")]
      HRESULT i1([in] short newVal);
      [propget, id(2), helpstring("property d1")]
      HRESULT d1([out, retval] double *pVal);
      [propput, id(2), helpstring("property d1")]
      HRESULT d1([in] double newVal);
      [propget, id(3), helpstring("property s1")]
      HRESULT s1([out, retval] BSTR *pVal);
      [propput, id(3), helpstring("property s1")]
      HRESULT s1([in] BSTR newVal);
      [propget, id(4), helpstring("property b1")]
      HRESULT b1([out, retval] BOOL *pVal);
      [propput, id(4), helpstring("property b1")]
      HRESULT b1([in] BOOL newVal);
      };
      skip...
      ===================end of TestClass

      in "TestClassMapper"'s header
      ======================================
      class ATL_NO_VTABLE CTestClassMapper :
      public CComObjectRootEx<CComSingleThreadModel>,
      public CComCoClass<CTestClassMapper,
      &CLSID_TestClassMapper>,
      public ISupportErrorInfo,
      public IDispatchImpl<ITestClassMapper,
      &IID_ITestClassMapper, &LIBID_DESTINYSOAPLib>,
      public IDispatchImpl<ISoapTypeMapper, &IID_ISoapTypeMapper,
      &LIBID_MSSOAPLib>
      {
      public:
      CTestClassMapper()
      {
      }

      DECLARE_REGISTRY_RESOURCEID(IDR_TESTCLASSMAPPER)

      DECLARE_PROTECT_FINAL_CONSTRUCT()

      BEGIN_COM_MAP(CTestClassMapper)
      COM_INTERFACE_ENTRY(ITestClassMapper)
      //DEL COM_INTERFACE_ENTRY(IDispatch)
      COM_INTERFACE_ENTRY2(IDispatch, ITestClassMapper)
      COM_INTERFACE_ENTRY(ISoapTypeMapper)
      END_COM_MAP()

      // ISupportsErrorInfo
      STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid);
      // ITestClassMapper
      public:
      // ISoapTypeMapper
      STDMETHOD(Init)(ISoapTypeMapperFactory * pFactory,
      IXMLDOMNode * pSchema, enXSDType xsdType);
      STDMETHOD(read)(IXMLDOMNode * pNode, BSTR bstrEncoding,
      enEncodingStyle encodingMode, LONG lFlags, VARIANT * pvar);
      STDMETHOD(write)(ISoapSerializer * pSoapSerializer, BSTR
      bstrEncoding, enEncodingStyle encodingMode, LONG lFlags, VARIANT *
      pvar);
      STDMETHOD(varType)(LONG * pvtType);
      private:
      ISoapTypeMapper *m_pStringMapper;
      };
      =====================end of TestClassMapper


      in client call source
      ===========================
      HRESULT CallTestSerivce(ISOAPClient *pSoapClient)
      {
      skipping...

      // param»ý¼º
      if FAILED(hr = CoCreateInstance( __uuidof(TestClass), NULL,
      CLSCTX_INPROC_SERVER, __uuidof(ITestClass),

      (void **)&pITestClass))
      {
      DisplayHResult(_T("Cannot create TestClass"),hr);
      //wprintf(L("Cannot create TestClass"));
      return E_FAIL;
      }

      // assign value
      VariantInit(&va);
      va.vt = VT_DISPATCH;
      va.pdispVal = pITestClass;
      //V_VT(&va) = VT_DISPATCH;
      //V_DISPATCH(&va) = pITestClass;
      va.pdispVal->AddRef();

      params.cArgs = 1;
      params.rgvarg = &va;
      params.cNamedArgs = 0;
      params.rgdispidNamedArgs = NULL;

      if( FAILED(hr)){
      DisplayHResult(_T("Getting function ID of
      changeValue failed"), hr);
      }
      // getting changeValue's id to set dspid
      if ( FAILED( hr = pSoapClient->GetIDsOfNames(IID_NULL,
      &pMethodName, 1, LOCALE_SYSTEM_DEFAULT, &dispidFn)))
      {
      DisplayHResult(_T("Getting function ID of
      changeValue failed"), hr);
      }

      hr = pSoapClient->Invoke(dispidFn, IID_NULL,
      LOCALE_SYSTEM_DEFAULT, DISPATCH_METHOD, ¶ms,

      &result, &excepinfo, &uArgErr);
      if(FAILED(hr))
      {
      //wprintf(L("Invoke of changeValue service
      failed."));
      DisplayHResult(_T("Invoke of changeValue service
      failed."), hr);
      //printf("excepinfo[%s,%s,%
      s]",excepinfo.bstrDescription,excepinfo.bstrSource,
      excepinfo.bstrHelpFile);
      }else{
      pITestClass = result.pdispVal;
      pITestClass->AddRef();
      }
      ... skipping


      return S_OK ;
      }

      EXCEPINFO m_excepinfo;
      int main(int argc, char* argv[])
      {
      int flag = 1;
      CComPtr<ISOAPClient> pSoapClient = NULL;
      BSTR fileName =
      (L"http://localhost:8080/soap/TestClassService.wsdl");
      BSTR bstrWSMLFile =
      (L"http://localhost:8080/soap/TestClassService.wsml");

      HRESULT hr = S_OK;

      skipping...

      if( FAILED(::CoInitialize(NULL)))
      {
      return 0;
      }

      wprintf(L"test TestClassService\n\n");

      if ( FAILED( hr = CoCreateInstance(__uuidof(SoapClient), NULL,
      CLSCTX_INPROC_SERVER, __uuidof(ISOAPClient),(void **)&pSoapClient)))
      DisplayHResult(_T("CoCreateInstance Failed"), hr);
      //wprintf(L"CoCreateInstance Failed\n");

      hr = pSoapClient->mssoapinit
      (L"http://localhost:8080/soap/TestClassService.wsdl",
      L"TestClassServiceService",L"rpcrouter",
      L"http://localhost:8080/soap/TestClassService.wsml");
      if(FAILED(hr))
      DisplayHResult(_T("mssoapinit Failed"), hr);


      if ( FAILED( hr = CallTestSerivce(pSoapClient)))
      wprintf(L"CallTestSerivce Failed\n");
      wprintf(L"CallTestSerivce executed\n");
      return 0;
      }
      =================== end of clien call source

      in wsml
      ======================
      <?xml version='1.0' encoding='UTF-8' ?>
      <!-- Generated 07/03/01 by Microsoft SOAP Toolkit WSDL File
      Generator, Version 1.02.813.0 -->
      <servicemapping name='TestClassServiceService'>
      <service name='TestClassServiceService'>
      <using PROGID='TestSOAP.TestClass1Mapper.1' cachable='0'
      ID='TestClass1Mapper' />
      <using PROGID='TestSOAP.TestClassMapper.1' cachable='0'
      ID='TestClassMapper' />
      <types>
      <type name='in0' targetNamespace='urn:TestClassService'
      uses='TestClass1Mapper' iid='{3683D73D-4F60-405B-A6C5-742CF04C5F96}'/>
      <type name='in0' targetNamespace='urn:TestClassService'
      uses='TestClassMapper' iid='{C59F01C0-C3CD-45E4-A619-B27C8D0F3215}'/>
      </types>
      <port name='rpcrouter'>
      <operation name='changeValue'>
      <execute uses='HelloServerService' method='changeValue'
      dispID='1'>
      <parameter callIndex='-1' name='retval' elementName='Result' />
      <parameter callIndex='1' name='in0' elementName='in0' />
      </execute>
      </operation>
      </port>
      </service>
      </servicemapping>
      ===================== end of wsml
    • Show all 2 messages in this topic