<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Shoopman &#187; WebService</title>
	<atom:link href="http://blog.shoopman.org/tag/webservice/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.shoopman.org</link>
	<description>Shoopman&#039;s Blog</description>
	<lastBuildDate>Thu, 15 Jul 2010 08:32:42 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>为XFire生成的WebService客户端设置连接超时参数</title>
		<link>http://blog.shoopman.org/2009/09/09/set-the-connection-timeout-parameters-for-webservice-client-generated-by-xfire.html</link>
		<comments>http://blog.shoopman.org/2009/09/09/set-the-connection-timeout-parameters-for-webservice-client-generated-by-xfire.html#comments</comments>
		<pubDate>Wed, 09 Sep 2009 09:37:29 +0000</pubDate>
		<dc:creator>Shoopman</dc:creator>
				<category><![CDATA[Tech]]></category>
		<category><![CDATA[WebService]]></category>
		<category><![CDATA[XFire]]></category>

		<guid isPermaLink="false">/2009/09/9/set-the-connection-timeout-parameters-for-webservice-client-generated-by-xfire.html</guid>
		<description><![CDATA[由于要从另一个系统的WebService读取大量的数据，因此要修改连接WebService的超时参数。WebService的客户端代码是通过XFire的Ant任务生成的。Google一下，没找到答案，但最后还是在XFire官方找到了答案。
假设生成的客户端代码中的服务接口和Client的类分别为TestService和TestServiceClient，修改连接超时参数代码如下：
//创建Service对象  TestServiceClient testClient = new TestServiceClient();
TestService testService = testClient.getTestServicePort();
//设置连接参数  HttpClientParams params = new HttpClientParams();
params.setParameter(HttpClientParams.USE_EXPECT_CONTINUE, Boolean.FALSE);
params.setParameter(HttpClientParams.CONNECTION_MANAGER_TIMEOUT, setting.getTimeout() * 1000);//单位是毫秒
Client client = Client.getInstance(testService);
client.setProperty(CommonsHttpMessageSender.HTTP_CLIENT_PARAMS, params);

XFire是基于Apache的HttpClient，所以实际上连接超时的参数是就是设置在HttpClient上的。
]]></description>
			<content:encoded><![CDATA[<p>由于要从另一个系统的WebService读取大量的数据，因此要修改连接WebService的超时参数。WebService的客户端代码是通过XFire的Ant任务生成的。Google一下，没找到答案，但最后还是在XFire官方找到了答案。</p>
<p>假设生成的客户端代码中的服务接口和Client的类分别为TestService和TestServiceClient，修改连接超时参数代码如下：</p>
<blockquote><p>//创建Service对象<br />  <br />TestServiceClient testClient = new TestServiceClient();</p>
<p>TestService testService = testClient.getTestServicePort();</p>
<p>//设置连接参数<br />  <br />HttpClientParams params = new HttpClientParams();</p>
<p>params.setParameter(HttpClientParams.USE_EXPECT_CONTINUE, Boolean.FALSE);</p>
<p>params.setParameter(HttpClientParams.CONNECTION_MANAGER_TIMEOUT, setting.getTimeout() * 1000);//单位是毫秒</p>
<p>Client client = Client.getInstance(testService);</p>
<p>client.setProperty(CommonsHttpMessageSender.HTTP_CLIENT_PARAMS, params);</p>
</blockquote>
<p>XFire是基于<a href="http://www.apache.org/" target="_blank">Apache</a>的<a href="http://hc.apache.org/" target="_blank">HttpClient</a>，所以实际上连接超时的参数是就是设置在HttpClient上的。</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.shoopman.org/2009/09/09/set-the-connection-timeout-parameters-for-webservice-client-generated-by-xfire.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>一次WebService调试的遗留问题</title>
		<link>http://blog.shoopman.org/2009/07/10/webservice-debug-with-xfire-replenish.html</link>
		<comments>http://blog.shoopman.org/2009/07/10/webservice-debug-with-xfire-replenish.html#comments</comments>
		<pubDate>Fri, 10 Jul 2009 16:39:45 +0000</pubDate>
		<dc:creator>Shoopman</dc:creator>
				<category><![CDATA[Tech]]></category>
		<category><![CDATA[WebService]]></category>
		<category><![CDATA[XFire]]></category>

		<guid isPermaLink="false">/2009/07/10/webservice-debug-with-xfire-replenish.html</guid>
		<description><![CDATA[&#160;&#160;&#160; 在上一篇《一次WebService调试》里，简单的完成了WebService的开发与调用，但还存在着两个问题：
1.客户端生成的代码里，RemoteUser这个对象，每个属性并不是预想中的String，而是javax.xml.bind.JAXBElement&#60;String&#62;。
&#160;&#160;&#160; 这个问题可以使用aegis来处理，在RemoteUser所在的包下添加一个RemoteUser.aegis.xml文件，如下：
&#60;?xml version=&#34;1.0&#34; encoding=&#34;UTF-8&#34;?&#62;     &#60;mappings xmlns:tns=&#34;http://www.xxx.com/services/nopService”&#62;      &#160;&#160;&#160; &#60;mapping name=&#34;tns:RemoteUser&#34;&#62;      &#160;&#160;&#160;&#160;&#160;&#160;&#160; &#60;property minOccurs=&#34;1&#34; maxOccurs=&#34;1&#34; nillable=&#34;true&#34; name=&#34;fax&#34; /&#62;      &#160;&#160;&#160;&#160;&#160;&#160;&#160; &#60;property minOccurs=&#34;1&#34; maxOccurs=&#34;1&#34; nillable=&#34;true&#34; name=&#34;mail&#34; /&#62;      &#160;&#160;&#160;&#160;&#160;&#160;&#160; &#60;property minOccurs=&#34;1&#34; maxOccurs=&#34;1&#34; nillable=&#34;true&#34; name=&#34;mobile&#34; /&#62; [...]]]></description>
			<content:encoded><![CDATA[<p>&#160;&#160;&#160; 在上一篇《<a href="http://blog.shoopman.org/2009/07/6/webservice-debug-with-xfire.html" target="_blank">一次WebService调试</a>》里，简单的完成了WebService的开发与调用，但还存在着两个问题：</p>
<p>1.客户端生成的代码里，RemoteUser这个对象，每个属性并不是预想中的String，而是javax.xml.bind.JAXBElement&lt;String&gt;。</p>
<p>&#160;&#160;&#160; 这个问题可以使用aegis来处理，在RemoteUser所在的包下添加一个RemoteUser.aegis.xml文件，如下：</p>
<blockquote><p>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;     <br />&lt;mappings xmlns:<font color="#0000ff">tns</font>=&quot;<font color="#0000ff">http://www.xxx.com/services/nopService</font>”&gt;      <br />&#160;&#160;&#160; &lt;mapping name=&quot;tns:RemoteUser&quot;&gt;      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;property minOccurs=&quot;1&quot; maxOccurs=&quot;1&quot; nillable=&quot;true&quot; name=&quot;fax&quot; /&gt;      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;property minOccurs=&quot;1&quot; maxOccurs=&quot;1&quot; nillable=&quot;true&quot; name=&quot;mail&quot; /&gt;      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;property minOccurs=&quot;1&quot; maxOccurs=&quot;1&quot; nillable=&quot;true&quot; name=&quot;mobile&quot; /&gt;      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;property minOccurs=&quot;1&quot; maxOccurs=&quot;1&quot; nillable=&quot;true&quot; name=&quot;name&quot; /&gt;      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;property minOccurs=&quot;1&quot; maxOccurs=&quot;1&quot; nillable=&quot;true&quot; name=&quot;post&quot; /&gt;      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;property minOccurs=&quot;1&quot; maxOccurs=&quot;1&quot; nillable=&quot;true&quot; name=&quot;pwd&quot; /&gt;      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;property minOccurs=&quot;1&quot; maxOccurs=&quot;1&quot; nillable=&quot;true&quot; name=&quot;sex&quot; /&gt;      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;property minOccurs=&quot;1&quot; maxOccurs=&quot;1&quot; nillable=&quot;true&quot; name=&quot;telephone&quot; /&gt;      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;property minOccurs=&quot;1&quot; maxOccurs=&quot;1&quot; nillable=&quot;true&quot; name=&quot;uid&quot; /&gt;      <br />&#160;&#160;&#160; &lt;/mapping&gt;      <br />&lt;/mappings&gt;</p>
</blockquote>
<p>2.客户端生成的代码里，getAccount()的返回值GetAccountResponse里的并不是预想中的List&lt;RemoteUser&gt;，而是一个ArrayOfRemoteUser对象中再包了一个类型为List&lt;RemoteUser&gt;的属性。</p>
<p>&#160;&#160;&#160;&#160; 现在这个问题还没有解决。。。。。。</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.shoopman.org/2009/07/10/webservice-debug-with-xfire-replenish.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>一次WebService调试</title>
		<link>http://blog.shoopman.org/2009/07/06/webservice-debug-with-xfire.html</link>
		<comments>http://blog.shoopman.org/2009/07/06/webservice-debug-with-xfire.html#comments</comments>
		<pubDate>Mon, 06 Jul 2009 14:48:54 +0000</pubDate>
		<dc:creator>Shoopman</dc:creator>
				<category><![CDATA[Tech]]></category>
		<category><![CDATA[WebService]]></category>
		<category><![CDATA[XFire]]></category>

		<guid isPermaLink="false">/2009/07/6/webservice-debug-with-xfire.html</guid>
		<description><![CDATA[&#160;&#160;&#160; 项目背景：中移动某省的一个管理系统A，而本公司另一产品线则负责此移动公司的门户P，现在需要进行用户数据的同步及实现单点登陆。门户P有一套简单的关于用户数据同步的WebService接口规范，定义了方法名、返回值及参数。
&#160;&#160;&#160; 系统A技术框架：JDK1.4 + Struts1.2.x + Spring + XFire。
&#160;&#160;&#160; 我对XFire不太熟悉，幸好系统A原先就已经使用了XFire向其他系统提供了WebService，我只需要依葫芦画瓢就行。还是简单的说一下XFire及与Spring集成的配置吧。
&#160;&#160;&#160; 1. web.xml的配置，配置xfire的servlet及URI映射
&#60;servlet&#62;      &#60;servlet-name&#62;xfire&#60;/servlet-name&#62;       &#60;servlet-class&#62;org.codehaus.xfire.spring.XFireSpringServlet&#60;/servlet-class&#62;       &#60;/servlet&#62; 
&#60;servlet-mapping&#62;      &#60;servlet-name&#62;xfire&#60;/servlet-name&#62;       &#60;url-pattern&#62;/services/*&#60;/url-pattern&#62;       &#60;/servlet-mapping&#62; 

&#160;&#160;&#160; 2. [...]]]></description>
			<content:encoded><![CDATA[<p>&#160;&#160;&#160; 项目背景：中移动某省的一个管理系统A，而本公司另一产品线则负责此移动公司的门户P，现在需要进行用户数据的同步及实现单点登陆。门户P有一套简单的关于用户数据同步的WebService接口规范，定义了方法名、返回值及参数。</p>
<p>&#160;&#160;&#160; 系统A技术框架：JDK1.4 + Struts1.2.x + Spring + XFire。</p>
<p>&#160;&#160;&#160; 我对XFire不太熟悉，幸好系统A原先就已经使用了XFire向其他系统提供了WebService，我只需要依葫芦画瓢就行。还是简单的说一下XFire及与Spring集成的配置吧。</p>
<p>&#160;&#160;&#160; 1. web.xml的配置，配置xfire的servlet及URI映射</p>
<blockquote><p>&lt;servlet&gt;      <br />&lt;servlet-name&gt;xfire&lt;/servlet-name&gt;       <br />&lt;servlet-class&gt;org.codehaus.xfire.spring.XFireSpringServlet&lt;/servlet-class&gt;       <br />&lt;/servlet&gt; </p>
<p>&lt;servlet-mapping&gt;      <br />&lt;servlet-name&gt;xfire&lt;/servlet-name&gt;       <br />&lt;url-pattern&gt;/services/*&lt;/url-pattern&gt;       <br />&lt;/servlet-mapping&gt; </p>
</blockquote>
<p>&#160;&#160;&#160; 2. services.xml的配置，位于WEB-INF/META-INF/xfire下，指定WebService的名称、路径及类接口及实现类</p>
<blockquote><p>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;      <br />&lt;beans xmlns=&quot;http://xfire.codehaus.org/config/1.0&quot;&gt;       <br />&#160;&#160;&#160;&#160; &lt;service&gt;&#160;&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;name&gt;NopService&lt;/name&gt;&#160;&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;namespace&gt;/services/NopService&lt;/namespace&gt;&#160;&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;serviceClass&gt;com.xxx.project.service.NopService&lt;/serviceClass&gt;&#160;&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;implementationClass&gt;com.xxx.project.service.NopServiceImpl&lt;/implementationClass&gt;&#160;&#160; <br />&#160;&#160;&#160;&#160;&#160; &lt;/service&gt;       <br />&lt;/beans&gt;</p>
</blockquote>
<p>服务接口类如下：</p>
<blockquote><p>package com.xxx.project.service</p>
<p>public interface NopService {      <br />&#160;&#160;&#160; /**       <br />&#160;&#160;&#160;&#160; * 获得用户信息       <br />&#160;&#160;&#160;&#160; * @param flag       <br />&#160;&#160;&#160;&#160; * @return       <br />&#160;&#160;&#160;&#160; */       <br />&#160;&#160;&#160; public List getAccount(String flag);</p>
<p>}</p>
</blockquote>
<p>getAccount返回的List包含的是对象是RemoteUser，一个纯粹的JavaBean，如下：</p>
<blockquote><p>package com.xxx.project.service</p>
<p>public class RemoteUser {      <br />&#160;&#160;&#160; private String uid;&#160; <br />&#160;&#160;&#160; private String name;&#160; <br />&#160;&#160;&#160; private String pwd;&#160; <br />&#160;&#160;&#160; private String sex;&#160; <br />&#160;&#160;&#160; private String mobile;&#160; <br />&#160;&#160;&#160; private String telephone;&#160; <br />&#160;&#160;&#160; private String mail;&#160; <br />&#160;&#160;&#160; private String post;&#160; <br />&#160;&#160;&#160; private String fax; </p>
<p>&#160;&#160;&#160; /** 省略掉的getter与setter */</p>
<p>}</p>
</blockquote>
<p>&#160;&#160;&#160; 3. spring beans 的配置</p>
<blockquote><p>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;      <br />&lt;!DOCTYPE beans PUBLIC       <br />&#160;&#160;&#160; &quot;-//SPRING//DTD BEAN//EN&quot;       <br />&#160;&#160;&#160; &quot;http://www.springframework.org/dtd/spring-beans.dtd&quot;&gt;       <br />&lt;beans&gt;       <br />&#160;&#160;&#160; &lt;import resource=&quot;classpath:org/codehaus/xfire/spring/xfire.xml&quot; /&gt;       <br />&#160;&#160;&#160; &lt;bean       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; class=&quot;org.springframework.web.servlet.handler.SimpleUrlHandlerMapping&quot;&gt;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;property name=&quot;urlMap&quot;&gt;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;map&gt;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;entry key=&quot;/nopService&quot;&gt;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;ref bean=&quot;xfire.nopService&quot;/&gt;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/entry&gt;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/map&gt;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/property&gt;       <br />&#160;&#160;&#160; &lt;/bean&gt;       <br />&#160;&#160;&#160; &lt;!&#8211; common xfire exporter,set the parent to this bean &#8211;&gt;       <br />&#160;&#160;&#160; &lt;bean id=&quot;commonXFireExporter&quot;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; class=&quot;org.codehaus.xfire.spring.remoting.XFireExporter&quot;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; lazy-init=&quot;false&quot; abstract=&quot;true&quot;&gt;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;property name=&quot;serviceFactory&quot; ref=&quot;xfire.serviceFactory&quot; /&gt;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;property name=&quot;xfire&quot; ref=&quot;xfire&quot; /&gt;       <br />&#160;&#160;&#160; &lt;/bean&gt;       <br />&#160;&#160;&#160; &lt;!&#8211; Declare a parent bean with all properties common to both services &#8211;&gt;       <br />&#160;&#160;&#160; &lt;bean id=&quot;xfire.nopService&quot; parent=&quot;commonXFireExporter&quot;&gt;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;property name=&quot;name&quot; value=&quot;nopService&quot;/&gt;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;property name=&quot;namespace&quot; value=&quot;<font color="#ff0000">http://<font color="#ff0000">www</font>.xxx.com/services/nopService</font>&quot;/&gt;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;property name=&quot;serviceBean&quot; ref=&quot;nopService&quot; /&gt;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;property name=&quot;serviceInterface&quot;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; value=&quot;com.xxx.project.service.NopService&quot; /&gt;       <br />&#160;&#160;&#160; &lt;/bean&gt;       <br />&lt;/beans&gt;</p>
</blockquote>
<p>&#160;&#160;&#160; 4.aegis的配置，由于接口上的返回类型是集合类，需要配置一个NopService.aegis.xml的文件来告诉xfire包含在集合中的是什么类型，注意到文件名是接口名+.aegis.xml，位置跟接口的一样。</p>
<blockquote><p>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;      <br />&lt;mappings&gt;       <br />&#160;&#160;&#160; &lt;mapping&gt;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;method name=&quot;getAccount&quot;&gt;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;return-type       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; componentType=&quot;com.xxx.project.service.RemoteUser&quot;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; minOccurs=&quot;1&quot; maxOccurs=&quot;1&quot; /&gt;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/method&gt;       <br />&#160;&#160;&#160; &lt;/mapping&gt;       <br />&lt;/mappings&gt;</p>
</blockquote>
<p>&#160;</p>
<p>部署到Tomcat中，通过浏览器访问<a title="http://localhost:8080/services/nopService?wsdl" href="http://localhost:8080/services/nopService?wsdl">http://localhost:8080/services/nopService?wsdl</a>，得到了类似如下的WSDL：</p>
<blockquote><p>&lt;?xml version=&quot;1.0<br />
&quot; encoding=&quot;UTF-8&quot;?&gt;      <br />&lt;wsdl:definitions targetNamespace=&quot;<font color="#ff0000">http://www.xxx.com/services/nopService</font>&quot;       <br />&#160;&#160; <font color="#ff0000">xmlns:tns=&quot;http://www.xxx.com/services/nopService&quot;</font> xmlns:wsdlsoap=&quot;http://schemas.xmlsoap.org/wsdl/soap/&quot;       <br />&#160;&#160;&#160; xmlns:soap12=&quot;http://www.w3.org/2003/05/soap-envelope&quot; <font color="#ff0000">xmlns:ns1=&quot;http://project.xxx.com&quot;</font>       <br />&#160;&#160;&#160; xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot; xmlns:soapenc11=&quot;http://schemas.xmlsoap.org/soap/encoding/&quot;       <br />&#160;&#160;&#160; xmlns:soapenc12=&quot;http://www.w3.org/2003/05/soap-encoding&quot; xmlns:soap11=&quot;http://schemas.xmlsoap.org/soap/envelope/&quot;       <br />&#160;&#160;&#160; xmlns:wsdl=&quot;http://schemas.xmlsoap.org/wsdl/&quot;&gt;       <br />&#160;&#160;&#160; &lt;wsdl:types&gt;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; <font color="#ff0000">&lt;xsd:schema</font> xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; attributeFormDefault=&quot;qualified&quot; elementFormDefault=&quot;qualified&quot;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; targetNamespace=&quot;http://www.xxx.com/services/nopService&quot;&gt;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;xsd:element name=&quot;getAccount&quot;&gt;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;xsd:complexType&gt;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;xsd:sequence&gt;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;xsd:element maxOccurs=&quot;1&quot; minOccurs=&quot;1&quot; name=&quot;in0&quot;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; nillable=&quot;true&quot; type=&quot;xsd:string&quot; /&gt;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/xsd:sequence&gt;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/xsd:complexType&gt;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/xsd:element&gt;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;xsd:element name=&quot;getAccountResponse&quot;&gt;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;xsd:complexType&gt;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;xsd:sequence&gt;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;xsd:element maxOccurs=&quot;1&quot; minOccurs=&quot;1&quot; name=&quot;out&quot;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; nillable=&quot;true&quot; type=&quot;<font color="#ff0000">ns1:ArrayOfRemoteUser</font>&quot; /&gt;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/xsd:sequence&gt;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/xsd:complexType&gt;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/xsd:element&gt;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; <font color="#ff0000">&lt;/xsd:schema&gt;        <br /></font>&#160;&#160;&#160;&#160;&#160;&#160;&#160; <font color="#ff0000">&lt;xsd:schema</font> xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; attributeFormDefault=&quot;qualified&quot; elementFormDefault=&quot;qualified&quot;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; targetNamespace=&quot;http://project.xxx.com&quot;&gt;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;xsd:complexType name=&quot;ArrayOfRemoteUser&quot;&gt;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;xsd:sequence&gt;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;xsd:element maxOccurs=&quot;unbounded&quot; minOccurs=&quot;0&quot;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; name=&quot;RemoteUser&quot; nillable=&quot;true&quot; type=&quot;ns1:RemoteUser&quot; /&gt;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/xsd:sequence&gt;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/xsd:complexType&gt;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;xsd:complexType name=&quot;RemoteUser&quot;&gt;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;xsd:sequence&gt;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;xsd:element <font color="#0000ff">minOccurs=&quot;0&quot;</font> name=&quot;fax&quot; nillable=&quot;true&quot;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; type=&quot;xsd:string&quot; /&gt;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;xsd:element <font color="#0000ff">minOccurs=&quot;0&quot;</font> name=&quot;mail&quot; nillable=&quot;true&quot;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; type=&quot;xsd:string&quot; /&gt;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;xsd:element <font color="#0000ff">minOccurs=&quot;0&quot;</font> name=&quot;mobile&quot; nillable=&quot;true&quot;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; type=&quot;xsd:string&quot; /&gt;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;xsd:element minOccurs=&quot;0&quot; name=&quot;name&quot; nillable=&quot;true&quot;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; type=&quot;xsd:string&quot; /&gt;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;xsd:element minOccurs=&quot;0&quot; name=&quot;post&quot; nillable=&quot;true&quot;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; type=&quot;xsd:string&quot; /&gt;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;xsd:element minOccurs=&quot;0&quot; name=&quot;pwd&quot; nillable=&quot;true&quot;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;<br />
 type=&quot;xsd:string&quot; /&gt;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;xsd:element minOccurs=&quot;0&quot; name=&quot;sex&quot; nillable=&quot;true&quot;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; type=&quot;xsd:string&quot; /&gt;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;xsd:element minOccurs=&quot;0&quot; name=&quot;telephone&quot; nillable=&quot;true&quot;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; type=&quot;xsd:string&quot; /&gt;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;xsd:element minOccurs=&quot;0&quot; name=&quot;uid&quot; nillable=&quot;true&quot;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; type=&quot;xsd:string&quot; /&gt;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/xsd:sequence&gt;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/xsd:complexType&gt;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; <font color="#ff0000">&lt;/xsd:schema&gt;</font>       <br />&#160;&#160;&#160; &lt;/wsdl:types&gt;</p>
<p>&#160;&#160;&#160; &lt;!&#8211; 省略了部分 &#8211;&gt;      <br />&#160;&#160;&#160; &lt;/wsdl:definitions&gt;</p>
</blockquote>
<p>wsdl文件都出来，算是成功一半了，接着就是生成客户端来测试了。像Axis和cfx一样，XFire也带有代码生成工具，也有ant任务，如下：</p>
<blockquote><p>&lt;project name=&quot;xfire-client&quot; default=&quot;wsgen&quot; basedir=&quot;.&quot;&gt;      <br />&#160;&#160;&#160; &lt;path id=&quot;classpath&quot;&gt;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;fileset dir=&quot;lib&quot;&gt;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;include name=&quot;**/*.jar&quot; /&gt;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/fileset&gt;       <br />&#160;&#160;&#160; &lt;/path&gt;       <br />&#160;&#160;&#160; &lt;target name=&quot;wsgen&quot;&gt;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;taskdef name=&quot;wsgen&quot; classname=&quot;org.codehaus.xfire.gen.WsGenTask&quot; classpathref=&quot;classpath&quot; /&gt;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;wsgen outputDirectory=&quot;appClientModule&quot; wsdl=&quot;http://localhost:8080/services/nopService?wsdl&quot; package=&quot;com.xxx.project.client&quot; overwrite=&quot;true&quot; /&gt;       <br />&#160;&#160;&#160; &lt;/target&gt;       <br />&lt;/project&gt;</p>
<p>&#160;</p>
</blockquote>
<p>客户代码生成后，再写一个测试类来调用WebService：</p>
<blockquote><p>public class NopServiceTest { </p>
<p>&#160;&#160;&#160; public static void main(String[] args) {      <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; nopServiceClient client = new nopServiceClient();       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; nopServicePortType service = client.getnopServiceHttpPort(&quot;<a href="http://localhost:8080/services/nopService&quot;);">http://localhost:8080/services/nopService&quot;);</a>       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; ArrayOfRemoteUser rets = service.getAccount(&quot;&quot;);       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; List&lt;RemoteUser&gt; list = rets.getRemoteUser();       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; System.out.println(list.size());       <br />&#160;&#160;&#160; } </p>
<p>}</p>
</blockquote>
<p>&#160;&#160;&#160; OK！测试成功。赶紧打包部署到测试服务器上，让门户P的开发人员来测试。对方很快来了反应：wsdl不符合他们的规范，在将wsdl导入门户P时报错&#8212;-无法识别类型“<font color="#ff0000">ns1:ArrayOfRemoteUser</font>”。我能得到的错误信息就这么多，以及一份符合所谓规范的wsdl样例，貌似是由Axis生成的：</p>
<blockquote><p>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot; ?&gt;      <br />&lt;wsdl:definitions targetNamespace=&quot;<a href="http://security.interfaces.eoms.yyy.com&quot;">http://security.interfaces.eoms.yyy.com&quot;</a>       <br />&#160;&#160;&#160; xmlns:apachesoap=&quot;http://xml.apache.org/xml-soap&quot; xmlns:impl=&quot;<a href="http://security.interfaces.eoms.yyy.com&quot;">http://security.interfaces.eoms.yyy.com&quot;</a>       <br />&#160;&#160;&#160; xmlns:intf=&quot;http://security.interfaces.eoms.yyy.com&quot; xmlns:wsdl=&quot;http://schemas.xmlsoap.org/wsdl/&quot;       <br />&#160;&#160;&#160; xmlns:wsdlsoap=&quot;http://schemas.xmlsoap.org/wsdl/soap/&quot; xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot;&gt;       <br />&#160;&#160;&#160; &lt;!&#8211;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; WSDL created by Apache Axis version: 1.3 Built on Oct 05, 2005       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; (05:23:37 EDT)       <br />&#160;&#160;&#160; &#8211;&gt;       <br />&#160;&#160;&#160; &lt;wsdl:types&gt;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;schema elementFormDefault=&quot;qualified&quot;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; targetNamespace=&quot;http://security.interfaces.eoms.yyy.com&quot; xmlns=&quot;http://www.w3.org/2001/XMLSchema&quot;&gt;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;element name=&quot;getAccount&quot;&gt;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;complexType&gt;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;sequence&gt;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;element name=&quot;flag&quot; type=&quot;xsd:string&quot; /&gt;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/sequence&gt;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/complexType&gt;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/element&gt;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;element name=&quot;getAccountResponse&quot;&gt;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;complexType&gt;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;sequence&gt;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;element maxOccurs=&quot;unbounded&quot; name=&quot;getAccountReturn&quot;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; type=&quot;impl:RemoteUser&quot; /&gt;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/sequence&gt;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/complexType&gt;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/element&gt;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;complexType name=&quot;RemoteUser&quot;&gt;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;seque<br />
nce&gt;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;element name=&quot;fax&quot; nillable=&quot;true&quot; type=&quot;xsd:string&quot; /&gt;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;element name=&quot;mail&quot; nillable=&quot;true&quot; type=&quot;xsd:string&quot; /&gt;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;element name=&quot;mobile&quot; nillable=&quot;true&quot; type=&quot;xsd:string&quot; /&gt;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;element name=&quot;name&quot; nillable=&quot;true&quot; type=&quot;xsd:string&quot; /&gt;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;element name=&quot;post&quot; nillable=&quot;true&quot; type=&quot;xsd:string&quot; /&gt;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;element name=&quot;pwd&quot; nillable=&quot;true&quot; type=&quot;xsd:string&quot; /&gt;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;element name=&quot;sex&quot; nillable=&quot;true&quot; type=&quot;xsd:string&quot; /&gt;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;element name=&quot;telephone&quot; nillable=&quot;true&quot; type=&quot;xsd:string&quot; /&gt;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;element name=&quot;uid&quot; nillable=&quot;true&quot; type=&quot;xsd:string&quot; /&gt;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/sequence&gt;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/complexType&gt;       <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/schema&gt;       <br />&#160;&#160;&#160; &lt;/wsdl:types&gt;</p>
</blockquote>
<p>&#160;&#160;&#160; 由于非技术原因，此问题得由我来处理。通过对比两个wsdl文件、长时间及多次的测试，最终锁定了门户P无法识别”ns1:ArrayOfRemoteUser”的原因：系统A的wsdl有两个<font color="#ff0000">&lt;xsd:schema&gt;</font>节点。又经过多次尝试，才终于把xfire生成的wsdl的schema节点合并为一个，方法是，把前面第3步的spring beans配置中的标红处修改如下，跟接口类颠倒的包名保持一致：</p>
<blockquote><p>&lt;bean id=&quot;xfire.nopService&quot; parent=&quot;commonXFireExporter&quot;&gt;    <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;property name=&quot;name&quot; value=&quot;nopService&quot;/&gt;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;property name=&quot;namespace&quot; value=&quot;<font color="#ff0000">http://service.project.</font><font color="#ff0000">xxx.com</font>&quot;/&gt;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;property name=&quot;serviceBean&quot; ref=&quot;nopService&quot; /&gt;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;property name=&quot;serviceInterface&quot;     <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; value=&quot;<font color="#ff0000">com.xxx.project.service</font>.NopService&quot; /&gt;&#160; <br />&lt;/bean&gt;</p></blockquote>
<p>后来在网上找到可能的原因：<a title="https://issues.apache.org/jira/browse/CXF-1117" href="https://issues.apache.org/jira/browse/CXF-1117" target="_blank">https://issues.apache.org/jira/browse/CXF-1117</a>，门户P的cxf包可能较旧，不支持多个xmlns。</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.shoopman.org/2009/07/06/webservice-debug-with-xfire.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
