Studies have found that we can use to generate c # com components encapsulation as DLL function, for PB calls, this way, in theory, should be applicable to any version of the PB,
Here is simple to use VS2013 c # with PB9 description
1, using c # to invoke the Web Service to generate DLL, can find some online reference example
Example: soapws//namespace
DispId (1)]//interface method of binding,
String PBSOAP (string jsonStr);
2, the initialization of DLL environment
Establish PB call directory c: \ soapws; Will generate c # DLLS and TLB file copy, the default in the project bin \ Debug directory,
And find the.net 4.0 RegAsm. Exe file, also copied to the directory, then the operating system run CMD, input:
Regasm soapws. DLL/TLB: soapws. TLB
Enter show successful registration information,
3, use PB call c # DLLS
Invoke the c # DLLS in PB, the code is as follows:
OleObject OleSOAP
OleSOAP=Create OLEObject
//SOAPws1 for namespace in c # (namespace), Class1 for the name of the class in c #
I=OleSOAP. ConnectToNewObject (" soapws. Class1 ")
If I & lt;> 0 then
MessageBox (" prompt ", "PB call c # COM components (soapws. WebService) failed!" )
Return
End the if
String ls_json
Ls_json=trim (mle_1. Text)//incoming parameters
//PBSOAP interface methods
Ls_ret=OleSOAP. PBSOAP (ls_json)
MessageBox (' 1 ', ls_ret)
CodePudding user response:
Supplement:If use PB11, you can use the.net mode connection can also realize the PB invokes the Java using CXF development webservice, operation steps are as follows:
1. According to the default is EasySoap Engine generates invoke the webservice project: for example: generate soapwebservice project, after the completion of the deployment, PB will not be able to call
2. Open project before deploying soapwebservice, modified using EasySoap Engine strange to Use. Net Engine (Use the.net Engine), and then to deploy, so the PB can call,