想了解下有人用过nodejs去写SOAP的服务器端吗

想了解下有人用过nodejs去写SOAP的服务器端吗,第1张

node-soap存BUG能识别部类别WSDLnode-soap测试用手写WSDL借助些JavaWebService客户端工具网找
node-soap使用哪版本03版本需要本编译环境编译直使用05版本掉带贬义依赖包使使用更加灵便05包依存问题至于规使用已经差
我自项目使用node-soap并且封装meteorjs部bug自行修改bug提交相node-soap说现改善错应该没太问题

openSUSE 121下安装MySQL5
1安装MySQL5
首先我们需要先用下面的命令安装MySQL5:
yast2 -i mysql mysql-client mysql-community-server
然后我们需要创建MySQL系统的启动键链接启动MySQL服务器,这样以便于MySQL在系统启动时自动启动,
systemctl enable mysqlservice
systemctl start mysqlservice
为了确保MySQL的安装完成,运行:
mysql_secure_installation
下面会遇到下面的提示问题;
server1:~ # mysql_secure_installation
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL
SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!
In order to log into MySQL to secure it, we'll need the current
password for the root user If you've just installed MySQL, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here
Enter current password for root (enter for none): <-- 输入密码
OK, successfully used password, moving on
Setting the root password ensures that nobody can log into the MySQL
root user without the proper authorisation
Set root password? [Y/n] <-- 输入Y
New password: <-- 设置数据库密码
Re-enter new password: <-- 重新输入数据库密码
Password updated successfully!
Reloading privilege tables
Success!
By default, a MySQL installation has an anonymous user, allowing anyone
to log into MySQL without having to have a user account created for
them This is intended only for testing, and to make the installation
go a bit smoother You should remove them before moving into a
production environment
Remove anonymous users? [Y/n] <-- 选择Y
Success!
Normally, root should only be allowed to connect from 'localhost' This
ensures that someone cannot guess at the root password from the network
Disallow root login remotely? [Y/n] <-- 选择Y
Success!
By default, MySQL comes with a database named 'test' that anyone can
access This is also intended only for testing, and should be removed
before moving into a production environment
Remove test database and access to it? [Y/n] <-- 选择Y
- Dropping test database
Success!
- Removing privileges on test database
Success!
Reloading the privilege tables will ensure that all changes made so far
will take effect immediately
Reload privilege tables now? [Y/n] <-- 选择Y
Success!
Cleaning up
All done! If you've completed all of the above steps, your MySQL
installation should now be secure
Thanks for using MySQL!
server1:~ #
现在你的MySQL安装应成功了
3openSUSE 121下安装Apache2
3openSUSE 121下安装Apache2
Apache2的是作为一个openSUSE的软件包,因此,我们可以用下面命令安装它:
yast2 -i apache2
现在配置系统在引导时启动Apache
systemctl enable apache2service
并启动Apache2
systemctl start apache2service
现在,在您的浏览器输入>本文向您介绍了如何使用WebServICes和SOAP(SimpleObjectACCessProtocol,简单对象反问协议)进行数据传输,并且通过讨论示例代码对在PocketPC上传输数据的方法进行了仔细分析。
在当前版本的ADOCE(V31)中,我们必须找到另一种处理WebService(SOAP)调用返回数据的方法。在本文中,我将同大家对一些示例代码进行探讨,看看如何使用从一个SOAP响应中返回的数据。该示例假定Recordset(记录集)按照ChrisDengler文中所介绍的Solution2封装方式进行封装。因为Chris在他的文章中已经对这种解决方案的实现方式进行了详细描述,在本文中我就不再对所需的服务器端代码多加叙述了。
一个测试客户端程序
在我们开始讨论代码之前,让我们首先了解一下使用WebServices传输数据对我们有哪些好处。在下面这个窗体中,我创建了一个简单的测试用客户端程序,该程序将两个不同的WebServices结合到了一个MicrosofteMbeddedVisualBasic应用程序之中。:
SOAP客户端测试程序示例
窗体顶部的TextBox(文本框)用来选择所需的WebService(描述)。这个URI(UniversalResourceIdentifier)是使用SOAPToolkitWizard创建的SDL(服务描述语言,ServicesDescriptionLanguage)文件。
我已经创建了第一个WebService,您可以调用这个WebService(使用顶部的“Get”按钮),这个WebService主要用于测试目的。它调用一个简单的WebService,将您提交的名和姓作为参数连接到了一个包含完整名称的字符串中。
当您输入一个已经在服务器上进行了定义的DSN(数据源名称)以及一个针对该DSN的SQL(结构化查询语言)查询,然后点击“Get”按钮时,它开始变得更有意思了。DSN和SQL作为一个参数传递给了WebService,然后以XML格式返回一个ADORecordset。数据经过分析后,填充在窗体底部的ListView控件中。
在正确对服务器进行了设置的前提下,现在,您可以方便地访问您的企业数据了。您无需任何第三方产品--甚至不使用ADOCE--即可轻松做到这一点。对此,我的一位同事说,“这实在令人惊讶!”
代码讨论
以下代码为cmdGetRecordset_Click事件的代码(当您按下窗体底部的“Get”按钮时运行):
DimlavParameters(2)AsVariant
DimlsAsString
DimlitmAsListItem
DimiAsInteger
'Setparameters
lavParameters(1)=txtDSNText
lavParameters(2)=txtSQLText
'MakeSOAPCall
ls=SOAPCall(txtURIText,"GetRecordset",lavParameters,chkShowPACkets=1)
'ClearandaddListViewheadings
lvwRecordsetColumnHeadersClear
lvwRecordsetColumnHeadersAdd1,,"ArtNo",700
lvwRecordsetColumnHeadersAdd2,,"Description",1450
lvwRecordsetColumnHeadersAdd3,,"Price",850,lvwColumnRight
'ClearandfillListViewfromXML(withRecordsetEmulation)
lvwRecordsetListItEMSClear
XMLRSOpenls
DoWhileNotXMLRSEOF
Setlitm=lvwRecordsetListItemsAdd(,,XMLRS("ArticleNo"))
转载仅供参考,版权属于原作者。祝你愉快,哦

SOAP是简单对象访问协议,它可看成是>

在iOS中使用SOAP,需要我们自己组装XML格式的字符串,当XML字符串比较长的时候会变得很麻烦。另外,我们在写XML格式的字符串时也要经常使用转义字符“\”。

这个结果呢不大准确,因为我输入的号码是动感地带的。但不影响本文主题。

看看刚才那个网页的内容,注意到SOAP 12标签下的内容:

我们要用到的只有getMobileCodeInfoResult这个标签。

这次的例子是实现通过SOAP服务查询手机号码归属地、运行商等信息。PS:用的Xcode 441。

1、运行Xcode 441,新建一个Single View Application,名称为SOAP Test:

2、界面设计:打开ViewControllerxib,设计界面如下所示:

在文本输入框的Attribute Inspector中设置其Keyboard属性为Number Pad。

3、之后向ViewControllerh中,为文本输入框创建OutLet映射,名称为:phoneNumber;为“查询”按钮创建Action映射,事件类型为Touch Up Inside,名称为:doQuery。建立映射的方法就是打开Assistant Editor,选中某一控件,按住Ctrl,拖向ViewControllerh,可以参考前面的文章。

4、在ViewControllerh中添加代码:

41 在@interface那行最后添加代码

<NSXMLParserDelegate,  NSURLConnectionDelegate>

使ViewController遵守这两个协议。前者用来解析XML,后者用于网络连接。

42 在@end之前添加代码

@property (strong, nonatomic) NSMutableData webData;
@property (strong, nonatomic) NSMutableString soapResults;
@property (strong, nonatomic) NSXMLParser xmlParser;
@property (nonatomic) BOOL elementFound;
@property (strong, nonatomic) NSString matchingElement;
@property (strong, nonatomic) NSURLConnection conn;

5、在ViewControllerm中添加代码:

51 在@implementation之后添加代码

@synthesize webData;
@synthesize soapResults;
@synthesize xmlParser;
@synthesize elementFound;
@synthesize matchingElement;
@synthesize conn;

52 实现doQuery方法

在windows下开启soap扩展

在phpini中去掉extension=php_soapdll前的分号

将php_soapdll(在php安装路径下可以找到)复制到system32下

重启服务器


欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/zz/13515777.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-08-23
下一篇 2023-08-23

发表评论

登录后才能评论

评论列表(0条)

保存