标签:workday web service web服务 http
我们知道,Workday系统本身很复杂,其发布的web服务(web service)也很多,而且其中的Web 服务(web service)中定义的Schema也很复杂。如果用AXIS或者XFire生成存根代码调用其相应模块的web service,比如Human Resource模块,也可以,但是生成的存根代码比较复杂,而且Workday的web服务本身也在不断的升级过程中,在升级的过程中,其Schema的信息也在不断变化和调整过程中,那么有没有一种以不变应万变的方式,答案是肯定的。那就是通过,用纯文本方式(XML)+HTTP协议调用Workday的web service。下面咱们就以调用员工查找的操作方法为例子(Employee Find), 看其存文本的代码例子如何编写?其总共分成两部分:
(1) web service的权限认证
其中假设其用户名名为:test @test
密码为:xxxxxxx
则其消息头部分为:
< env:Header > < wsse:Security xmlns:soapenv = "http://schemas.xmlsoap.org/soap/envelope/" xmlns:wsse = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" soapenv:mustUnderstand = "1" > < wsse:UsernameToken > < wsse:Username >test @test </ wsse:Username > < wsse:Password Type = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText" > Password: xxxxxxx </ wsse:Password > </ wsse:UsernameToken > </ wsse:Security > </ env:Header > <? xml version = "1.0" encoding = "UTF-8" ?> < env:Envelope xmlns:env = "http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd = "http://www.w3.org/2001/XMLSchema" > < env:Header > < wsse:Security xmlns:soapenv = "http://schemas.xmlsoap.org/soap/envelope/" xmlns:wsse = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" soapenv:mustUnderstand = "1" > < wsse:UsernameToken > < wsse:Username > test @test </ wsse:Username > < wsse:Password Type = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText" > xxxxxxx </ wsse:Password > </ wsse:UsernameToken > </ wsse:Security > </ env:Header >
< env:Body > < wd:Employee_Find xmlns:wd = "urn:com.workday/bsvc" wd:version = "v22.1" > </ wd:Employee_Find > </ env:Body >
如何用纯文本方式(XML)+HTTP协议调用Workday的web service?
标签:workday web service web服务 http
原文地址:http://blog.csdn.net/chancein007/article/details/46293851