我有一个 RPC / Encoded Web服务提供程序,它以base64格式公开附件。 一切正常,这是输出
<multiRef id="id16" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns4:Documento" xmlns:ns4="urn:interpro_Documento.rfc205.regione.toscana.it" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
<descr xsi:type="xsd:string">smime.p7s</descr>
<ext xsi:type="xsd:string">p7s</ext>
<document xsi:type="soapenc:base64">UEQ5NGJXd2dkbVZ5YzJsdmJqMGlNUzR3SWlCbGJtTnZaR2x1WnowaVNWTlBMVGc0TlRrdE1TSS9QZ284SVVSUFExUlpVRVVnVTJWbgpibUYwZFhKaElGTlpVMVJGVFNBaVUyVm5ibUYwZFhKaExtUjBaQ0krQ2p4VFpXZHVZWFIxY21FK0NnazhTVzUwWlhOMFlYcHBiMjVsClBnb0pDVHhKWkdWdWRHbG1hV05oZEc5eVpUNEtDUWtKUEVOdlpHbGpaVUZ0YldsdWFYTjBjbUY2YVc5dVpUNURRMVF6UEM5RGIyUnAKWTJWQmJXMXBibWx6ZEhKaGVtbHZibVUrQ2drSkNUeERiMlJwWTJWQlQwOCtRVTlQTGtORFZETThMME52WkdsalpVRlBUejRLQ1FrSgpQRTUxYldWeWIxSmxaMmx6ZEhKaGVtbHZibVUrTURBd01ERXpPRHd2VG5WdFpYSnZVbVZuYVhOMGNtRjZhVzl1WlQ0S0NRa0pQRVJoCmRHRlNaV2RwYzNSeVlYcHBiMjVsUGpJd01UUXRNRE10TWpZOEwwUmhkR0ZTWldkcGMzUnlZWHBwYjI1bFBnb0pDVHd2U1dSbGJuUnAKWm1sallYUnZjbVUrQ2drSlBFOXlZVkpsWjJsemRISmhlbWx2Ym1VK0Nna0pDVEUyT2pRd09qTTBDZ2tKUEM5UGNtRlNaV2RwYzNSeQpZWHBwYjI1bFBnb0pDVHhQY21sbmFXNWxQZ29KQ1FrOFNXNWthWEpwZW5wdlZHVnNaVzFoZEdsamJ5QjBhWEJ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WdWRHODlJazFKVFVVaVBnb0pQRTluCloyVjBkRzgrQ2drSlNXMXRZV2RwYm1VZ1JHOWpkVzFsYm5Sdk1EQXhDZ2s4TDA5bloyVjBkRzgrQ2p3dlJHOWpkVzFsYm5SdlBnb0oKUEM5RVpYTmpjbWw2YVc5dVpUNEtQQzlUWldkdVlYUjFjbUUrQ2c9PQo=</document>
</multiRef>
以 RPC / Literal 格式提供的相同网络服务公开了这一点:
<documento>
<descr>smime.p7s</desc>
<ext>p7s</ext>
<document>85</document>
<document>69</document>
<document>81</document>
<document>53</document>
<document>78</document>
<document>71</document>
<document>74</document>
<document>88</document>
<document>100</document>
<document>50</document>
<document>100</document>
<document>107</document>
<document>98</document>
<document>86</document>
<document>90</document>
<document>53</document>
<document>89</document>
<document>122</document>
<document>74</document>
<document>115</document>
.........
.........
有什么问题?如何使用RPC / Literal SOAP消息格式只有一个带有base64格式的标签?
答案 0 :(得分:2)
从您的示例中我假设该文档是一个字节数组。这就是JAX-RPC规范所说的:
5.3.3字节数组byte []和Byte []都映射到xsd:base64Binary类型。 java.lang.Byte []类型到的映射 xsd:base64Binary类型现已弃用,因为它无法表示 空值准确。相反,Byte []应该映射到常规 数组遵循第5.3.4节中的规则。
所以,如果你真的有byte[]
,那么第一个映射是正确的,如果你有Byte[]
,那么它是第二个(开销很大,但能够表示空值) 。 AFAIR在Apache Axis中存在错误,例如错误,也许你的文档就是这种情况。因此,请检查您是否真的使用byte[]
以及您正在使用的库。而且,就像评论者说的那样,除非你被迫,否则你不应该使用rpc风格。改为使用文档/文字绑定。