 |
|
 |
I get a Null error while running the code,probably because I expect a VT_BSTR variable.What I get is a VT_DISPATCH.Any ideas as to how to I go about getting something meaningful.the "temp" variable has something which is really out of context.
|
|
|
|
 |
|
 |
one of the parameters to send is base64binary. what type of param should i use in disparams structure?
thx
|
|
|
|
 |
|
 |
Hi All,
Greetings..
I have a problem using SOAP in VB and WebService.
I created a Visual Basic 6 application which sends the xml to a webservice(in .Net 2.0) using SOAP (MSSOAP.SoapClient30).
When I invoke the VB application the SOAP throws(logs in EventVwr) the following errors randomly ( mostly first time)
Soap error: Connection time out..
Soap error: An unanticipated error occurred during the processing of this request..
Soap error: Sending the Soap message failed or no recognizable response was received.
Soap error: Unspecified client error..
and the VB application combines all the errors and logs in EventVwr.
The VB Application identified by the event source logged this Application BTSeConnectAIC: Thread ID: 6004 ,Logged: An error occurred in BTSeConnectAIC.eConnect.ProcessMessage Err Num: 5415 Err Desc: Connector:Connection time out. HRESULT=0x800A1527 - Client:An unanticipated error occurred during the processing of this request. HRESULT=0x800A1527 - Client:Sending the Soap message failed or no recognizable response was received HRESULT=0x800A1527 - Client:Unspecified client error. HRESULT=0x800A1527 Err Src: ConnectorLine Num:106
But actually the SOAP sends the xml to the webservice and the webservice is called.It finished the process successfully / throws errors if any.
I searched this error and I added the following attribute in the WebService web.config file
But I got the same error randomly ( mostly first time)
Can u provide some solution for this.
I attached the codes for your reference
VB code:
Public Function IBTSAppIntegration_ProcessMessage(ByVal bstrDocument As String) As String
On Error GoTo ProcessMsgErr
Dim msSoap
Dim eConnectUrl As String
100 Set msSoap = CreateObject("MSSOAP.SoapClient30")
102 eConnectUrl = GeteConnectWSUrl()
104 msSoap.MsSoapInit eConnectUrl & "?wsdl"
106 IBTSAppIntegration_ProcessMessage = msSoap.SalesOrderProcessingService(bstrDocument)
Exit Function
ProcessMsgErr:
116 Call LogError("An error occurred in " & m_MyProgID & ".ProcessMessage")
End Function
WebService Code:
[WebMethod]
public string SalesOrderProcessingService(string eComOrderXml)
{
try
{
MBSLibrary.eConnect eConnect = new MBSLibrary.eConnect();
if (!eConnect.Submit(eComOrderXml))
return eConnect.GetLastError;
else
return "";
}
catch
{
throw;
}
}
Thanks in advance.
|
|
|
|
 |
|
 |
Well, I dont know for sure, but it seems SOAP error 5415 means
your application server is not running or is unreacheble
check your network setings
Regards,
skynyrd
web developer
skype:jonesbrasil
|
|
|
|
 |
|
 |
Hi
I am getting the following error when i try to access the function (during Invoke()).
Client::An unanticipated error occured during the processing of this
request. HRESULT=0x800A13BE
Client::Sending soap message failed or no recognizable response was
received. HRESULT=0x800A13BE
Client::Unspecified Client error. HRESULT=0x800A13BE
Any clues?
J
|
|
|
|
 |
|
 |
Hi I also got the same error.
any Clues?
Thanks in advance.
Regards
Solomon
|
|
|
|
 |
|
 |
Download example. Attempted to compile. Does not.
your welcome.
|
|
|
|
 |
|
 |
Hi ,
I am using folling example to connect to my Web service (Using MSSOAP 3.0).
The Client machine is behind Proxy. Thus connecting to my
web service is getting failed. (The ProxyPort and Proxy server IP is set Using Internet options -> LAN Settings)
Can anyone modify SOAP Client code for using Proxy Port and Proxy Server. I have tried the below code but still it is getting failed. I dont know where I am wrong.
Can anyone clarify when and where to use it?
VARIANT vtVal;
vtVal.vt = VT_BSTR;
vtVal.bstrVal = CString( _T("192.9.200.33")).AllocSysString();
m_ptrSoapClient->put_ConnectorProperty(_bstr_t("ProxyServer"),vtVal) ;
VariantClear(&vtVal);
vtVal.vt = VT_INT;
vtVal.intVal = 3128;
m_ptrSoapClient->put_ConnectorProperty(_bstr_t("ProxyPort"),vtVal) ;
In Anticiaption of reply
Regards,
Inthi
|
|
|
|
 |
|
 |
Please help me... how can I get a dataset as a return value...
I get an exception when I try to receive a DataSet..
excepinfo.bstrDescription 0x0016a474 "SoapMapper:Restoring data into SoapMapper datosUsuarioResult failed HRESULT=0x80070057: El parámetro no es correcto.
Client:Unspecified client error. HRESULT=0x80070057: El parámetro no es correcto.
Please.. help me..
thank you..
|
|
|
|
 |
|
 |
Just copy the WSDL file to the client
and
when calling MSSoapInit
give 1st parameter as local WSDL file path
insted of the "http://...."
Then you don't even require to change the timeout property
sagar
Love Is photogenic ,It requires a dark to develope.
|
|
|
|
 |
|
 |
If you do want to use a URL for getting the WSDL
make sure you use this before the init call
Set osoapclient = New MSSOAPLib30.SoapClient30
osoapclient.ClientProperty("ServerHTTPRequest") = True
'setup the soap by calling the wsdl
osoapclient.MSSoapInit (url)
|
|
|
|
 |
|
 |
Is there a way without specifying the WSDL file path.
Like can we use any other method to dynamically load WSDL?
|
|
|
|
 |
|
 |
I RESOLVED THIS SETTING ALLWAY DE WSDL URL
Set soapObject = New SoapClient30
soapObject.MSSoapInit Me.txtURLWebService.Text
AND HERE CALL THE WEB METHOD
|
|
|
|
 |
|
 |
I am trying to develope a code which can call a webervice from the vc++. can anybody tell that What I need .Is there any need of SOAP toolkit with Visual Studio 6.0 plz reply urgently
|
|
|
|
 |
|
 |
hi,
how can I get the method names and parameters of the web service through ISoapClient(or other interface)?
The web - methods are callable through Invoke, so I think there must be a way of reading out the method names. If I use ...GetFuncDesc ...GetNames... I only get methods of the ISoapClient interface but not of the real web service methods.
Is it possible to read em out?
thx
|
|
|
|
 |
|
 |
This article is great. It has saved me from buying a $2,000 library to access Web Services from C++.
I don't know much about COM. Could you show an example how one retrieves multiple responses (like from the Google Web API?)
To make your life easier, here are some code snippets whith which I modified your code:
CString csMethodName = "doGoogleSearch";
_bstr_t bstrWSDLFile(_T("http://api.google.com/GoogleSearch.wsdl"));
CString tempValue[10] = {"putYerKeyHere", "bamboozle", "0", "2", "0", "0", "1", "lang_en", "", ""}; int numArgs = 10;
...
BSTR *xmlInput = new BSTR[numArgs];
for(i = 0; i < numArgs; i++)
xmlInput[i] = tempValue[i].AllocSysString();
...
dispparams.cArgs = numArgs;
dispparams.cNamedArgs = 0;
dispparams.rgdispidNamedArgs = NULL;
for(i = 0; i < numArgs; i++)
{ dispparams.rgvarg[i].vt = VT_BYREF|VT_BSTR;
dispparams.rgvarg[i].pbstrVal = &xmlInput[numArgs - i - 1];
}
Thanks,
Pierre
|
|
|
|
 |
|
 |
How can one add specific header elements to the header?
|
|
|
|
 |
|
 |
Hi, i have installed MS SOAP Toolkit3.0, the platform is WINDOWSXP+SP2, the code i wirte is listed below: #include <stdio.h> #import "msxml4.dll" using namespace MSXML2; #import "C:\Program Files\Common Files\MSSoap\Binaries\mssoap30.dll" \ exclude("IStream", "IErrorInfo", "ISequentialStream", "_LARGE_INTEGER", \ "_ULARGE_INTEGER", "tagSTATSTG", "_FILETIME") using namespace MSSOAPLib30; void Get() { HRESULT hr; ISoapSerializerPtr Serializer; ISoapReaderPtr Reader; ISoapConnectorPtr Connector; // Connect to the service. hr = Connector.CreateInstance(__uuidof(HttpConnector30)); Connector->Property["EndPointURL"] = L"http://update.waytech.com.cn/Webservices/WTAU/WTAU.asmx?WSDL"; hr = Connector->Connect(); // Begin the message. Connector->Property["SoapAction"] = L"http://www.waytech.com.cn/webservices/WTAU/WTAU0"; hr = Connector->BeginMessage(); // Create the SoapSerializer object. hr = Serializer.CreateInstance(__uuidof(SoapSerializer30)); // Connect the serializer object to the input stream of the connector object. hr = Serializer->Init(_variant_t((IUnknown*)Connector->InputStream)); // Build the SOAP Message. hr = Serializer->StartEnvelope("", "", ""); // Serializer->SoapNamespace(L"xsi", L"http://www.w3.org/2001/XMLSchema-instance"); // Serializer->SoapNamespace(L"xsd",L"http://www.w3.org/2001/XMLSchema"); hr = Serializer->StartBody(L""); Serializer->StartElement(L"request", "", "", ""); hr = Serializer->StartElement(L"WTAU1", "", "",""); // Serializer->SoapNamespace("", "http://www.waytech.com.cn/webservices/WTAU"); hr = Serializer->StartElement(L"Module", "", "", ""); hr = Serializer->StartElement(L"ProdType","","",""); hr = Serializer->WriteString(L"003"); hr = Serializer->EndElement(); hr = Serializer->StartElement(L"ProdSubType","","",""); hr = Serializer->WriteString(L"003.0001"); hr = Serializer->EndElement(); hr = Serializer->StartElement(L"Version","","",""); hr = Serializer->WriteString(L"1.0.0.0"); Serializer->EndElement(); hr = Serializer->StartElement(L"TimeStamp","","",""); hr = Serializer->WriteString(L"2004 12 31 00:00:00"); hr = Serializer->EndElement(); hr = Serializer->StartElement(L"Name","","",""); hr = Serializer->WriteString(L"RV.EXE"); hr = Serializer->EndElement(); hr = Serializer->StartElement(L"FileName","","",""); hr = Serializer->WriteString(L"RV.EXE"); hr = Serializer->EndElement(); hr = Serializer->EndElement(); hr = Serializer->EndElement(); Serializer->EndElement(); hr = Serializer->EndBody(); hr = Serializer->EndEnvelope(); // Send the message to the XML Web service. hr = Connector->EndMessage(); // Read the response. hr = Reader.CreateInstance(__uuidof(SoapReader30)); // Connect the reader to the output stream of the connector object. Reader->Load(_variant_t((IUnknown*)Connector->OutputStream), ""); // Display the result. printf("Answer: %s\n", (const char*)Reader->Dom->xml); } int main() { CoInitialize(NULL); Get(); CoUninitialize(); return 0; } I use a protocol sniffer to capture the request message it generate and found it is like these: <?xml **UnReg**1.0" encoding="UTF-8" standalone="no"?> <SOAP-ENV:Envelope SOAP-ENV:encodingStyle="" xmlns:SOAPSDK1="http://www.w3.org/2001/XMLSchema" xmlns:SOAPSDK2="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAPSDK3="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Body SOAP-ENV:encodingStyle=""> <request SOAP-ENV:encodingStyle=""> <WTAU1 SOAP-ENV:encodingStyle=""> <Module SOAP-ENV:encodingStyle=""> <ProdType SOAP-ENV:encodingStyle="">003</ProdType> <ProdSubType SOAP-ENV:e**UnReg**yle="">003.0001</ProdSubType> <Version SOAP-ENV:encodingStyle="">1.0.0.0</Version> <TimeStamp SOAP-ENV:encodingStyle="">2004 12 31 00:00:00</TimeStamp> <Name SOAP-ENV:encodingStyle="">RV.EXE</Name> <FileName SOAP-ENV:encodingStyle="">RV.EXE</FileName> </Module> </WTAU1> </request> </SOAP-ENV:Body> </SOAP-ENV:Envelope> you can see that the first line is wrong, the node "ProdSubType" is wrong too, why will this happen, what should i do to sovle this problem, i hope you can help me. learn to be still.
|
|
|
|
 |
|
 |
I have the same problem cant't find the solution !!
did u find something about it
plzz answer
thanks
|
|
|
|
 |
|
 |
Hi,
With SOAP TK 3.0 I'm trying the following:
ISoapConnectorPtr psmConnector = NULL;
ISoapSerializerPtr psmSerializer = NULL;
ISoapReaderPtr psmReader = NULL;
psmConnector.CreateInstance(__uuidof(HttpConnector30));
psmConnector->Property["EndPointURL"] = _bstr_t("https://172.16.1.95/WebServices/ws1/Service1.asmx");
psmConnector->Connect();
psmConnector->Property["SoapAction"] = _bstr_t("https://172.16.1.95/WebServices/ws1/HelloWorld");
psmConnector->Property["UseSSL"] = VARIANT_TRUE;
psmConnector->Property["SSLClientCertificateName"] = _bstr_t("CURRENT_USER\\MY");
psmConnector->BeginMessage();
psmSerializer.CreateInstance(__uuidof(SoapSerializer30));
psmSerializer->Init(_variant_t((IUnknown *) psmConnector->InputStream));
psmSerializer->StartEnvelope(_bstr_t(""), _bstr_t("STANDARD"), _bstr_t(""));
psmSerializer->StartBody(_bstr_t("STANDARD"));
psmSerializer->StartElement(_bstr_t("HelloWorld"), _bstr_t("https://172.16.1.95/WebServices/ws1/"), _bstr_t(""), _bstr_t(""));
psmSerializer->EndElement();
psmSerializer->EndBody();
psmSerializer->EndEnvelope();
psmConnector->EndMessage();
But this is NOT working & throws an exception at psmConnector->EndMessage()! img src="/script/Forums/Images/smiley_doh.gif" align="top" alt="D'Oh! | :doh:" />
If I change the https:// to http:// - it works like a charm!
Anyone has any links where we can have some good VC++ samples with SOAP TK 3.0?
Thanks!
- Nirav
<html>* Artificial intelligence is no match for natural stupidity! * </html>
|
|
|
|
 |
|
 |
Hic, i'm have problem same to you. I can't call web service by https
Can you help me??
Thanks!
Ngtuan
|
|
|
|
 |
|
 |
Hi Ngtuan,
This was > 2 years ago! ... Tough to remember exactly , but I'm trying my best to recollect how/what I did to fix this.
Anyway - I could get my sample source, so here it is for your reference -- see the bookmarks explained below -- hopefully they should solve your problem:
HRESULT hResult;
ISoapConnectorPtr psmConnector = NULL;
ISoapSerializerPtr psmSerializer = NULL;
ISoapReaderPtr psmReader = NULL;
////////
psmConnector.CreateInstance(__uuidof(HttpConnector30));
psmConnector->Property["EndPointURL"] = _bstr_t("https://172.16.1.95/WebServices/ws1/Service1.asmx");
psmConnector->Connect();
psmConnector->Property["SoapAction"] = _bstr_t("http://www.sherkhan.com/WebServices/ws1/HelloWorld"); // Bookmark #1
psmConnector->Property["WinHTTPAuthScheme"] = _variant_t((long) 0x08, VT_I4); // Bookmark #2
psmConnector->Property["UseSSL"] = VARIANT_TRUE;
psmConnector->Property["SSLClientCertificateName"] = _bstr_t("CURRENT_USER\\MY\\Nirav"); // Bookmark #3
psmReader.CreateInstance(__uuidof(SoapReader30));
psmConnector->BeginMessage();
psmSerializer.CreateInstance(__uuidof(SoapSerializer30));
psmSerializer->Init(_variant_t((IUnknown *) psmConnector->InputStream));
psmSerializer->StartEnvelope(_bstr_t(""), _bstr_t("STANDARD"), _bstr_t(""));
psmSerializer->StartBody(_bstr_t("STANDARD"));
psmSerializer->StartElement(_bstr_t("HelloWorld"), _bstr_t("http://www.sherkhan.com/WebServices/ws1/"), _bstr_t("STANDARD"), _bstr_t(""));
psmSerializer->EndElement();
psmSerializer->EndBody();
psmSerializer->EndEnvelope();
hResult = psmSerializer->Finished();
hResult = psmConnector->EndMessage();
psmReader->Load(_variant_t((IUnknown *) psmConnector->OutputStream), _bstr_t("https://www.sherkhan.com/WebServices/ws1/HelloWorld"));
GetDlgItem(IDC_TXT_XML)->SetWindowText((const char *) psmReader->Envelope->xml);
GetDlgItem(IDC_TXT_NAME)->SetWindowText((const char *) psmReader->Envelope->text);
psmConnector.Release();
psmSerializer.Release();
psmReader.Release();
////////
psmSerializer = NULL;
psmReader = NULL;
psmConnector = NULL;
Please note:
// Bookmark #1 --> I've used the full domain name as given in the SSL certificate, instead of using a computer-name or an IP.
// Bookmark #2 --> Please check the documentation about this property, I'm really sorry - I'm unable to recollect what the parameters are for.
// Bookmark #3 --> Directing to the exact certificate name from my local store
Please review and try with this. I hope this helps you fix your problem. Do let me know if it helped or even if it didn't.
Rgds,
Nirav Doshi
* Artificial intelligence is no match for natural stupidity! *
|
|
|
|
 |
|
 |
Hi,
I get the following error when I try to call HTTPS web service using your code
Connector:WinHTTP reported 'Secure Channel Error"
Am I missing something in the code.
ISoapSerializerPtr Serializer;
ISoapReaderPtr Reader;
ISoapConnectorPtr Connector;
// Connect to the service
Connector.CreateInstance(__uuidof(HttpConnector30));
Connector->gt;Property["EndPointURL"] = strWebService.AllocSysString();
Connector->Connect();
Connector->Property["WinHTTPAuthScheme"] = _variant_t((long) 0x8, VT_I4);
// Add support to SSL
Connector->Property["UseSSL"] = VARIANT_TRUE;
Connector->Property["SSLClientCertificateName"] = strSSL.AllocSysString() ;
//
// Begin message
Connector->Property["SoapAction"] = strSoapAction.AllocSysString();
Connector->Property["Timeout"] = COleVariant( (long) lTimeout ); ;
Connector->BeginMessage();
// Create the SoapSerializer
Serializer.CreateInstance(__uuidof(SoapSerializer30));
Serializer->Init(_variant_t((IUnknown*)Connector->InputStream));
// Build the SOAP Message
Serializer->StartEnvelope("","STANDARD","");
Serializer->StartBody(_bstr_t("STANDARD"));
// Send the message to the web service
Serializer->WriteXml(elementXML.AllocSysString());
Serializer->EndBody();
Serializer->EndEnvelope();
Connector->EndMessage();
// Read the response
Reader.CreateInstance(__uuidof(SoapReader30));
// Connect the reader to the output stream of the connector
Reader->Load(_variant_t((IUnknown*)Connector->OutputStream),
"");
Thanks,
|
|
|
|
 |
|
 |
Are you sure you've used the complete code from my original post (and changing where required)? Certain statements are missing in your post - so unsure where to point you to for potential problems.
|
|
|
|
 |
|
 |
It was working fine when I was calling HTTP service. Now that I have to call HTTPS service I am setting additional properties in my code.
Connector->Property["UseSSL"] = VARIANT_TRUE;
Connector->Property["SSLClientCertificateName"] = "CURRENT_USER\MY" Connector->Property["WinHTTPAuthScheme"] = _variant_t((long) 0x8, VT_I4);
Changed the URL from HTTP to HTTPS. Am I still missing something?
Thanks.
|
|
|
|
 |